From bef42ee1cf53457ae53eb1a651f2161a1e7eb347 Mon Sep 17 00:00:00 2001 From: Waqas Javed <7674577+w-javed@users.noreply.github.com> Date: Tue, 21 Jan 2025 13:42:40 -0800 Subject: [PATCH 01/29] Azure AI Evaluation Release 1.2.0 --- sdk/evaluation/azure-ai-evaluation/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md index 4d420d40695e..5c423cf2eac2 100644 --- a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md +++ b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.2.0 (Unreleased) +## 1.2.0 (01-23-2024) ### Features Added - CSV files are now supported as data file inputs with `evaluate()` API. The CSV file should have a header row with column names that match the `data` and `target` fields in the `evaluate()` method and the filename should be passed as the `data` parameter. From e965115dd0bfa79d62f48ecbc6b496fbcce030f3 Mon Sep 17 00:00:00 2001 From: Waqas Javed <7674577+w-javed@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:05:28 -0800 Subject: [PATCH 02/29] Azure AI Evaluation Release 1.2.0 --- sdk/evaluation/azure-ai-evaluation/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md index 5c423cf2eac2..d8f338846f88 100644 --- a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md +++ b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md @@ -6,6 +6,7 @@ - CSV files are now supported as data file inputs with `evaluate()` API. The CSV file should have a header row with column names that match the `data` and `target` fields in the `evaluate()` method and the filename should be passed as the `data` parameter. ### Breaking Changes +- In release 1.1.0, Multimodal image support was added in `ContentSafetyEvaluator`, `ViolenceEvaluator`, `SexualEvaluator`, `SelfHarmEvaluator`, `HateUnfairnessEvaluator` and `ProtectedMaterialEvaluator`. Hence, `ContentSafetyMultimodalEvaluator`, `ViolenceMultimodalEvaluator`, `SexualMultimodalEvaluator`, `SelfHarmMultimodalEvaluator`, `HateUnfairnessMultimodalEvaluator` and `ProtectedMaterialMultimodalEvaluator` will be removed in next release azure-ai-evaluation:1.3.0. ### Bugs Fixed - Removed `[remote]` extra. This is no longer needed when tracking results in Azure AI Studio. From 43f56b55c28305f10a52820c1673ce29afc4bde4 Mon Sep 17 00:00:00 2001 From: Scott Beddall <45376673+scbedd@users.noreply.github.com> Date: Tue, 21 Jan 2025 13:40:01 -0800 Subject: [PATCH 03/29] fix the intersphinx references for a new reference methodology (#39332) --- doc/sphinx/_static/js/get_options.js | 16 ++++++++-------- doc/sphinx/conf.py | 4 ++-- doc/sphinx/individual_build_conf.py | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/sphinx/_static/js/get_options.js b/doc/sphinx/_static/js/get_options.js index 4e79921b4066..46ac0f0df866 100644 --- a/doc/sphinx/_static/js/get_options.js +++ b/doc/sphinx/_static/js/get_options.js @@ -23,11 +23,11 @@ function currentPackage(){ function httpGetAsync(targetUrl, callback) { var xmlHttp = new XMLHttpRequest(); - xmlHttp.onreadystatechange = function() { + xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) callback(xmlHttp.responseText); } - xmlHttp.open("GET", targetUrl, true); // true for asynchronous + xmlHttp.open("GET", targetUrl, true); // true for asynchronous xmlHttp.send(null); } @@ -45,8 +45,8 @@ function hideSelectors(selectors){ function populateOptions(optionSelector, otherSelectors){ if(currentPackage()){ - var versionRequestUrl = "https://azuresdkdocs.blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/" + currentPackage() + "/versioning/versions" - + var versionRequestUrl = "https://azuresdkdocs.z19.web.core.windows.net/" + SELECTED_LANGUAGE + "/" + currentPackage() + "/versioning/versions" + httpGetAsync(versionRequestUrl, function(responseText){ if(responseText){ options = responseText.match(/[^\r\n]+/g) @@ -68,7 +68,7 @@ function populateOptions(optionSelector, otherSelectors){ function populateVersionDropDown(selector, values){ var select = $(selector) - + $('option', select).remove() $.each(values, function(index, text) { @@ -80,17 +80,17 @@ function populateVersionDropDown(selector, values){ select.selectedIndex = 0 } else { - select.val(version) + select.val(version) } } function getPackageUrl(language, package, version){ - return "https://azuresdkdocs.blob.core.windows.net/$web/" + language + "/" + package + "/"+ version + "/index.html" + return "https://azuresdkdocs.z19.web.core.windows.net/" + language + "/" + package + "/"+ version + "/index.html" } function populateIndexList(selector, packageName) { - url = "https://azuresdkdocs.blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/" + packageName + "/versioning/versions" + url = "https://azuresdkdocs.z19.web.windows.net/" + SELECTED_LANGUAGE + "/" + packageName + "/versioning/versions" httpGetAsync(url, function (responseText){ if(responseText){ diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index f0d6ce555521..f2feed4d3c96 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -66,8 +66,8 @@ 'trio': ('https://trio.readthedocs.io/en/stable/', None), 'msal': ('https://msal-python.readthedocs.io/en/latest/', None), # Azure packages - 'azure-core': ('https://azuresdkdocs.blob.core.windows.net/$web/python/azure-core/latest/', None), - 'azure-identity': ('https://azuresdkdocs.blob.core.windows.net/$web/python/azure-identity/latest/', None), + 'azure-core': ('https://azuresdkdocs.z19.web.core.windows.net/python/azure-core/latest/', None), + 'azure-identity': ('https://azuresdkdocs.z19.web.core.windows.net/python/azure-identity/latest/', None), } autodoc_member_order = 'groupwise' diff --git a/doc/sphinx/individual_build_conf.py b/doc/sphinx/individual_build_conf.py index a289c668e3ed..74df67599c51 100644 --- a/doc/sphinx/individual_build_conf.py +++ b/doc/sphinx/individual_build_conf.py @@ -64,8 +64,8 @@ 'trio': ('https://trio.readthedocs.io/en/stable/', None), 'msal': ('https://msal-python.readthedocs.io/en/latest/', None), # Azure packages - 'azure-core': ('https://azuresdkdocs.blob.core.windows.net/$web/python/azure-core/1.0.0/', None), - 'azure-identity': ('https://azuresdkdocs.blob.core.windows.net/$web/python/azure-identity/1.0.0/', None), + 'azure-core': ('https://azuresdkdocs.z19.web.core.windows.net/python/azure-core/1.0.0/', None), + 'azure-identity': ('https://azuresdkdocs.z19.web.core.windows.net/python/azure-identity/1.0.0/', None), } autodoc_member_order = 'groupwise' From ff0989eedb613bc4544bc2b140114564dded1f00 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 21 Jan 2025 15:16:26 -0800 Subject: [PATCH 04/29] handle only deleted files in a - pullrequest build (#39266) Co-authored-by: Scott Beddall --- eng/common/scripts/Generate-PR-Diff.ps1 | 2 ++ eng/common/scripts/Package-Properties.ps1 | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/eng/common/scripts/Generate-PR-Diff.ps1 b/eng/common/scripts/Generate-PR-Diff.ps1 index e010e176399d..4e34032c47c8 100644 --- a/eng/common/scripts/Generate-PR-Diff.ps1 +++ b/eng/common/scripts/Generate-PR-Diff.ps1 @@ -48,6 +48,7 @@ $changedFiles = @() $changedServices = @() $changedFiles = Get-ChangedFiles -DiffPath $TargetPath +$deletedFiles = Get-ChangedFiles -DiffPath $TargetPath -DiffFilterType "D" if ($changedFiles) { $changedServices = Get-ChangedServices -ChangedFiles $changedFiles @@ -63,6 +64,7 @@ $result = [PSCustomObject]@{ "ChangedFiles" = $changedFiles "ChangedServices" = $changedServices "ExcludePaths" = $ExcludePaths + "DeletedFiles" = $deletedFiles "PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" } } diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index bc7b5738e2d3..a23ee76bbda6 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -162,6 +162,14 @@ function Get-PrPkgProperties([string]$InputDiffJson) { $allPackageProperties = Get-AllPkgProperties $diff = Get-Content $InputDiffJson | ConvertFrom-Json $targetedFiles = $diff.ChangedFiles + + if ($diff.DeletedFiles) { + if (-not $targetedFiles) { + $targetedFiles = @() + } + $targetedFiles += $diff.DeletedFiles + } + # The exclude paths and the targeted files paths aren't full OS paths, they're # GitHub paths meaning they're relative to the repo root and slashes are forward # slashes "/". The ExcludePaths need to have a trailing slash added in order From 4c3bf1513f9f03102f243ce853befb66b41c2e5f Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Tue, 21 Jan 2025 15:27:08 -0800 Subject: [PATCH 05/29] fix tests weekly (#39338) --- sdk/openai/azure-openai/tests/test_assistants.py | 2 +- sdk/openai/azure-openai/tests/test_assistants_async.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/openai/azure-openai/tests/test_assistants.py b/sdk/openai/azure-openai/tests/test_assistants.py index 41db303f0460..3fed8f4c08aa 100644 --- a/sdk/openai/azure-openai/tests/test_assistants.py +++ b/sdk/openai/azure-openai/tests/test_assistants.py @@ -193,7 +193,7 @@ def handle_run_failure(self, run: Run): @configure @pytest.mark.parametrize( "api_type, api_version", - [(ASST_AZURE, PREVIEW), (GPT_4_OPENAI, "v1")] + [(ASST_AZURE, PREVIEW)] ) def test_assistants_crud(self, client, api_type, api_version, **kwargs): diff --git a/sdk/openai/azure-openai/tests/test_assistants_async.py b/sdk/openai/azure-openai/tests/test_assistants_async.py index 387ae756854b..d8f313ae786c 100644 --- a/sdk/openai/azure-openai/tests/test_assistants_async.py +++ b/sdk/openai/azure-openai/tests/test_assistants_async.py @@ -193,7 +193,7 @@ def handle_run_failure(self, run: Run): @pytest.mark.asyncio @pytest.mark.parametrize( "api_type, api_version", - [(ASST_AZURE, PREVIEW), (GPT_4_OPENAI, "v1")] + [(ASST_AZURE, PREVIEW)] ) async def test_assistants_crud(self, client_async, api_type, api_version, **kwargs): try: From 4bf375ec6b97b1604a760a11fa984642127c1c17 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Tue, 21 Jan 2025 15:36:04 -0800 Subject: [PATCH 06/29] [Storage] update perf tests core baseline (#39336) * [Storage] update perf tests core baseline * update storage file baselien --- sdk/storage/azure-storage-blob/perf-tests.yml | 2 +- sdk/storage/azure-storage-file-datalake/perf-tests.yml | 4 ++-- sdk/storage/azure-storage-file-share/perf-tests.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/storage/azure-storage-blob/perf-tests.yml b/sdk/storage/azure-storage-blob/perf-tests.yml index de398eb12f96..7b8a25d5938c 100644 --- a/sdk/storage/azure-storage-blob/perf-tests.yml +++ b/sdk/storage/azure-storage-blob/perf-tests.yml @@ -5,7 +5,7 @@ Project: sdk/storage/azure-storage-blob PrimaryPackage: azure-storage-blob PackageVersions: -- azure-core: 1.29.5 +- azure-core: 1.31.0 azure-storage-blob: 12.18.3 - azure-core: source azure-storage-blob: source diff --git a/sdk/storage/azure-storage-file-datalake/perf-tests.yml b/sdk/storage/azure-storage-file-datalake/perf-tests.yml index 60996b8cbd85..13208f1a2854 100644 --- a/sdk/storage/azure-storage-file-datalake/perf-tests.yml +++ b/sdk/storage/azure-storage-file-datalake/perf-tests.yml @@ -5,8 +5,8 @@ Project: sdk/storage/azure-storage-file-datalake PrimaryPackage: azure-storage-file-datalake PackageVersions: -- azure-core: 1.29.5 - azure-storage-file-datalake: 12.13.2 +- azure-core: 1.31.0 + azure-storage-file-datalake: 12.18.0 - azure-core: source azure-storage-file-datalake: source diff --git a/sdk/storage/azure-storage-file-share/perf-tests.yml b/sdk/storage/azure-storage-file-share/perf-tests.yml index 7c6393bf973a..e2f2f70298fb 100644 --- a/sdk/storage/azure-storage-file-share/perf-tests.yml +++ b/sdk/storage/azure-storage-file-share/perf-tests.yml @@ -5,8 +5,8 @@ Project: sdk/storage/azure-storage-file-share PrimaryPackage: azure-storage-file-share PackageVersions: -- azure-core: 1.29.5 - azure-storage-file-share: 12.14.2 +- azure-core: 1.31.0 + azure-storage-file-share: 12.20.0 - azure-core: source azure-storage-file-share: source From f4091cb363580a28ddc643e95b86578798384a99 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 21 Jan 2025 21:02:19 -0800 Subject: [PATCH 07/29] [AutoRelease] t2-computeschedule-2025-01-10-50036(can only be merged by SDK owner) (#39105) * code and test * Update CHANGELOG.md for new model properties --------- Co-authored-by: azure-sdk Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> --- .../azure-mgmt-computeschedule/CHANGELOG.md | 10 + .../azure-mgmt-computeschedule/_meta.json | 4 +- .../azure/mgmt/computeschedule/__init__.py | 12 +- .../azure/mgmt/computeschedule/_client.py | 8 +- .../mgmt/computeschedule/_configuration.py | 10 +- .../azure/mgmt/computeschedule/_model_base.py | 39 ++- .../mgmt/computeschedule/_serialization.py | 25 +- .../azure/mgmt/computeschedule/_version.py | 2 +- .../mgmt/computeschedule/aio/__init__.py | 12 +- .../azure/mgmt/computeschedule/aio/_client.py | 8 +- .../computeschedule/aio/_configuration.py | 10 +- .../aio/operations/__init__.py | 14 +- .../aio/operations/_operations.py | 160 +++++---- .../mgmt/computeschedule/models/__init__.py | 85 +++-- .../mgmt/computeschedule/models/_enums.py | 2 +- .../mgmt/computeschedule/models/_models.py | 318 ++++++++++-------- .../computeschedule/operations/__init__.py | 14 +- .../computeschedule/operations/_operations.py | 180 ++++++---- ..._maximum_set_gen.py => operations_list.py} | 4 +- .../operations_list_minimum_set_gen.py | 40 --- ...ons_virtual_machines_cancel_operations.py} | 8 +- ...hines_cancel_operations_minimum_set_gen.py | 45 --- ...ns_virtual_machines_execute_deallocate.py} | 12 +- ...ines_execute_deallocate_maximum_set_gen.py | 53 --- ...ons_virtual_machines_execute_hibernate.py} | 10 +- ...hines_execute_hibernate_maximum_set_gen.py | 53 --- ...actions_virtual_machines_execute_start.py} | 12 +- ..._machines_execute_start_maximum_set_gen.py | 53 --- ..._virtual_machines_get_operation_errors.py} | 8 +- ...es_get_operation_errors_maximum_set_gen.py | 42 --- ..._virtual_machines_get_operation_status.py} | 10 +- ...es_get_operation_status_maximum_set_gen.py | 45 --- ...ons_virtual_machines_submit_deallocate.py} | 18 +- ...hines_submit_deallocate_maximum_set_gen.py | 58 ---- ...ions_virtual_machines_submit_hibernate.py} | 16 +- ...chines_submit_hibernate_maximum_set_gen.py | 58 ---- ..._actions_virtual_machines_submit_start.py} | 18 +- ...l_machines_submit_start_maximum_set_gen.py | 58 ---- ...edule_mgmt_scheduled_actions_operations.py | 24 +- ...mgmt_scheduled_actions_operations_async.py | 24 +- .../sdk_packaging.toml | 2 +- .../azure-mgmt-computeschedule/setup.py | 2 +- ...ute_schedule_mgmt_operations_async_test.py | 1 - ...t_compute_schedule_mgmt_operations_test.py | 1 - .../tsp-location.yaml | 2 +- 45 files changed, 626 insertions(+), 964 deletions(-) rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{operations_list_maximum_set_gen.py => operations_list.py} (91%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_minimum_set_gen.py rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{scheduled_actions_virtual_machines_cancel_operations_maximum_set_gen.py => scheduled_actions_virtual_machines_cancel_operations.py} (82%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_minimum_set_gen.py rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{scheduled_actions_virtual_machines_execute_deallocate_minimum_set_gen.py => scheduled_actions_virtual_machines_execute_deallocate.py} (83%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_maximum_set_gen.py rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{scheduled_actions_virtual_machines_execute_hibernate_minimum_set_gen.py => scheduled_actions_virtual_machines_execute_hibernate.py} (81%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_maximum_set_gen.py rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{scheduled_actions_virtual_machines_execute_start_minimum_set_gen.py => scheduled_actions_virtual_machines_execute_start.py} (80%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_maximum_set_gen.py rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{scheduled_actions_virtual_machines_get_operation_errors_minimum_set_gen.py => scheduled_actions_virtual_machines_get_operation_errors.py} (86%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_maximum_set_gen.py rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{scheduled_actions_virtual_machines_get_operation_status_minimum_set_gen.py => scheduled_actions_virtual_machines_get_operation_status.py} (82%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_maximum_set_gen.py rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{scheduled_actions_virtual_machines_submit_deallocate_minimum_set_gen.py => scheduled_actions_virtual_machines_submit_deallocate.py} (74%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_maximum_set_gen.py rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{scheduled_actions_virtual_machines_submit_hibernate_minimum_set_gen.py => scheduled_actions_virtual_machines_submit_hibernate.py} (75%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_maximum_set_gen.py rename sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/{scheduled_actions_virtual_machines_submit_start_minimum_set_gen.py => scheduled_actions_virtual_machines_submit_start.py} (77%) delete mode 100644 sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_maximum_set_gen.py diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/CHANGELOG.md b/sdk/computeschedule/azure-mgmt-computeschedule/CHANGELOG.md index 7a30dc7f908b..4bb4f1bfd507 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/CHANGELOG.md +++ b/sdk/computeschedule/azure-mgmt-computeschedule/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0 (2025-01-20) + +### Features Added + + - Model `OperationErrorDetails` added property `timestamp` + - Model `OperationErrorDetails` added property `azure_operation_name` + - Model `ResourceOperationDetails` added property `timezone` + - Model `Schedule` added property `deadline` + - Model `Schedule` added property `timezone` + ## 1.0.0b1 (2024-09-26) ### Other Changes diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/_meta.json b/sdk/computeschedule/azure-mgmt-computeschedule/_meta.json index b2c662c901a2..a6070dd43671 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/_meta.json +++ b/sdk/computeschedule/azure-mgmt-computeschedule/_meta.json @@ -1,6 +1,6 @@ { - "commit": "4883fa5dbf6f2c9093fac8ce334547e9dfac68fa", + "commit": "b6075dbc2321933382ea91c787ee62c6bdb87e5d", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/computeschedule/ComputeSchedule.Management", - "@azure-tools/typespec-python": "0.33.0" + "@azure-tools/typespec-python": "0.37.3" } \ No newline at end of file diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/__init__.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/__init__.py index 8cec50265ad7..085e611df3da 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/__init__.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import ComputeScheduleMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ComputeScheduleMgmtClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "ComputeScheduleMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py index a050f7c069da..3847c339c628 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py @@ -20,11 +20,10 @@ from .operations import Operations, ScheduledActionsOperations if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ComputeScheduleMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class ComputeScheduleMgmtClient: """Microsoft.ComputeSchedule Resource Provider management API. :ivar operations: Operations operations @@ -37,9 +36,8 @@ class ComputeScheduleMgmtClient: # pylint: disable=client-accepts-api-version-k :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2024-08-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "2024-10-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_configuration.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_configuration.py index 271cb819f5a3..bc325d903761 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_configuration.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_configuration.py @@ -14,11 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ComputeScheduleMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -30,9 +29,8 @@ class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instan :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2024-08-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "2024-10-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -43,7 +41,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-08-15-preview") + api_version: str = kwargs.pop("api_version", "2024-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_model_base.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_model_base.py index 12ad7f29c71e..7f73b97b23ef 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_model_base.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_model_base.py @@ -1,10 +1,11 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines +# pylint: disable=protected-access, broad-except import copy import calendar @@ -573,7 +574,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: def copy(self) -> "Model": return Model(self.__dict__) - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' @@ -584,8 +585,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di annotations = { k: v for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member - for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() } for attr, rf in attr_to_rest_field.items(): rf._module = cls.__module__ @@ -600,8 +601,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: - if hasattr(base, "__mapping__"): # pylint: disable=no-member - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: @@ -612,7 +613,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField @classmethod def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + if not hasattr(cls, "__mapping__"): return cls(data) discriminator = cls._get_discriminator(exist_discriminators) if discriminator is None: @@ -632,11 +633,11 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: - """Return a dict that can be JSONify using json.dump. + """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. :returns: A dict JSON compatible object @@ -733,7 +734,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An ) -def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -753,7 +754,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, except AttributeError: model_name = annotation if module is not None: - annotation = _get_model(module, model_name) + annotation = _get_model(module, model_name) # type: ignore try: if module and _is_model(annotation): @@ -893,6 +894,22 @@ def _deserialize( return _deserialize_with_callable(deserializer, value) +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + class _RestField: def __init__( self, diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_serialization.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_serialization.py index 01a226bd7f14..b24ab2885450 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_serialization.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_serialization.py @@ -227,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore :param datetime.timedelta offset: offset in timedelta format """ - def __init__(self, offset): + def __init__(self, offset) -> None: self.__offset = offset def utcoffset(self, dt): @@ -310,7 +310,7 @@ def _create_xml_node(tag, prefix=None, ns=None): return ET.Element(tag) -class Model(object): +class Model: """Mixin for all client request body/response body models to support serialization and deserialization. """ @@ -507,7 +507,6 @@ def _flatten_subtype(cls, key, objects): def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. :param dict response: The initial data :param dict objects: The class objects @@ -519,7 +518,7 @@ def _classify(cls, response, objects): if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -564,7 +563,7 @@ def _decode_attribute_map_key(key): return key.replace("\\.", ".") -class Serializer(object): # pylint: disable=too-many-public-methods +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -599,7 +598,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -1442,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1453,7 +1452,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1684,17 +1683,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ - k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") ] const = [ - k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_version.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_version.py index be71c81bd282..0ec13ea52bbf 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_version.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0" diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/__init__.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/__init__.py index 94312ca9b1aa..3286b1d3ec23 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/__init__.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import ComputeScheduleMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ComputeScheduleMgmtClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "ComputeScheduleMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_client.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_client.py index 4594ec5d1690..e26f96eccb14 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_client.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_client.py @@ -20,11 +20,10 @@ from .operations import Operations, ScheduledActionsOperations if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ComputeScheduleMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class ComputeScheduleMgmtClient: """Microsoft.ComputeSchedule Resource Provider management API. :ivar operations: Operations operations @@ -38,9 +37,8 @@ class ComputeScheduleMgmtClient: # pylint: disable=client-accepts-api-version-k :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2024-08-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "2024-10-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_configuration.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_configuration.py index c661c7bcc36f..8518e2689031 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_configuration.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/_configuration.py @@ -14,11 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ComputeScheduleMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -30,9 +29,8 @@ class ComputeScheduleMgmtClientConfiguration: # pylint: disable=too-many-instan :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2024-08-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "2024-10-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -43,7 +41,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-08-15-preview") + api_version: str = kwargs.pop("api_version", "2024-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/__init__.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/__init__.py index 39cb4fb555d4..1b073f3da1b0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/__init__.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/__init__.py @@ -5,17 +5,23 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._operations import ScheduledActionsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import ScheduledActionsOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "Operations", "ScheduledActionsOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_operations.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_operations.py index 11ed53ea0da1..7408944cf3a3 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_operations.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,7 +9,7 @@ from io import IOBase import json import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +31,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize +from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ...operations._operations import ( build_operations_list_request, build_scheduled_actions_virtual_machines_cancel_operations_request, @@ -48,7 +48,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -84,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -147,7 +147,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -181,7 +181,8 @@ async def virtual_machines_submit_deallocate( content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine. + """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines + at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -200,7 +201,8 @@ async def virtual_machines_submit_deallocate( async def virtual_machines_submit_deallocate( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine. + """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines + at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -219,7 +221,8 @@ async def virtual_machines_submit_deallocate( async def virtual_machines_submit_deallocate( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine. + """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines + at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -241,7 +244,8 @@ async def virtual_machines_submit_deallocate( request_body: Union[_models.SubmitDeallocateRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine. + """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines + at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -254,7 +258,7 @@ async def virtual_machines_submit_deallocate( :rtype: ~azure.mgmt.computeschedule.models.DeallocateResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +307,7 @@ async def virtual_machines_submit_deallocate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -325,7 +329,8 @@ async def virtual_machines_submit_hibernate( content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesSubmitHibernate: submitHibernate for a virtual machine. + """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -344,7 +349,8 @@ async def virtual_machines_submit_hibernate( async def virtual_machines_submit_hibernate( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesSubmitHibernate: submitHibernate for a virtual machine. + """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -363,7 +369,8 @@ async def virtual_machines_submit_hibernate( async def virtual_machines_submit_hibernate( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesSubmitHibernate: submitHibernate for a virtual machine. + """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -385,7 +392,8 @@ async def virtual_machines_submit_hibernate( request_body: Union[_models.SubmitHibernateRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesSubmitHibernate: submitHibernate for a virtual machine. + """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -398,7 +406,7 @@ async def virtual_machines_submit_hibernate( :rtype: ~azure.mgmt.computeschedule.models.HibernateResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +455,7 @@ async def virtual_machines_submit_hibernate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -469,7 +477,8 @@ async def virtual_machines_submit_start( content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesSubmitStart: submitStart for a virtual machine. + """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -488,7 +497,8 @@ async def virtual_machines_submit_start( async def virtual_machines_submit_start( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesSubmitStart: submitStart for a virtual machine. + """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -507,7 +517,8 @@ async def virtual_machines_submit_start( async def virtual_machines_submit_start( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesSubmitStart: submitStart for a virtual machine. + """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -526,7 +537,8 @@ async def virtual_machines_submit_start( async def virtual_machines_submit_start( self, locationparameter: str, request_body: Union[_models.SubmitStartRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesSubmitStart: submitStart for a virtual machine. + """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -538,7 +550,7 @@ async def virtual_machines_submit_start( :rtype: ~azure.mgmt.computeschedule.models.StartResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -587,7 +599,7 @@ async def virtual_machines_submit_start( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -609,7 +621,8 @@ async def virtual_machines_execute_deallocate( content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine. + """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -628,7 +641,8 @@ async def virtual_machines_execute_deallocate( async def virtual_machines_execute_deallocate( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine. + """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -647,7 +661,8 @@ async def virtual_machines_execute_deallocate( async def virtual_machines_execute_deallocate( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine. + """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -669,7 +684,8 @@ async def virtual_machines_execute_deallocate( request_body: Union[_models.ExecuteDeallocateRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine. + """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -682,7 +698,7 @@ async def virtual_machines_execute_deallocate( :rtype: ~azure.mgmt.computeschedule.models.DeallocateResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -731,7 +747,7 @@ async def virtual_machines_execute_deallocate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -753,7 +769,8 @@ async def virtual_machines_execute_hibernate( content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesExecuteHibernate: executeHibernate for a virtual machine. + """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -772,7 +789,8 @@ async def virtual_machines_execute_hibernate( async def virtual_machines_execute_hibernate( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesExecuteHibernate: executeHibernate for a virtual machine. + """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -791,7 +809,8 @@ async def virtual_machines_execute_hibernate( async def virtual_machines_execute_hibernate( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesExecuteHibernate: executeHibernate for a virtual machine. + """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -813,7 +832,8 @@ async def virtual_machines_execute_hibernate( request_body: Union[_models.ExecuteHibernateRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesExecuteHibernate: executeHibernate for a virtual machine. + """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -826,7 +846,7 @@ async def virtual_machines_execute_hibernate( :rtype: ~azure.mgmt.computeschedule.models.HibernateResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -875,7 +895,7 @@ async def virtual_machines_execute_hibernate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -897,7 +917,8 @@ async def virtual_machines_execute_start( content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesExecuteStart: executeStart for a virtual machine. + """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this + operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -916,7 +937,8 @@ async def virtual_machines_execute_start( async def virtual_machines_execute_start( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesExecuteStart: executeStart for a virtual machine. + """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this + operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -935,7 +957,8 @@ async def virtual_machines_execute_start( async def virtual_machines_execute_start( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesExecuteStart: executeStart for a virtual machine. + """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this + operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -954,7 +977,8 @@ async def virtual_machines_execute_start( async def virtual_machines_execute_start( self, locationparameter: str, request_body: Union[_models.ExecuteStartRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesExecuteStart: executeStart for a virtual machine. + """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this + operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -966,7 +990,7 @@ async def virtual_machines_execute_start( :rtype: ~azure.mgmt.computeschedule.models.StartResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1015,7 +1039,7 @@ async def virtual_machines_execute_start( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1037,7 +1061,8 @@ async def virtual_machines_get_operation_status( content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationStatusResponse: - """virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine. + """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on + virtual machines. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1056,7 +1081,8 @@ async def virtual_machines_get_operation_status( async def virtual_machines_get_operation_status( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationStatusResponse: - """virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine. + """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on + virtual machines. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1075,7 +1101,8 @@ async def virtual_machines_get_operation_status( async def virtual_machines_get_operation_status( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationStatusResponse: - """virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine. + """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on + virtual machines. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1097,7 +1124,8 @@ async def virtual_machines_get_operation_status( request_body: Union[_models.GetOperationStatusRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.GetOperationStatusResponse: - """virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine. + """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on + virtual machines. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1110,7 +1138,7 @@ async def virtual_machines_get_operation_status( :rtype: ~azure.mgmt.computeschedule.models.GetOperationStatusResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1159,7 +1187,7 @@ async def virtual_machines_get_operation_status( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1181,7 +1209,8 @@ async def virtual_machines_cancel_operations( content_type: str = "application/json", **kwargs: Any ) -> _models.CancelOperationsResponse: - """virtualMachinesCancelOperations: cancelOperations for a virtual machine. + """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) + request. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1200,7 +1229,8 @@ async def virtual_machines_cancel_operations( async def virtual_machines_cancel_operations( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CancelOperationsResponse: - """virtualMachinesCancelOperations: cancelOperations for a virtual machine. + """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) + request. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1219,7 +1249,8 @@ async def virtual_machines_cancel_operations( async def virtual_machines_cancel_operations( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.CancelOperationsResponse: - """virtualMachinesCancelOperations: cancelOperations for a virtual machine. + """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) + request. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1241,7 +1272,8 @@ async def virtual_machines_cancel_operations( request_body: Union[_models.CancelOperationsRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.CancelOperationsResponse: - """virtualMachinesCancelOperations: cancelOperations for a virtual machine. + """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) + request. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1254,7 +1286,7 @@ async def virtual_machines_cancel_operations( :rtype: ~azure.mgmt.computeschedule.models.CancelOperationsResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1303,7 +1335,7 @@ async def virtual_machines_cancel_operations( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1325,8 +1357,8 @@ async def virtual_machines_get_operation_errors( content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationErrorsResponse: - """virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual - machine. + """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors + encountered, additional logs) if they exist. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1345,8 +1377,8 @@ async def virtual_machines_get_operation_errors( async def virtual_machines_get_operation_errors( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationErrorsResponse: - """virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual - machine. + """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors + encountered, additional logs) if they exist. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1365,8 +1397,8 @@ async def virtual_machines_get_operation_errors( async def virtual_machines_get_operation_errors( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationErrorsResponse: - """virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual - machine. + """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors + encountered, additional logs) if they exist. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1388,8 +1420,8 @@ async def virtual_machines_get_operation_errors( request_body: Union[_models.GetOperationErrorsRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.GetOperationErrorsResponse: - """virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual - machine. + """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors + encountered, additional logs) if they exist. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1402,7 +1434,7 @@ async def virtual_machines_get_operation_errors( :rtype: ~azure.mgmt.computeschedule.models.GetOperationErrorsResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1451,7 +1483,7 @@ async def virtual_machines_get_operation_errors( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/__init__.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/__init__.py index 6858308956a7..9db04f67ddae 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/__init__.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/__init__.py @@ -5,45 +5,56 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models import CancelOperationsRequest -from ._models import CancelOperationsResponse -from ._models import DeallocateResourceOperationResponse -from ._models import ErrorAdditionalInfo -from ._models import ErrorDetail -from ._models import ErrorResponse -from ._models import ExecuteDeallocateRequest -from ._models import ExecuteHibernateRequest -from ._models import ExecuteStartRequest -from ._models import ExecutionParameters -from ._models import GetOperationErrorsRequest -from ._models import GetOperationErrorsResponse -from ._models import GetOperationStatusRequest -from ._models import GetOperationStatusResponse -from ._models import HibernateResourceOperationResponse -from ._models import Operation -from ._models import OperationDisplay -from ._models import OperationErrorDetails -from ._models import OperationErrorsResult -from ._models import ResourceOperation -from ._models import ResourceOperationDetails -from ._models import ResourceOperationError -from ._models import Resources -from ._models import RetryPolicy -from ._models import Schedule -from ._models import StartResourceOperationResponse -from ._models import SubmitDeallocateRequest -from ._models import SubmitHibernateRequest -from ._models import SubmitStartRequest +from typing import TYPE_CHECKING -from ._enums import ActionType -from ._enums import DeadlineType -from ._enums import OperationState -from ._enums import OptimizationPreference -from ._enums import Origin -from ._enums import ResourceOperationType +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + CancelOperationsRequest, + CancelOperationsResponse, + DeallocateResourceOperationResponse, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + ExecuteDeallocateRequest, + ExecuteHibernateRequest, + ExecuteStartRequest, + ExecutionParameters, + GetOperationErrorsRequest, + GetOperationErrorsResponse, + GetOperationStatusRequest, + GetOperationStatusResponse, + HibernateResourceOperationResponse, + Operation, + OperationDisplay, + OperationErrorDetails, + OperationErrorsResult, + ResourceOperation, + ResourceOperationDetails, + ResourceOperationError, + Resources, + RetryPolicy, + Schedule, + StartResourceOperationResponse, + SubmitDeallocateRequest, + SubmitHibernateRequest, + SubmitStartRequest, +) + +from ._enums import ( # type: ignore + ActionType, + DeadlineType, + OperationState, + OptimizationPreference, + Origin, + ResourceOperationType, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -83,5 +94,5 @@ "Origin", "ResourceOperationType", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_enums.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_enums.py index 76678d1217e0..9334d3fda700 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_enums.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_enums.py @@ -48,7 +48,7 @@ class OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" """Operations that have failed""" CANCELLED = "Cancelled" - """Operations that have been cancelled by the user""" + """Operations that have been Cancelled by the user""" BLOCKED = "Blocked" """Operations that are blocked""" diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_models.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_models.py index cbc2b702c556..8524abc67d85 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_models.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/models/_models.py @@ -1,11 +1,12 @@ -# coding=utf-8 # pylint: disable=too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation import datetime from typing import Any, List, Mapping, Optional, TYPE_CHECKING, Union, overload @@ -14,7 +15,6 @@ from .._model_base import rest_field if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models @@ -25,14 +25,14 @@ class CancelOperationsRequest(_model_base.Model): :ivar operation_ids: The list of operation ids to cancel operations on. Required. :vartype operation_ids: list[str] - :ivar correlationid: Correlationid item. Required. + :ivar correlationid: CorrelationId item. Required. :vartype correlationid: str """ operation_ids: List[str] = rest_field(name="operationIds") """The list of operation ids to cancel operations on. Required.""" correlationid: str = rest_field() - """Correlationid item. Required.""" + """CorrelationId item. Required.""" @overload def __init__( @@ -40,16 +40,16 @@ def __init__( *, operation_ids: List[str], correlationid: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -69,16 +69,16 @@ def __init__( self, *, results: List["_models.ResourceOperation"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -113,16 +113,16 @@ def __init__( type: str, location: str, results: Optional[List["_models.ResourceOperation"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -190,16 +190,16 @@ def __init__( self, *, error: Optional["_models.ErrorDetail"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -212,7 +212,7 @@ class ExecuteDeallocateRequest(_model_base.Model): :vartype execution_parameters: ~azure.mgmt.computeschedule.models.ExecutionParameters :ivar resources: The resources for the request. Required. :vartype resources: ~azure.mgmt.computeschedule.models.Resources - :ivar correlationid: Correlationid item. Required. + :ivar correlationid: CorrelationId item. Required. :vartype correlationid: str """ @@ -221,7 +221,7 @@ class ExecuteDeallocateRequest(_model_base.Model): resources: "_models.Resources" = rest_field() """The resources for the request. Required.""" correlationid: str = rest_field() - """Correlationid item. Required.""" + """CorrelationId item. Required.""" @overload def __init__( @@ -230,16 +230,16 @@ def __init__( execution_parameters: "_models.ExecutionParameters", resources: "_models.Resources", correlationid: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -252,7 +252,7 @@ class ExecuteHibernateRequest(_model_base.Model): :vartype execution_parameters: ~azure.mgmt.computeschedule.models.ExecutionParameters :ivar resources: The resources for the request. Required. :vartype resources: ~azure.mgmt.computeschedule.models.Resources - :ivar correlationid: Correlationid item. Required. + :ivar correlationid: CorrelationId item. Required. :vartype correlationid: str """ @@ -261,7 +261,7 @@ class ExecuteHibernateRequest(_model_base.Model): resources: "_models.Resources" = rest_field() """The resources for the request. Required.""" correlationid: str = rest_field() - """Correlationid item. Required.""" + """CorrelationId item. Required.""" @overload def __init__( @@ -270,16 +270,16 @@ def __init__( execution_parameters: "_models.ExecutionParameters", resources: "_models.Resources", correlationid: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -292,7 +292,7 @@ class ExecuteStartRequest(_model_base.Model): :vartype execution_parameters: ~azure.mgmt.computeschedule.models.ExecutionParameters :ivar resources: The resources for the request. Required. :vartype resources: ~azure.mgmt.computeschedule.models.Resources - :ivar correlationid: Correlationid item. Required. + :ivar correlationid: CorrelationId item. Required. :vartype correlationid: str """ @@ -301,7 +301,7 @@ class ExecuteStartRequest(_model_base.Model): resources: "_models.Resources" = rest_field() """The resources for the request. Required.""" correlationid: str = rest_field() - """Correlationid item. Required.""" + """CorrelationId item. Required.""" @overload def __init__( @@ -310,16 +310,16 @@ def __init__( execution_parameters: "_models.ExecutionParameters", resources: "_models.Resources", correlationid: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -348,16 +348,16 @@ def __init__( *, optimization_preference: Optional[Union[str, "_models.OptimizationPreference"]] = None, retry_policy: Optional["_models.RetryPolicy"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -378,16 +378,16 @@ def __init__( self, *, operation_ids: List[str], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -407,16 +407,16 @@ def __init__( self, *, results: List["_models.OperationErrorsResult"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -427,14 +427,14 @@ class GetOperationStatusRequest(_model_base.Model): :ivar operation_ids: The list of operation ids to get the status of. Required. :vartype operation_ids: list[str] - :ivar correlationid: Correlationid item. Required. + :ivar correlationid: CorrelationId item. Required. :vartype correlationid: str """ operation_ids: List[str] = rest_field(name="operationIds") """The list of operation ids to get the status of. Required.""" correlationid: str = rest_field() - """Correlationid item. Required.""" + """CorrelationId item. Required.""" @overload def __init__( @@ -442,16 +442,16 @@ def __init__( *, operation_ids: List[str], correlationid: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -471,16 +471,16 @@ def __init__( self, *, results: List["_models.ResourceOperation"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -515,16 +515,16 @@ def __init__( type: str, location: str, results: Optional[List["_models.ResourceOperation"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -557,13 +557,13 @@ class Operation(_model_base.Model): is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"]) + display: Optional["_models.OperationDisplay"] = rest_field() """Localized display information for this particular operation.""" origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType") + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. \"Internal\"""" @@ -571,17 +571,17 @@ class Operation(_model_base.Model): def __init__( self, *, - action_type: Optional[Union[str, "_models.ActionType"]] = None, - ): ... + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -625,40 +625,50 @@ class OperationErrorDetails(_model_base.Model): :ivar error_code: The error code of the operation. Required. :vartype error_code: str :ivar error_details: The error details of the operation. Required. - :vartype error_details: ~datetime.datetime - :ivar time_stamp: The timestamp of the error occurence. Required. + :vartype error_details: str + :ivar timestamp: The timestamp of the error occurence. + :vartype timestamp: ~datetime.datetime + :ivar time_stamp: The timestamp of the error occurence. :vartype time_stamp: ~datetime.datetime - :ivar crp_operation_id: CRP operationid of the operation for deeper analysis. Required. + :ivar azure_operation_name: The compute operationid of the Start/Deallocate/Hibernate request. + :vartype azure_operation_name: str + :ivar crp_operation_id: The compute operationid of the Start/Deallocate/Hibernate request. :vartype crp_operation_id: str """ error_code: str = rest_field(name="errorCode") """The error code of the operation. Required.""" - error_details: datetime.datetime = rest_field(name="errorDetails", format="rfc3339") + error_details: str = rest_field(name="errorDetails") """The error details of the operation. Required.""" - time_stamp: datetime.datetime = rest_field(name="timeStamp", format="rfc3339") - """The timestamp of the error occurence. Required.""" - crp_operation_id: str = rest_field(name="crpOperationId") - """CRP operationid of the operation for deeper analysis. Required.""" + timestamp: Optional[datetime.datetime] = rest_field(format="rfc3339") + """The timestamp of the error occurence.""" + time_stamp: Optional[datetime.datetime] = rest_field(name="timeStamp", format="rfc3339") + """The timestamp of the error occurence.""" + azure_operation_name: Optional[str] = rest_field(name="azureOperationName") + """The compute operationid of the Start/Deallocate/Hibernate request.""" + crp_operation_id: Optional[str] = rest_field(name="crpOperationId") + """The compute operationid of the Start/Deallocate/Hibernate request.""" @overload def __init__( self, *, error_code: str, - error_details: datetime.datetime, - time_stamp: datetime.datetime, - crp_operation_id: str, - ): ... + error_details: str, + timestamp: Optional[datetime.datetime] = None, + time_stamp: Optional[datetime.datetime] = None, + azure_operation_name: Optional[str] = None, + crp_operation_id: Optional[str] = None, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -708,16 +718,16 @@ def __init__( operation_errors: Optional[List["_models.OperationErrorDetails"]] = None, request_error_code: Optional[str] = None, request_error_details: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -751,42 +761,43 @@ def __init__( error_code: Optional[str] = None, error_details: Optional[str] = None, operation: Optional["_models.ResourceOperationDetails"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResourceOperationDetails(_model_base.Model): # pylint: disable=too-many-instance-attributes +class ResourceOperationDetails(_model_base.Model): """The details of a response from an operation on a resource. :ivar operation_id: Operation identifier for the unique operation. Required. :vartype operation_id: str :ivar resource_id: Unique identifier for the resource involved in the operation, eg ArmId. - Required. :vartype resource_id: str - :ivar op_type: Type of operation performed on the resources. Required. Known values are: - "Unknown", "Start", "Deallocate", and "Hibernate". + :ivar op_type: Type of operation performed on the resources. Known values are: "Unknown", + "Start", "Deallocate", and "Hibernate". :vartype op_type: str or ~azure.mgmt.computeschedule.models.ResourceOperationType - :ivar subscription_id: Subscription id attached to the request. Required. + :ivar subscription_id: Subscription id attached to the request. :vartype subscription_id: str - :ivar deadline: Deadline for the operation. Required. + :ivar deadline: Deadline for the operation. :vartype deadline: ~datetime.datetime - :ivar deadline_type: Type of deadline of the operation. Required. Known values are: "Unknown", + :ivar deadline_type: Type of deadline of the operation. Known values are: "Unknown", "InitiateAt", and "CompleteBy". :vartype deadline_type: str or ~azure.mgmt.computeschedule.models.DeadlineType - :ivar state: Current state of the operation. Required. Known values are: "Unknown", - "PendingScheduling", "Scheduled", "PendingExecution", "Executing", "Succeeded", "Failed", - "Cancelled", and "Blocked". + :ivar state: Current state of the operation. Known values are: "Unknown", "PendingScheduling", + "Scheduled", "PendingExecution", "Executing", "Succeeded", "Failed", "Cancelled", and + "Blocked". :vartype state: str or ~azure.mgmt.computeschedule.models.OperationState + :ivar timezone: Timezone for the operation. + :vartype timezone: str :ivar time_zone: Timezone for the operation. :vartype time_zone: str :ivar resource_operation_error: Operation level errors if they exist. @@ -799,22 +810,24 @@ class ResourceOperationDetails(_model_base.Model): # pylint: disable=too-many-i operation_id: str = rest_field(name="operationId") """Operation identifier for the unique operation. Required.""" - resource_id: str = rest_field(name="resourceId") - """Unique identifier for the resource involved in the operation, eg ArmId. Required.""" - op_type: Union[str, "_models.ResourceOperationType"] = rest_field(name="opType") - """Type of operation performed on the resources. Required. Known values are: \"Unknown\", - \"Start\", \"Deallocate\", and \"Hibernate\".""" - subscription_id: str = rest_field(name="subscriptionId") - """Subscription id attached to the request. Required.""" - deadline: datetime.datetime = rest_field(format="rfc3339") - """Deadline for the operation. Required.""" - deadline_type: Union[str, "_models.DeadlineType"] = rest_field(name="deadlineType") - """Type of deadline of the operation. Required. Known values are: \"Unknown\", \"InitiateAt\", and + resource_id: Optional[str] = rest_field(name="resourceId") + """Unique identifier for the resource involved in the operation, eg ArmId.""" + op_type: Optional[Union[str, "_models.ResourceOperationType"]] = rest_field(name="opType") + """Type of operation performed on the resources. Known values are: \"Unknown\", \"Start\", + \"Deallocate\", and \"Hibernate\".""" + subscription_id: Optional[str] = rest_field(name="subscriptionId") + """Subscription id attached to the request.""" + deadline: Optional[datetime.datetime] = rest_field(format="rfc3339") + """Deadline for the operation.""" + deadline_type: Optional[Union[str, "_models.DeadlineType"]] = rest_field(name="deadlineType") + """Type of deadline of the operation. Known values are: \"Unknown\", \"InitiateAt\", and \"CompleteBy\".""" - state: Union[str, "_models.OperationState"] = rest_field() - """Current state of the operation. Required. Known values are: \"Unknown\", \"PendingScheduling\", + state: Optional[Union[str, "_models.OperationState"]] = rest_field() + """Current state of the operation. Known values are: \"Unknown\", \"PendingScheduling\", \"Scheduled\", \"PendingExecution\", \"Executing\", \"Succeeded\", \"Failed\", \"Cancelled\", and \"Blocked\".""" + timezone: Optional[str] = rest_field() + """Timezone for the operation.""" time_zone: Optional[str] = rest_field(name="timeZone") """Timezone for the operation.""" resource_operation_error: Optional["_models.ResourceOperationError"] = rest_field(name="resourceOperationError") @@ -829,26 +842,27 @@ def __init__( self, *, operation_id: str, - resource_id: str, - op_type: Union[str, "_models.ResourceOperationType"], - subscription_id: str, - deadline: datetime.datetime, - deadline_type: Union[str, "_models.DeadlineType"], - state: Union[str, "_models.OperationState"], + resource_id: Optional[str] = None, + op_type: Optional[Union[str, "_models.ResourceOperationType"]] = None, + subscription_id: Optional[str] = None, + deadline: Optional[datetime.datetime] = None, + deadline_type: Optional[Union[str, "_models.DeadlineType"]] = None, + state: Optional[Union[str, "_models.OperationState"]] = None, + timezone: Optional[str] = None, time_zone: Optional[str] = None, resource_operation_error: Optional["_models.ResourceOperationError"] = None, completed_at: Optional[datetime.datetime] = None, retry_policy: Optional["_models.RetryPolicy"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -873,16 +887,16 @@ def __init__( *, error_code: str, error_details: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -903,16 +917,16 @@ def __init__( self, *, ids: List[str], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -936,16 +950,16 @@ def __init__( *, retry_count: Optional[int] = None, retry_window_in_minutes: Optional[int] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -954,19 +968,27 @@ class Schedule(_model_base.Model): All required parameters must be populated in order to send to server. - :ivar dead_line: The deadline for the operation. Required. + :ivar deadline: The deadline for the operation. + :vartype deadline: ~datetime.datetime + :ivar dead_line: The deadline for the operation. :vartype dead_line: ~datetime.datetime - :ivar time_zone: The timezone for the operation. Required. + :ivar timezone: The timezone for the operation. + :vartype timezone: str + :ivar time_zone: The timezone for the operation. :vartype time_zone: str :ivar deadline_type: The deadlinetype of the operation, this can either be InitiateAt or CompleteBy. Required. Known values are: "Unknown", "InitiateAt", and "CompleteBy". :vartype deadline_type: str or ~azure.mgmt.computeschedule.models.DeadlineType """ - dead_line: datetime.datetime = rest_field(name="deadLine", format="rfc3339") - """The deadline for the operation. Required.""" - time_zone: str = rest_field(name="timeZone") - """The timezone for the operation. Required.""" + deadline: Optional[datetime.datetime] = rest_field(format="rfc3339") + """The deadline for the operation.""" + dead_line: Optional[datetime.datetime] = rest_field(name="deadLine", format="rfc3339") + """The deadline for the operation.""" + timezone: Optional[str] = rest_field() + """The timezone for the operation.""" + time_zone: Optional[str] = rest_field(name="timeZone") + """The timezone for the operation.""" deadline_type: Union[str, "_models.DeadlineType"] = rest_field(name="deadlineType") """The deadlinetype of the operation, this can either be InitiateAt or CompleteBy. Required. Known values are: \"Unknown\", \"InitiateAt\", and \"CompleteBy\".""" @@ -975,19 +997,21 @@ class Schedule(_model_base.Model): def __init__( self, *, - dead_line: datetime.datetime, - time_zone: str, deadline_type: Union[str, "_models.DeadlineType"], - ): ... + deadline: Optional[datetime.datetime] = None, + dead_line: Optional[datetime.datetime] = None, + timezone: Optional[str] = None, + time_zone: Optional[str] = None, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1022,16 +1046,16 @@ def __init__( type: str, location: str, results: Optional[List["_models.ResourceOperation"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1046,7 +1070,7 @@ class SubmitDeallocateRequest(_model_base.Model): :vartype execution_parameters: ~azure.mgmt.computeschedule.models.ExecutionParameters :ivar resources: The resources for the request. Required. :vartype resources: ~azure.mgmt.computeschedule.models.Resources - :ivar correlationid: Correlationid item. Required. + :ivar correlationid: CorrelationId item. Required. :vartype correlationid: str """ @@ -1057,7 +1081,7 @@ class SubmitDeallocateRequest(_model_base.Model): resources: "_models.Resources" = rest_field() """The resources for the request. Required.""" correlationid: str = rest_field() - """Correlationid item. Required.""" + """CorrelationId item. Required.""" @overload def __init__( @@ -1067,16 +1091,16 @@ def __init__( execution_parameters: "_models.ExecutionParameters", resources: "_models.Resources", correlationid: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1091,7 +1115,7 @@ class SubmitHibernateRequest(_model_base.Model): :vartype execution_parameters: ~azure.mgmt.computeschedule.models.ExecutionParameters :ivar resources: The resources for the request. Required. :vartype resources: ~azure.mgmt.computeschedule.models.Resources - :ivar correlationid: Correlationid item. Required. + :ivar correlationid: CorrelationId item. Required. :vartype correlationid: str """ @@ -1102,7 +1126,7 @@ class SubmitHibernateRequest(_model_base.Model): resources: "_models.Resources" = rest_field() """The resources for the request. Required.""" correlationid: str = rest_field() - """Correlationid item. Required.""" + """CorrelationId item. Required.""" @overload def __init__( @@ -1112,16 +1136,16 @@ def __init__( execution_parameters: "_models.ExecutionParameters", resources: "_models.Resources", correlationid: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1136,7 +1160,7 @@ class SubmitStartRequest(_model_base.Model): :vartype execution_parameters: ~azure.mgmt.computeschedule.models.ExecutionParameters :ivar resources: The resources for the request. Required. :vartype resources: ~azure.mgmt.computeschedule.models.Resources - :ivar correlationid: Correlationid item. Required. + :ivar correlationid: CorrelationId item. Required. :vartype correlationid: str """ @@ -1147,7 +1171,7 @@ class SubmitStartRequest(_model_base.Model): resources: "_models.Resources" = rest_field() """The resources for the request. Required.""" correlationid: str = rest_field() - """Correlationid item. Required.""" + """CorrelationId item. Required.""" @overload def __init__( @@ -1157,14 +1181,14 @@ def __init__( execution_parameters: "_models.ExecutionParameters", resources: "_models.Resources", correlationid: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/__init__.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/__init__.py index 39cb4fb555d4..1b073f3da1b0 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/__init__.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/__init__.py @@ -5,17 +5,23 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._operations import ScheduledActionsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import ScheduledActionsOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "Operations", "ScheduledActionsOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_operations.py b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_operations.py index bd6da5b14722..a22209e54381 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_operations.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,7 +9,7 @@ from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, List, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,13 +30,13 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._model_base import SdkJSONEncoder, _deserialize +from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._serialization import Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -49,7 +49,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_scheduled_actions_virtual_machines_submit_deallocate_request( # pylin _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +101,7 @@ def build_scheduled_actions_virtual_machines_submit_hibernate_request( # pylint _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_scheduled_actions_virtual_machines_submit_start_request( # pylint: di _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +161,7 @@ def build_scheduled_actions_virtual_machines_execute_deallocate_request( # pyli _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +191,7 @@ def build_scheduled_actions_virtual_machines_execute_hibernate_request( # pylin _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -221,7 +221,7 @@ def build_scheduled_actions_virtual_machines_execute_start_request( # pylint: d _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +251,7 @@ def build_scheduled_actions_virtual_machines_get_operation_status_request( # py _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +281,7 @@ def build_scheduled_actions_virtual_machines_cancel_operations_request( # pylin _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -311,7 +311,7 @@ def build_scheduled_actions_virtual_machines_get_operation_errors_request( # py _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -364,7 +364,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +427,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -461,7 +461,8 @@ def virtual_machines_submit_deallocate( content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine. + """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines + at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -480,7 +481,8 @@ def virtual_machines_submit_deallocate( def virtual_machines_submit_deallocate( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine. + """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines + at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -499,7 +501,8 @@ def virtual_machines_submit_deallocate( def virtual_machines_submit_deallocate( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine. + """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines + at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -521,7 +524,8 @@ def virtual_machines_submit_deallocate( request_body: Union[_models.SubmitDeallocateRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine. + """VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines + at datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -534,7 +538,7 @@ def virtual_machines_submit_deallocate( :rtype: ~azure.mgmt.computeschedule.models.DeallocateResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +587,7 @@ def virtual_machines_submit_deallocate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -605,7 +609,8 @@ def virtual_machines_submit_hibernate( content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesSubmitHibernate: submitHibernate for a virtual machine. + """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -624,7 +629,8 @@ def virtual_machines_submit_hibernate( def virtual_machines_submit_hibernate( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesSubmitHibernate: submitHibernate for a virtual machine. + """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -643,7 +649,8 @@ def virtual_machines_submit_hibernate( def virtual_machines_submit_hibernate( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesSubmitHibernate: submitHibernate for a virtual machine. + """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -665,7 +672,8 @@ def virtual_machines_submit_hibernate( request_body: Union[_models.SubmitHibernateRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesSubmitHibernate: submitHibernate for a virtual machine. + """VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -678,7 +686,7 @@ def virtual_machines_submit_hibernate( :rtype: ~azure.mgmt.computeschedule.models.HibernateResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +735,7 @@ def virtual_machines_submit_hibernate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -749,7 +757,8 @@ def virtual_machines_submit_start( content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesSubmitStart: submitStart for a virtual machine. + """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -768,7 +777,8 @@ def virtual_machines_submit_start( def virtual_machines_submit_start( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesSubmitStart: submitStart for a virtual machine. + """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -787,7 +797,8 @@ def virtual_machines_submit_start( def virtual_machines_submit_start( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesSubmitStart: submitStart for a virtual machine. + """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -806,7 +817,8 @@ def virtual_machines_submit_start( def virtual_machines_submit_start( self, locationparameter: str, request_body: Union[_models.SubmitStartRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesSubmitStart: submitStart for a virtual machine. + """VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at + datetime in future. :param locationparameter: The location name. Required. :type locationparameter: str @@ -818,7 +830,7 @@ def virtual_machines_submit_start( :rtype: ~azure.mgmt.computeschedule.models.StartResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -867,7 +879,7 @@ def virtual_machines_submit_start( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -889,7 +901,8 @@ def virtual_machines_execute_deallocate( content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine. + """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -908,7 +921,8 @@ def virtual_machines_execute_deallocate( def virtual_machines_execute_deallocate( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine. + """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -927,7 +941,8 @@ def virtual_machines_execute_deallocate( def virtual_machines_execute_deallocate( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine. + """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -949,7 +964,8 @@ def virtual_machines_execute_deallocate( request_body: Union[_models.ExecuteDeallocateRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DeallocateResourceOperationResponse: - """virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine. + """VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -962,7 +978,7 @@ def virtual_machines_execute_deallocate( :rtype: ~azure.mgmt.computeschedule.models.DeallocateResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1011,7 +1027,7 @@ def virtual_machines_execute_deallocate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1033,7 +1049,8 @@ def virtual_machines_execute_hibernate( content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesExecuteHibernate: executeHibernate for a virtual machine. + """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1052,7 +1069,8 @@ def virtual_machines_execute_hibernate( def virtual_machines_execute_hibernate( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesExecuteHibernate: executeHibernate for a virtual machine. + """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1071,7 +1089,8 @@ def virtual_machines_execute_hibernate( def virtual_machines_execute_hibernate( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesExecuteHibernate: executeHibernate for a virtual machine. + """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1093,7 +1112,8 @@ def virtual_machines_execute_hibernate( request_body: Union[_models.ExecuteHibernateRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.HibernateResourceOperationResponse: - """virtualMachinesExecuteHibernate: executeHibernate for a virtual machine. + """VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, + this operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1106,7 +1126,7 @@ def virtual_machines_execute_hibernate( :rtype: ~azure.mgmt.computeschedule.models.HibernateResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1155,7 +1175,7 @@ def virtual_machines_execute_hibernate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1177,7 +1197,8 @@ def virtual_machines_execute_start( content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesExecuteStart: executeStart for a virtual machine. + """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this + operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1196,7 +1217,8 @@ def virtual_machines_execute_start( def virtual_machines_execute_start( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesExecuteStart: executeStart for a virtual machine. + """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this + operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1215,7 +1237,8 @@ def virtual_machines_execute_start( def virtual_machines_execute_start( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesExecuteStart: executeStart for a virtual machine. + """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this + operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1234,7 +1257,8 @@ def virtual_machines_execute_start( def virtual_machines_execute_start( self, locationparameter: str, request_body: Union[_models.ExecuteStartRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.StartResourceOperationResponse: - """virtualMachinesExecuteStart: executeStart for a virtual machine. + """VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this + operation is triggered as soon as Computeschedule receives it. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1246,7 +1270,7 @@ def virtual_machines_execute_start( :rtype: ~azure.mgmt.computeschedule.models.StartResourceOperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1295,7 +1319,7 @@ def virtual_machines_execute_start( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1317,7 +1341,8 @@ def virtual_machines_get_operation_status( content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationStatusResponse: - """virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine. + """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on + virtual machines. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1336,7 +1361,8 @@ def virtual_machines_get_operation_status( def virtual_machines_get_operation_status( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationStatusResponse: - """virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine. + """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on + virtual machines. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1355,7 +1381,8 @@ def virtual_machines_get_operation_status( def virtual_machines_get_operation_status( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationStatusResponse: - """virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine. + """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on + virtual machines. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1377,7 +1404,8 @@ def virtual_machines_get_operation_status( request_body: Union[_models.GetOperationStatusRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.GetOperationStatusResponse: - """virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine. + """VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on + virtual machines. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1390,7 +1418,7 @@ def virtual_machines_get_operation_status( :rtype: ~azure.mgmt.computeschedule.models.GetOperationStatusResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1439,7 +1467,7 @@ def virtual_machines_get_operation_status( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1461,7 +1489,8 @@ def virtual_machines_cancel_operations( content_type: str = "application/json", **kwargs: Any ) -> _models.CancelOperationsResponse: - """virtualMachinesCancelOperations: cancelOperations for a virtual machine. + """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) + request. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1480,7 +1509,8 @@ def virtual_machines_cancel_operations( def virtual_machines_cancel_operations( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CancelOperationsResponse: - """virtualMachinesCancelOperations: cancelOperations for a virtual machine. + """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) + request. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1499,7 +1529,8 @@ def virtual_machines_cancel_operations( def virtual_machines_cancel_operations( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.CancelOperationsResponse: - """virtualMachinesCancelOperations: cancelOperations for a virtual machine. + """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) + request. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1521,7 +1552,8 @@ def virtual_machines_cancel_operations( request_body: Union[_models.CancelOperationsRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.CancelOperationsResponse: - """virtualMachinesCancelOperations: cancelOperations for a virtual machine. + """VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) + request. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1534,7 +1566,7 @@ def virtual_machines_cancel_operations( :rtype: ~azure.mgmt.computeschedule.models.CancelOperationsResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1583,7 +1615,7 @@ def virtual_machines_cancel_operations( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1605,8 +1637,8 @@ def virtual_machines_get_operation_errors( content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationErrorsResponse: - """virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual - machine. + """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors + encountered, additional logs) if they exist. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1625,8 +1657,8 @@ def virtual_machines_get_operation_errors( def virtual_machines_get_operation_errors( self, locationparameter: str, request_body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationErrorsResponse: - """virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual - machine. + """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors + encountered, additional logs) if they exist. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1645,8 +1677,8 @@ def virtual_machines_get_operation_errors( def virtual_machines_get_operation_errors( self, locationparameter: str, request_body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.GetOperationErrorsResponse: - """virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual - machine. + """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors + encountered, additional logs) if they exist. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1668,8 +1700,8 @@ def virtual_machines_get_operation_errors( request_body: Union[_models.GetOperationErrorsRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.GetOperationErrorsResponse: - """virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual - machine. + """VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors + encountered, additional logs) if they exist. :param locationparameter: The location name. Required. :type locationparameter: str @@ -1682,7 +1714,7 @@ def virtual_machines_get_operation_errors( :rtype: ~azure.mgmt.computeschedule.models.GetOperationErrorsResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1731,7 +1763,7 @@ def virtual_machines_get_operation_errors( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list.py similarity index 91% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_maximum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list.py index 5bf902740449..059c2519b258 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python operations_list_maximum_set_gen.py + python operations_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-08-15-preview/Operations_List_MaximumSet_Gen.json +# x-ms-original-file: 2024-10-01/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_minimum_set_gen.py deleted file mode 100644 index 3a9c63bada5f..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/operations_list_minimum_set_gen.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python operations_list_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.operations.list() - for item in response: - print(item) - - -# x-ms-original-file: 2024-08-15-preview/Operations_List_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations.py similarity index 82% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_maximum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations.py index af51ef04a684..d91d3e081019 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_maximum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_cancel_operations_maximum_set_gen.py + python scheduled_actions_virtual_machines_cancel_operations.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,15 +31,15 @@ def main(): ) response = client.scheduled_actions.virtual_machines_cancel_operations( - locationparameter="tdxypnse", + locationparameter="eastus2euap", request_body={ - "correlationid": "01080d2f-1dca-4610-afb4-dd25eec1f3c1", + "correlationid": "23480d2f-1dca-4610-afb4-gg25eec1f34r", "operationIds": ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], }, ) print(response) -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json +# x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesCancelOperations.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_minimum_set_gen.py deleted file mode 100644 index 8b0f08b67688..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_cancel_operations_minimum_set_gen.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_cancel_operations_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_cancel_operations( - locationparameter="lwapkjsbltcqp", - request_body={ - "correlationid": "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - "operationIds": ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], - }, - ) - print(response) - - -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate.py similarity index 83% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_minimum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate.py index d0fadf3043a0..ca2887c4c9d8 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_execute_deallocate_minimum_set_gen.py + python scheduled_actions_virtual_machines_execute_deallocate.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,13 +31,13 @@ def main(): ) response = client.scheduled_actions.virtual_machines_execute_deallocate( - locationparameter="irbtacrhjgfpyvhvjo", + locationparameter="eastus2euap", request_body={ - "correlationid": "01080d2f-1dca-4610-afb4-dd25eddf1f3c1", - "executionParameters": {}, + "correlationid": "23480d2f-1dca-4610-afb4-dd25eec1f34r", + "executionParameters": {"retryPolicy": {"retryCount": 4, "retryWindowInMinutes": 27}}, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2" + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" ] }, }, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json +# x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesExecuteDeallocate.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_maximum_set_gen.py deleted file mode 100644 index ea548c282d7b..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_deallocate_maximum_set_gen.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_execute_deallocate_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_execute_deallocate( - locationparameter="mklyzgztbivwzo", - request_body={ - "correlationid": "01080d2f-1dca-4610-afb4-dd25eddf1f3c1", - "executionParameters": { - "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 30, "retryWindowInMinutes": 27}, - }, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2" - ] - }, - }, - ) - print(response) - - -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate.py similarity index 81% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_minimum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate.py index 13d0ac838fb0..b83004f355c8 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_execute_hibernate_minimum_set_gen.py + python scheduled_actions_virtual_machines_execute_hibernate.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,10 +31,10 @@ def main(): ) response = client.scheduled_actions.virtual_machines_execute_hibernate( - locationparameter="kga", + locationparameter="eastus2euap", request_body={ - "correlationid": "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - "executionParameters": {}, + "correlationid": "23480d2f-1dca-4610-afb4-dd25eec1f34r", + "executionParameters": {"retryPolicy": {"retryCount": 5, "retryWindowInMinutes": 27}}, "resources": { "ids": [ "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json +# x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesExecuteHibernate.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_maximum_set_gen.py deleted file mode 100644 index add056b85208..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_hibernate_maximum_set_gen.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_execute_hibernate_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_execute_hibernate( - locationparameter="sejdmamuhhvfpljomwumsplc", - request_body={ - "correlationid": "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - "executionParameters": { - "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 30, "retryWindowInMinutes": 27}, - }, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" - ] - }, - }, - ) - print(response) - - -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start.py similarity index 80% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_minimum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start.py index 37b87f4b99a8..ab3af28b87a9 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_execute_start_minimum_set_gen.py + python scheduled_actions_virtual_machines_execute_start.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,13 +31,13 @@ def main(): ) response = client.scheduled_actions.virtual_machines_execute_start( - locationparameter="qegbgjculewswqvnmaclcgpqqidl", + locationparameter="eastus2euap", request_body={ - "correlationid": "23230d2f-1dca-4610-afb4-dd25eec1f34", - "executionParameters": {}, + "correlationid": "23480d2f-1dca-4610-afb4-dd25eec1f34r", + "executionParameters": {"retryPolicy": {"retryCount": 2, "retryWindowInMinutes": 27}}, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" ] }, }, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json +# x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesExecuteStart.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_maximum_set_gen.py deleted file mode 100644 index 60adcbd68d21..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_execute_start_maximum_set_gen.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_execute_start_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_execute_start( - locationparameter="ysfrwcfmfsh", - request_body={ - "correlationid": "23230d2f-1dca-4610-afb4-dd25eec1f34", - "executionParameters": { - "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 30, "retryWindowInMinutes": 27}, - }, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" - ] - }, - }, - ) - print(response) - - -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors.py similarity index 86% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_minimum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors.py index e064c1eebcca..52b7eae34cdc 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_get_operation_errors_minimum_set_gen.py + python scheduled_actions_virtual_machines_get_operation_errors.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.scheduled_actions.virtual_machines_get_operation_errors( - locationparameter="ggxoaxzxtdbi", - request_body={"operationIds": ["qeicik"]}, + locationparameter="eastus2euap", + request_body={"operationIds": ["23480d2f-1dca-4610-afb4-dd25eec1f34r"]}, ) print(response) -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MinimumSet_Gen.json +# x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesGetOperationErrors.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_maximum_set_gen.py deleted file mode 100644 index b7b1b2abffdf..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_errors_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_get_operation_errors_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_get_operation_errors( - locationparameter="hfsa", - request_body={"operationIds": ["DE84A209-5715-43E7-BC76-3E208A9A323"]}, - ) - print(response) - - -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status.py similarity index 82% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_minimum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status.py index ee045200ec32..71cbcaaac628 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_get_operation_status_minimum_set_gen.py + python scheduled_actions_virtual_machines_get_operation_status.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,15 +31,15 @@ def main(): ) response = client.scheduled_actions.virtual_machines_get_operation_status( - locationparameter="csay", + locationparameter="eastus2euap", request_body={ - "correlationid": "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - "operationIds": ["01080d2f-1dca-4610-afb4-dd25eec1f3df"], + "correlationid": "35780d2f-1dca-4610-afb4-dd25eec1f34r", + "operationIds": ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], }, ) print(response) -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json +# x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesGetOperationStatus.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_maximum_set_gen.py deleted file mode 100644 index 7435565df0e6..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_get_operation_status_maximum_set_gen.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_get_operation_status_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_get_operation_status( - locationparameter="htxxasfxaesuecem", - request_body={ - "correlationid": "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - "operationIds": ["01080d2f-1dca-4610-afb4-dd25eec1f3df"], - }, - ) - print(response) - - -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate.py similarity index 74% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_minimum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate.py index 004c13b6420e..577024f94eec 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_submit_deallocate_minimum_set_gen.py + python scheduled_actions_virtual_machines_submit_deallocate.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,25 +31,21 @@ def main(): ) response = client.scheduled_actions.virtual_machines_submit_deallocate( - locationparameter="qwfcdtmshnlownbkyh", + locationparameter="eastus2euap", request_body={ - "correlationid": "23519o2f-1dca-4610-afb4-dd25eec1f34", - "executionParameters": {}, + "correlationid": "23480d2f-1dca-4610-afb4-dd25eec1f34r", + "executionParameters": {"retryPolicy": {"retryCount": 4, "retryWindowInMinutes": 27}}, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2" + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" ] }, - "schedule": { - "deadLine": "2024-07-12T18:06:53.361Z", - "deadlineType": "Unknown", - "timeZone": "zlcujrtgxtgyik", - }, + "schedule": {"deadline": "2024-11-01T17:52:54.215Z", "deadlineType": "InitiateAt", "timezone": "UTC"}, }, ) print(response) -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MinimumSet_Gen.json +# x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesSubmitDeallocate.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_maximum_set_gen.py deleted file mode 100644 index 0cf2448a1df6..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_deallocate_maximum_set_gen.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_submit_deallocate_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_submit_deallocate( - locationparameter="ibfxsvilwrgqttuslbduzdtxcckdet", - request_body={ - "correlationid": "23519o2f-1dca-4610-afb4-dd25eec1f34", - "executionParameters": { - "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 30, "retryWindowInMinutes": 27}, - }, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2" - ] - }, - "schedule": { - "deadLine": "2024-07-12T18:06:53.361Z", - "deadlineType": "Unknown", - "timeZone": "zlcujrtgxtgyik", - }, - }, - ) - print(response) - - -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate.py similarity index 75% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_minimum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate.py index c5ef79c44122..3df671ad7099 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_submit_hibernate_minimum_set_gen.py + python scheduled_actions_virtual_machines_submit_hibernate.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,25 +31,21 @@ def main(): ) response = client.scheduled_actions.virtual_machines_submit_hibernate( - locationparameter="fvjciwudfbndlqumcgqs", + locationparameter="eastus2euap", request_body={ - "correlationid": "23519o2f-1dca-4610-afb4-dd25eec1f34", - "executionParameters": {}, + "correlationid": "23480d2f-1dca-4610-afb4-dd25eec1f34r", + "executionParameters": {"retryPolicy": {"retryCount": 2, "retryWindowInMinutes": 27}}, "resources": { "ids": [ "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" ] }, - "schedule": { - "deadLine": "2024-07-12T18:06:53.361Z", - "deadlineType": "Unknown", - "timeZone": "zlcujrtgxtgyik", - }, + "schedule": {"deadline": "2024-11-01T17:52:54.215Z", "deadlineType": "InitiateAt", "timezone": "UTC"}, }, ) print(response) -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MinimumSet_Gen.json +# x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesSubmitHibernate.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_maximum_set_gen.py deleted file mode 100644 index e94dd963610e..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_hibernate_maximum_set_gen.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_submit_hibernate_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_submit_hibernate( - locationparameter="bgxeayimbxqzev", - request_body={ - "correlationid": "23519o2f-1dca-4610-afb4-dd25eec1f34", - "executionParameters": { - "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 30, "retryWindowInMinutes": 27}, - }, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" - ] - }, - "schedule": { - "deadLine": "2024-07-12T18:06:53.361Z", - "deadlineType": "Unknown", - "timeZone": "zlcujrtgxtgyik", - }, - }, - ) - print(response) - - -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_minimum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start.py similarity index 77% rename from sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_minimum_set_gen.py rename to sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start.py index 2a4dfbd46bb7..46a5ffe7df18 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_minimum_set_gen.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-computeschedule # USAGE - python scheduled_actions_virtual_machines_submit_start_minimum_set_gen.py + python scheduled_actions_virtual_machines_submit_start.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,25 +31,21 @@ def main(): ) response = client.scheduled_actions.virtual_machines_submit_start( - locationparameter="httzei", + locationparameter="eastus2euap", request_body={ - "correlationid": "23480d2f-1dca-4610-afb4-dd25eec1f34", - "executionParameters": {}, + "correlationid": "23480d2f-1dca-4610-afb4-dd25eec1f34r", + "executionParameters": {"retryPolicy": {"retryCount": 5, "retryWindowInMinutes": 27}}, "resources": { "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3" ] }, - "schedule": { - "deadLine": "2024-07-12T18:06:53.361Z", - "deadlineType": "Unknown", - "timeZone": "zlcujrtgxtgyik", - }, + "schedule": {"deadline": "2024-11-01T17:52:54.215Z", "deadlineType": "InitiateAt", "timezone": "UTC"}, }, ) print(response) -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MinimumSet_Gen.json +# x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesSubmitStart.json if __name__ == "__main__": main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_maximum_set_gen.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_maximum_set_gen.py deleted file mode 100644 index 6d5254e6d4e3..000000000000 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_samples/scheduled_actions_virtual_machines_submit_start_maximum_set_gen.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.computeschedule import ComputeScheduleMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-computeschedule -# USAGE - python scheduled_actions_virtual_machines_submit_start_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ComputeScheduleMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.scheduled_actions.virtual_machines_submit_start( - locationparameter="fxiidszhrokwjmewlahfqjiocnes", - request_body={ - "correlationid": "23480d2f-1dca-4610-afb4-dd25eec1f34", - "executionParameters": { - "optimizationPreference": "Cost", - "retryPolicy": {"retryCount": 30, "retryWindowInMinutes": 27}, - }, - "resources": { - "ids": [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4" - ] - }, - "schedule": { - "deadLine": "2024-07-12T18:06:53.361Z", - "deadlineType": "Unknown", - "timeZone": "zlcujrtgxtgyik", - }, - }, - ) - print(response) - - -# x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations.py index 71a2939107f3..06ea32cbb288 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations.py @@ -30,7 +30,13 @@ def test_scheduled_actions_virtual_machines_submit_deallocate(self, resource_gro "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, - "schedule": {"deadLine": "2020-02-20 00:00:00", "deadlineType": "str", "timeZone": "str"}, + "schedule": { + "deadlineType": "str", + "deadLine": "2020-02-20 00:00:00", + "deadline": "2020-02-20 00:00:00", + "timeZone": "str", + "timezone": "str", + }, }, ) @@ -49,7 +55,13 @@ def test_scheduled_actions_virtual_machines_submit_hibernate(self, resource_grou "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, - "schedule": {"deadLine": "2020-02-20 00:00:00", "deadlineType": "str", "timeZone": "str"}, + "schedule": { + "deadlineType": "str", + "deadLine": "2020-02-20 00:00:00", + "deadline": "2020-02-20 00:00:00", + "timeZone": "str", + "timezone": "str", + }, }, ) @@ -68,7 +80,13 @@ def test_scheduled_actions_virtual_machines_submit_start(self, resource_group): "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, - "schedule": {"deadLine": "2020-02-20 00:00:00", "deadlineType": "str", "timeZone": "str"}, + "schedule": { + "deadlineType": "str", + "deadLine": "2020-02-20 00:00:00", + "deadline": "2020-02-20 00:00:00", + "timeZone": "str", + "timezone": "str", + }, }, ) diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations_async.py b/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations_async.py index 5cab7a1881c0..67c11fba2ac7 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations_async.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/generated_tests/test_compute_schedule_mgmt_scheduled_actions_operations_async.py @@ -31,7 +31,13 @@ async def test_scheduled_actions_virtual_machines_submit_deallocate(self, resour "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, - "schedule": {"deadLine": "2020-02-20 00:00:00", "deadlineType": "str", "timeZone": "str"}, + "schedule": { + "deadlineType": "str", + "deadLine": "2020-02-20 00:00:00", + "deadline": "2020-02-20 00:00:00", + "timeZone": "str", + "timezone": "str", + }, }, ) @@ -50,7 +56,13 @@ async def test_scheduled_actions_virtual_machines_submit_hibernate(self, resourc "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, - "schedule": {"deadLine": "2020-02-20 00:00:00", "deadlineType": "str", "timeZone": "str"}, + "schedule": { + "deadlineType": "str", + "deadLine": "2020-02-20 00:00:00", + "deadline": "2020-02-20 00:00:00", + "timeZone": "str", + "timezone": "str", + }, }, ) @@ -69,7 +81,13 @@ async def test_scheduled_actions_virtual_machines_submit_start(self, resource_gr "retryPolicy": {"retryCount": 0, "retryWindowInMinutes": 0}, }, "resources": {"ids": ["str"]}, - "schedule": {"deadLine": "2020-02-20 00:00:00", "deadlineType": "str", "timeZone": "str"}, + "schedule": { + "deadlineType": "str", + "deadLine": "2020-02-20 00:00:00", + "deadline": "2020-02-20 00:00:00", + "timeZone": "str", + "timezone": "str", + }, }, ) diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/sdk_packaging.toml b/sdk/computeschedule/azure-mgmt-computeschedule/sdk_packaging.toml index 770639ddf61f..2f5501d9b7e3 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/sdk_packaging.toml +++ b/sdk/computeschedule/azure-mgmt-computeschedule/sdk_packaging.toml @@ -3,7 +3,7 @@ package_name = "azure-mgmt-computeschedule" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Computeschedule Management" package_doc_id = "" -is_stable = false +is_stable = true is_arm = true need_msrestazure = false need_azuremgmtcore = true diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/setup.py b/sdk/computeschedule/azure-mgmt-computeschedule/setup.py index f06b846d7dd1..ae424006c223 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/setup.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/setup.py @@ -49,7 +49,7 @@ url="https://github.com/Azure/azure-sdk-for-python", keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/tests/test_compute_schedule_mgmt_operations_async_test.py b/sdk/computeschedule/azure-mgmt-computeschedule/tests/test_compute_schedule_mgmt_operations_async_test.py index cc7bbcb621ab..56159aa9035c 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/tests/test_compute_schedule_mgmt_operations_async_test.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/tests/test_compute_schedule_mgmt_operations_async_test.py @@ -25,4 +25,3 @@ async def test_operations_list(self, resource_group): response = self.client.operations.list() result = [r async for r in response] assert result - diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/tests/test_compute_schedule_mgmt_operations_test.py b/sdk/computeschedule/azure-mgmt-computeschedule/tests/test_compute_schedule_mgmt_operations_test.py index 535047551112..b4f9009c66bc 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/tests/test_compute_schedule_mgmt_operations_test.py +++ b/sdk/computeschedule/azure-mgmt-computeschedule/tests/test_compute_schedule_mgmt_operations_test.py @@ -24,4 +24,3 @@ def test_operations_list(self, resource_group): response = self.client.operations.list() result = [r for r in response] assert result - diff --git a/sdk/computeschedule/azure-mgmt-computeschedule/tsp-location.yaml b/sdk/computeschedule/azure-mgmt-computeschedule/tsp-location.yaml index 68e2a76acd98..335977793938 100644 --- a/sdk/computeschedule/azure-mgmt-computeschedule/tsp-location.yaml +++ b/sdk/computeschedule/azure-mgmt-computeschedule/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/computeschedule/ComputeSchedule.Management -commit: 4883fa5dbf6f2c9093fac8ce334547e9dfac68fa +commit: b6075dbc2321933382ea91c787ee62c6bdb87e5d repo: Azure/azure-rest-api-specs additionalDirectories: From f8390ab07dfb8a36d21658da42d7690b67f3ff4e Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 21 Jan 2025 21:11:17 -0800 Subject: [PATCH 08/29] [AutoRelease] t2-quota-2025-01-16-93059(can only be merged by SDK owner) (#39215) * code and test * update testcases * Update CHANGELOG.md to remove method details * Update changelog for quota operations changes * Update release date in CHANGELOG.md --------- Co-authored-by: azure-sdk Co-authored-by: ChenxiJiang333 Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> --- sdk/quota/azure-mgmt-quota/CHANGELOG.md | 70 ++ sdk/quota/azure-mgmt-quota/_meta.json | 8 +- .../azure/mgmt/quota/__init__.py | 12 +- .../azure/mgmt/quota/_configuration.py | 7 +- .../azure/mgmt/quota/_quota_mgmt_client.py | 37 +- .../azure/mgmt/quota/_serialization.py | 438 +++++--- .../azure/mgmt/quota/_vendor.py | 16 - .../azure/mgmt/quota/_version.py | 2 +- .../azure/mgmt/quota/aio/__init__.py | 12 +- .../azure/mgmt/quota/aio/_configuration.py | 7 +- .../mgmt/quota/aio/_quota_mgmt_client.py | 37 +- .../mgmt/quota/aio/operations/__init__.py | 40 +- .../_group_quota_limits_operations.py | 176 +--- .../_group_quota_limits_request_operations.py | 392 ++------ ...roup_quota_location_settings_operations.py | 785 --------------- ...uota_subscription_allocation_operations.py | 175 +--- ...scription_allocation_request_operations.py | 613 ++++-------- ..._quota_subscription_requests_operations.py | 19 +- .../_group_quota_subscriptions_operations.py | 93 +- .../_group_quota_usages_operations.py | 147 --- .../operations/_group_quotas_operations.py | 93 +- .../operations/_quota_operation_operations.py | 14 +- .../quota/aio/operations/_quota_operations.py | 105 +- .../_quota_request_status_operations.py | 29 +- .../aio/operations/_usages_operations.py | 29 +- .../azure/mgmt/quota/models/__init__.py | 213 ++-- .../azure/mgmt/quota/models/_models_py3.py | 598 +++++------ .../quota/models/_quota_mgmt_client_enums.py | 22 - .../azure/mgmt/quota/operations/__init__.py | 40 +- .../_group_quota_limits_operations.py | 229 +---- .../_group_quota_limits_request_operations.py | 445 ++------- ...roup_quota_location_settings_operations.py | 944 ------------------ ...uota_subscription_allocation_operations.py | 223 +---- ...scription_allocation_request_operations.py | 699 ++++--------- ..._quota_subscription_requests_operations.py | 23 +- .../_group_quota_subscriptions_operations.py | 105 +- .../_group_quota_usages_operations.py | 191 ---- .../operations/_group_quotas_operations.py | 103 +- .../operations/_quota_operation_operations.py | 16 +- .../quota/operations/_quota_operations.py | 113 ++- .../_quota_request_status_operations.py | 33 +- .../quota/operations/_usages_operations.py | 33 +- .../azure-mgmt-quota/dev_requirements.txt | 1 + .../get_compute_one_sku_quota_limit.py | 2 +- .../get_compute_one_sku_usages.py | 2 +- .../get_compute_quota_limits.py | 2 +- .../generated_samples/get_compute_usages.py | 2 +- ..._machine_learning_services_quota_limits.py | 2 +- .../get_machine_learning_services_usages.py | 2 +- .../get_network_one_sku_quota_limit.py | 2 +- .../get_network_one_sku_usages.py | 2 +- .../get_network_quota_limits.py | 2 +- .../generated_samples/get_network_usages.py | 2 +- .../generated_samples/get_operations.py | 2 +- .../get_quota_request_status_by_id.py | 2 +- .../get_quota_request_status_failed.py | 2 +- .../get_quota_request_status_in_progress.py | 2 +- .../get_quota_requests_history.py | 2 +- .../list_group_quota_limits_compute.py} | 9 +- .../group_quota_limits_requests_get.py} | 9 +- .../group_quota_limits_requests_list.py} | 7 +- ...tch_group_quota_limits_requests_compute.py | 4 +- ...put_group_quota_limits_requests_compute.py | 44 - .../group_quotas/delete_group_quotas.py | 2 +- .../group_quotas/get_group_quotas.py | 2 +- .../group_quotas/get_group_quotas_list.py | 2 +- .../group_quotas/patch_group_quotas.py | 2 +- .../group_quotas/put_group_quotas.py | 2 +- .../put_group_quota_enforcement_failed.py | 44 - .../delete_group_quota_subscriptions.py | 2 +- .../get_group_quota_subscriptions.py | 2 +- .../list_group_quota_subscriptions.py | 2 +- .../patch_group_quotas_subscription.py | 2 +- .../put_group_quotas_subscription.py | 2 +- .../patch_compute_quota_request.py | 4 +- .../patch_network_one_sku_quota_request.py | 4 +- .../put_compute_one_sku_quota_request.py | 4 +- ...ing_services_quota_request_low_priority.py | 4 +- .../put_network_one_sku_quota_request.py | 4 +- ...equest_standard_sku_public_ip_addresses.py | 4 +- ...cription_quota_allocation_list_compute.py} | 12 +- ...iption_quota_allocation_request_compute.py | 15 +- ...n_quota_allocation_requests_get_compute.py | 3 +- ...quota_allocation_requests_list_compute.py} | 16 +- .../subscription_requests_get.py} | 11 +- .../subscription_requests_list.py | 2 +- .../generated_tests/conftest.py | 35 + ...uota_mgmt_group_quota_limits_operations.py | 33 + ...gmt_group_quota_limits_operations_async.py | 34 + ...t_group_quota_limits_request_operations.py | 60 ++ ...p_quota_limits_request_operations_async.py | 63 ++ ...uota_subscription_allocation_operations.py | 33 + ...ubscription_allocation_operations_async.py | 34 + ...scription_allocation_request_operations.py | 88 ++ ...ion_allocation_request_operations_async.py | 91 ++ ..._quota_subscription_requests_operations.py | 44 + ..._subscription_requests_operations_async.py | 45 + ...mt_group_quota_subscriptions_operations.py | 79 ++ ...up_quota_subscriptions_operations_async.py | 86 ++ ...test_quota_mgmt_group_quotas_operations.py | 78 ++ ...uota_mgmt_group_quotas_operations_async.py | 85 ++ ...t_quota_mgmt_quota_operation_operations.py | 29 + ...a_mgmt_quota_operation_operations_async.py | 30 + .../test_quota_mgmt_quota_operations.py | 94 ++ .../test_quota_mgmt_quota_operations_async.py | 99 ++ ...ta_mgmt_quota_request_status_operations.py | 42 + ...t_quota_request_status_operations_async.py | 43 + .../test_quota_mgmt_usages_operations.py | 42 + ...test_quota_mgmt_usages_operations_async.py | 43 + sdk/quota/azure-mgmt-quota/setup.py | 1 + sdk/quota/azure-mgmt-quota/tests/conftest.py | 35 + ...t_quota_operation_operations_async_test.py | 27 + ...ta_mgmt_quota_operation_operations_test.py | 26 + 113 files changed, 3349 insertions(+), 5687 deletions(-) delete mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_vendor.py delete mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_location_settings_operations.py delete mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_usages_operations.py delete mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_location_settings_operations.py delete mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_usages_operations.py rename sdk/quota/azure-mgmt-quota/generated_samples/{group_quota_usages/get_group_quota_usages.py => group_quota_limits/list_group_quota_limits_compute.py} (86%) rename sdk/quota/azure-mgmt-quota/generated_samples/{group_quotas_enforcement/get_group_quota_enforcement.py => group_quota_limits_requests/group_quota_limits_requests_get.py} (83%) rename sdk/quota/azure-mgmt-quota/generated_samples/{group_quotas_enforcement/list_group_quota_enforcement.py => group_quota_limits_requests/group_quota_limits_requests_list.py} (85%) delete mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/put_group_quota_limits_requests_compute.py delete mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/put_group_quota_enforcement_failed.py rename sdk/quota/azure-mgmt-quota/generated_samples/{group_quotas_enforcement/put_group_quota_enforcement.py => subscription_quota_allocation/subscription_quota_allocation_list_compute.py} (80%) rename sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/{put_subscription_quota_allocation_request_compute.py => subscription_quota_allocation_requests_list_compute.py} (76%) rename sdk/quota/azure-mgmt-quota/generated_samples/{group_quotas_enforcement/patch_group_quota_enforcement.py => subscription_requests/subscription_requests_get.py} (82%) create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/conftest.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_request_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_request_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_request_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_request_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_requests_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_requests_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscriptions_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscriptions_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quotas_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quotas_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operation_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operation_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/tests/conftest.py create mode 100644 sdk/quota/azure-mgmt-quota/tests/test_quota_mgmt_quota_operation_operations_async_test.py create mode 100644 sdk/quota/azure-mgmt-quota/tests/test_quota_mgmt_quota_operation_operations_test.py diff --git a/sdk/quota/azure-mgmt-quota/CHANGELOG.md b/sdk/quota/azure-mgmt-quota/CHANGELOG.md index 713d4ec72fdc..8629abda657e 100644 --- a/sdk/quota/azure-mgmt-quota/CHANGELOG.md +++ b/sdk/quota/azure-mgmt-quota/CHANGELOG.md @@ -1,5 +1,75 @@ # Release History +## 2.0.0b2 (2025-01-22) + +### Features Added + + - Model `GroupQuotaDetails` added property `resource_name` + - Model `GroupQuotaLimitList` added property `properties` + - Model `GroupQuotaLimitList` added property `id` + - Model `GroupQuotaLimitList` added property `name` + - Model `GroupQuotaLimitList` added property `type` + - Model `GroupQuotaLimitList` added property `system_data` + - Model `SubscriptionQuotaAllocationsList` added property `properties` + - Model `SubscriptionQuotaAllocationsList` added property `id` + - Model `SubscriptionQuotaAllocationsList` added property `name` + - Model `SubscriptionQuotaAllocationsList` added property `type` + - Model `SubscriptionQuotaAllocationsList` added property `system_data` + - Model `SubscriptionQuotaDetails` added property `resource_name` + - Added model `GroupQuotaLimitListProperties` + - Added model `GroupQuotaLimitProperties` + - Added model `GroupQuotasEntityPatchProperties` + - Added model `GroupQuotasEntityProperties` + - Added model `SubscriptionQuotaAllocationsListProperties` + - Added model `SubscriptionQuotaAllocationsProperties` + +### Breaking Changes + + - Deleted or renamed client operation group `QuotaMgmtClient.group_quota_usages` + - Deleted or renamed client operation group `QuotaMgmtClient.group_quota_location_settings` + - Model `GroupQuotaDetails` deleted or renamed its instance variable `region` + - Model `GroupQuotaLimit` deleted or renamed its instance variable `id` + - Model `GroupQuotaLimit` deleted or renamed its instance variable `name` + - Model `GroupQuotaLimit` deleted or renamed its instance variable `type` + - Model `GroupQuotaLimit` deleted or renamed its instance variable `system_data` + - Model `GroupQuotaLimitList` deleted or renamed its instance variable `value` + - Model `GroupQuotaLimitList` deleted or renamed its instance variable `next_link` + - Model `GroupQuotasEntityBase` deleted or renamed its instance variable `additional_attributes` + - Model `GroupQuotasEntityBasePatch` deleted or renamed its instance variable `additional_attributes` + - Model `SubscriptionQuotaAllocations` deleted or renamed its instance variable `id` + - Model `SubscriptionQuotaAllocations` deleted or renamed its instance variable `name` + - Model `SubscriptionQuotaAllocations` deleted or renamed its instance variable `type` + - Model `SubscriptionQuotaAllocations` deleted or renamed its instance variable `system_data` + - Model `SubscriptionQuotaAllocationsList` deleted or renamed its instance variable `value` + - Model `SubscriptionQuotaAllocationsList` deleted or renamed its instance variable `next_link` + - Model `SubscriptionQuotaDetails` deleted or renamed its instance variable `region` + - Deleted or renamed model `AdditionalAttributes` + - Deleted or renamed model `AdditionalAttributesPatch` + - Deleted or renamed model `BillingAccountId` + - Deleted or renamed model `EnforcementState` + - Deleted or renamed model `EnvironmentType` + - Deleted or renamed model `GroupQuotasEnforcementListResponse` + - Deleted or renamed model `GroupQuotasEnforcementResponse` + - Deleted or renamed model `GroupQuotasEnforcementResponseProperties` + - Deleted or renamed model `GroupingId` + - Deleted or renamed model `GroupingIdType` + - Method `GroupQuotaLimitsOperations.list` inserted a `positional_or_keyword` parameter `location` + - Method `GroupQuotaLimitsOperations.list` deleted or renamed its parameter `filter` of kind `positional_or_keyword` + - Deleted or renamed method `GroupQuotaLimitsOperations.get` + - Method `GroupQuotaLimitsRequestOperations.begin_update` inserted a `positional_or_keyword` parameter `location` + - Method `GroupQuotaLimitsRequestOperations.begin_update` deleted or renamed its parameter `resource_name` of kind `positional_or_keyword` + - Deleted or renamed method `GroupQuotaLimitsRequestOperations.begin_create_or_update` + - Method `GroupQuotaSubscriptionAllocationOperations.list` inserted a `positional_or_keyword` parameter `resource_provider_name` + - Method `GroupQuotaSubscriptionAllocationOperations.list` inserted a `positional_or_keyword` parameter `location` + - Method `GroupQuotaSubscriptionAllocationOperations.list` deleted or renamed its parameter `filter` of kind `positional_or_keyword` + - Deleted or renamed method `GroupQuotaSubscriptionAllocationOperations.get` + - Method `GroupQuotaSubscriptionAllocationRequestOperations.begin_update` inserted a `positional_or_keyword` parameter `location` + - Method `GroupQuotaSubscriptionAllocationRequestOperations.begin_update` deleted or renamed its parameter `resource_name` of kind `positional_or_keyword` + - Method `GroupQuotaSubscriptionAllocationRequestOperations.get` inserted a `positional_or_keyword` parameter `resource_provider_name` + - Deleted or renamed method `GroupQuotaSubscriptionAllocationRequestOperations.begin_create_or_update` + - Deleted or renamed operation group `GroupQuotaLocationSettingsOperations` + - Deleted or renamed operation group `GroupQuotaUsagesOperations` + ## 2.0.0b1 (2024-04-22) ### Features Added diff --git a/sdk/quota/azure-mgmt-quota/_meta.json b/sdk/quota/azure-mgmt-quota/_meta.json index 74f21603f73a..5c3260d8d45a 100644 --- a/sdk/quota/azure-mgmt-quota/_meta.json +++ b/sdk/quota/azure-mgmt-quota/_meta.json @@ -1,11 +1,11 @@ { - "commit": "665e7c3b6f26b148b3c05e55602621bc293cc0a4", + "commit": "1b038fc40563bdafb343a71cd5f7d3dee6bc4b5b", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.7", + "autorest": "3.10.2", "use": [ - "@autorest/python@6.13.7", + "@autorest/python@6.27.4", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/quota/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.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", + "autorest_command": "autorest specification/quota/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2024-12-18-preview --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/quota/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py index c2236cbe06e3..ca2fd1eaa0f5 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._quota_mgmt_client import QuotaMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._quota_mgmt_client import QuotaMgmtClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "QuotaMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py index eeb2629a6960..aae7737db660 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py @@ -14,11 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for QuotaMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -28,13 +27,13 @@ class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attribu :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2024-12-18-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-06-01-preview") + api_version: str = kwargs.pop("api_version", "2024-12-18-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_quota_mgmt_client.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_quota_mgmt_client.py index c4db1c08ab11..b46572f47920 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_quota_mgmt_client.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_quota_mgmt_client.py @@ -8,6 +8,7 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -20,12 +21,10 @@ from .operations import ( GroupQuotaLimitsOperations, GroupQuotaLimitsRequestOperations, - GroupQuotaLocationSettingsOperations, GroupQuotaSubscriptionAllocationOperations, GroupQuotaSubscriptionAllocationRequestOperations, GroupQuotaSubscriptionRequestsOperations, GroupQuotaSubscriptionsOperations, - GroupQuotaUsagesOperations, GroupQuotasOperations, QuotaOperationOperations, QuotaOperations, @@ -34,11 +33,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class QuotaMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class QuotaMgmtClient: # pylint: disable=too-many-instance-attributes """Microsoft Azure Quota Resource Provider. This Swagger is for Azure Group Quota using GroupQuota Entity. @@ -50,24 +48,19 @@ class QuotaMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too :ivar group_quota_subscription_requests: GroupQuotaSubscriptionRequestsOperations operations :vartype group_quota_subscription_requests: azure.mgmt.quota.operations.GroupQuotaSubscriptionRequestsOperations - :ivar group_quota_limits: GroupQuotaLimitsOperations operations - :vartype group_quota_limits: azure.mgmt.quota.operations.GroupQuotaLimitsOperations :ivar group_quota_limits_request: GroupQuotaLimitsRequestOperations operations :vartype group_quota_limits_request: azure.mgmt.quota.operations.GroupQuotaLimitsRequestOperations - :ivar group_quota_subscription_allocation: GroupQuotaSubscriptionAllocationOperations - operations - :vartype group_quota_subscription_allocation: - azure.mgmt.quota.operations.GroupQuotaSubscriptionAllocationOperations + :ivar group_quota_limits: GroupQuotaLimitsOperations operations + :vartype group_quota_limits: azure.mgmt.quota.operations.GroupQuotaLimitsOperations :ivar group_quota_subscription_allocation_request: GroupQuotaSubscriptionAllocationRequestOperations operations :vartype group_quota_subscription_allocation_request: azure.mgmt.quota.operations.GroupQuotaSubscriptionAllocationRequestOperations - :ivar group_quota_usages: GroupQuotaUsagesOperations operations - :vartype group_quota_usages: azure.mgmt.quota.operations.GroupQuotaUsagesOperations - :ivar group_quota_location_settings: GroupQuotaLocationSettingsOperations operations - :vartype group_quota_location_settings: - azure.mgmt.quota.operations.GroupQuotaLocationSettingsOperations + :ivar group_quota_subscription_allocation: GroupQuotaSubscriptionAllocationOperations + operations + :vartype group_quota_subscription_allocation: + azure.mgmt.quota.operations.GroupQuotaSubscriptionAllocationOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.quota.operations.UsagesOperations :ivar quota: QuotaOperations operations @@ -82,7 +75,7 @@ class QuotaMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2024-12-18-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -128,22 +121,16 @@ def __init__( self.group_quota_subscription_requests = GroupQuotaSubscriptionRequestsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.group_quota_limits = GroupQuotaLimitsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.group_quota_limits_request = GroupQuotaLimitsRequestOperations( self._client, self._config, self._serialize, self._deserialize ) - self.group_quota_subscription_allocation = GroupQuotaSubscriptionAllocationOperations( + self.group_quota_limits = GroupQuotaLimitsOperations( self._client, self._config, self._serialize, self._deserialize ) self.group_quota_subscription_allocation_request = GroupQuotaSubscriptionAllocationRequestOperations( self._client, self._config, self._serialize, self._deserialize ) - self.group_quota_usages = GroupQuotaUsagesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.group_quota_location_settings = GroupQuotaLocationSettingsOperations( + self.group_quota_subscription_allocation = GroupQuotaSubscriptionAllocationOperations( self._client, self._config, self._serialize, self._deserialize ) self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) @@ -178,7 +165,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: def close(self) -> None: self._client.close() - def __enter__(self) -> "QuotaMgmtClient": + def __enter__(self) -> Self: self._client.__enter__() return self diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_serialization.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_serialization.py index 2f781d740827..b24ab2885450 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_serialization.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_serialization.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -24,7 +25,6 @@ # # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -52,7 +52,6 @@ MutableMapping, Type, List, - Mapping, ) try: @@ -91,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -144,6 +145,8 @@ def _json_attemp(data): # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod @@ -153,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -182,15 +190,30 @@ class UTC(datetime.tzinfo): """Time Zone info for handling UTC""" def utcoffset(self, dt): - """UTF offset for UTC is 0.""" + """UTF offset for UTC is 0. + + :param datetime.datetime dt: The datetime + :returns: The offset + :rtype: datetime.timedelta + """ return datetime.timedelta(0) def tzname(self, dt): - """Timestamp representation.""" + """Timestamp representation. + + :param datetime.datetime dt: The datetime + :returns: The timestamp representation + :rtype: str + """ return "Z" def dst(self, dt): - """No daylight saving for UTC.""" + """No daylight saving for UTC. + + :param datetime.datetime dt: The datetime + :returns: The daylight saving time + :rtype: datetime.timedelta + """ return datetime.timedelta(hours=1) @@ -204,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore :param datetime.timedelta offset: offset in timedelta format """ - def __init__(self, offset): + def __init__(self, offset) -> None: self.__offset = offset def utcoffset(self, dt): @@ -233,24 +256,26 @@ def __getinitargs__(self): _FLATTEN = re.compile(r"(? None: self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -298,13 +330,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -324,7 +366,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -344,7 +390,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, @@ -378,12 +426,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -393,7 +444,7 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @@ -406,6 +457,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @@ -424,9 +476,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -446,21 +500,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -499,11 +557,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -538,7 +598,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -558,13 +618,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict :raises: SerializationError if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -590,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": @@ -631,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -662,17 +728,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict :raises: SerializationError if serialization fails. :raises: ValueError if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -701,7 +767,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -710,9 +776,11 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str + :returns: The serialized URL path :raises: TypeError if serialization fails. :raises: ValueError if data is None """ @@ -726,21 +794,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object 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, list :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -757,19 +824,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -778,21 +846,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None :raises: AttributeError if required data is None. :raises: ValueError if data is None :raises: SerializationError if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -803,7 +870,7 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class @@ -819,11 +886,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -839,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -869,8 +938,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -880,15 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - 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 + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -943,9 +1009,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -969,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -977,6 +1042,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1001,7 +1067,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1032,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1089,11 +1160,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1103,30 +1175,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: TypeError if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1139,12 +1213,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: SerializationError if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1170,13 +1245,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int :raises: SerializationError if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1184,11 +1260,11 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data @@ -1209,7 +1285,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1230,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1277,7 +1367,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1329,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1352,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1361,9 +1450,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1401,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None): :param str content_type: Swagger "produces" if available. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree @@ -1414,12 +1504,13 @@ def _deserialize(self, target_obj, data): :param object data: Object to deserialize. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1438,13 +1529,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) - if data is None: + if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1474,9 +1565,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1503,6 +1593,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1514,7 +1606,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1529,10 +1621,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1550,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1577,24 +1673,35 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1603,15 +1710,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1625,7 +1733,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1645,14 +1757,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1669,6 +1781,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1679,11 +1792,12 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict :raises: TypeError if non-builtin datatype encountered. """ @@ -1718,11 +1832,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1730,6 +1843,7 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool :raises: TypeError if string format is not valid. """ @@ -1741,24 +1855,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1766,6 +1879,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1779,8 +1893,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1792,6 +1905,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1802,9 +1916,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1820,6 +1934,7 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1832,6 +1947,7 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1847,8 +1963,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal + :return: Deserialized decimal :raises: DeserializationError if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1863,6 +1980,7 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int :raises: ValueError if string format invalid. """ @@ -1875,6 +1993,7 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta :raises: DeserializationError if string format invalid. """ @@ -1885,14 +2004,14 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date :raises: DeserializationError if string format invalid. """ @@ -1908,6 +2027,7 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time :raises: DeserializationError if string format invalid. """ @@ -1922,6 +2042,7 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1937,14 +2058,14 @@ def deserialize_rfc(attr): except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1974,8 +2095,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1983,6 +2103,7 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime :raises: DeserializationError if format invalid """ @@ -1994,5 +2115,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_vendor.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_vendor.py deleted file mode 100644 index 0dafe0e287ff..000000000000 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_vendor.py +++ /dev/null @@ -1,16 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py index e32dc6ec4218..2eda20789583 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0b1" +VERSION = "2.0.0b2" diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py index 6197d6e20563..f26294359742 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._quota_mgmt_client import QuotaMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._quota_mgmt_client import QuotaMgmtClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "QuotaMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py index a538528c4864..285e2d11e322 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py @@ -14,11 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for QuotaMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -28,13 +27,13 @@ class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attribu :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2024-12-18-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-06-01-preview") + api_version: str = kwargs.pop("api_version", "2024-12-18-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_quota_mgmt_client.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_quota_mgmt_client.py index 97b28592ebcd..ac227e9fc28d 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_quota_mgmt_client.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_quota_mgmt_client.py @@ -8,6 +8,7 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -20,12 +21,10 @@ from .operations import ( GroupQuotaLimitsOperations, GroupQuotaLimitsRequestOperations, - GroupQuotaLocationSettingsOperations, GroupQuotaSubscriptionAllocationOperations, GroupQuotaSubscriptionAllocationRequestOperations, GroupQuotaSubscriptionRequestsOperations, GroupQuotaSubscriptionsOperations, - GroupQuotaUsagesOperations, GroupQuotasOperations, QuotaOperationOperations, QuotaOperations, @@ -34,11 +33,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class QuotaMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class QuotaMgmtClient: # pylint: disable=too-many-instance-attributes """Microsoft Azure Quota Resource Provider. This Swagger is for Azure Group Quota using GroupQuota Entity. @@ -50,24 +48,19 @@ class QuotaMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too :ivar group_quota_subscription_requests: GroupQuotaSubscriptionRequestsOperations operations :vartype group_quota_subscription_requests: azure.mgmt.quota.aio.operations.GroupQuotaSubscriptionRequestsOperations - :ivar group_quota_limits: GroupQuotaLimitsOperations operations - :vartype group_quota_limits: azure.mgmt.quota.aio.operations.GroupQuotaLimitsOperations :ivar group_quota_limits_request: GroupQuotaLimitsRequestOperations operations :vartype group_quota_limits_request: azure.mgmt.quota.aio.operations.GroupQuotaLimitsRequestOperations - :ivar group_quota_subscription_allocation: GroupQuotaSubscriptionAllocationOperations - operations - :vartype group_quota_subscription_allocation: - azure.mgmt.quota.aio.operations.GroupQuotaSubscriptionAllocationOperations + :ivar group_quota_limits: GroupQuotaLimitsOperations operations + :vartype group_quota_limits: azure.mgmt.quota.aio.operations.GroupQuotaLimitsOperations :ivar group_quota_subscription_allocation_request: GroupQuotaSubscriptionAllocationRequestOperations operations :vartype group_quota_subscription_allocation_request: azure.mgmt.quota.aio.operations.GroupQuotaSubscriptionAllocationRequestOperations - :ivar group_quota_usages: GroupQuotaUsagesOperations operations - :vartype group_quota_usages: azure.mgmt.quota.aio.operations.GroupQuotaUsagesOperations - :ivar group_quota_location_settings: GroupQuotaLocationSettingsOperations operations - :vartype group_quota_location_settings: - azure.mgmt.quota.aio.operations.GroupQuotaLocationSettingsOperations + :ivar group_quota_subscription_allocation: GroupQuotaSubscriptionAllocationOperations + operations + :vartype group_quota_subscription_allocation: + azure.mgmt.quota.aio.operations.GroupQuotaSubscriptionAllocationOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.quota.aio.operations.UsagesOperations :ivar quota: QuotaOperations operations @@ -82,7 +75,7 @@ class QuotaMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2024-12-18-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -128,22 +121,16 @@ def __init__( self.group_quota_subscription_requests = GroupQuotaSubscriptionRequestsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.group_quota_limits = GroupQuotaLimitsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.group_quota_limits_request = GroupQuotaLimitsRequestOperations( self._client, self._config, self._serialize, self._deserialize ) - self.group_quota_subscription_allocation = GroupQuotaSubscriptionAllocationOperations( + self.group_quota_limits = GroupQuotaLimitsOperations( self._client, self._config, self._serialize, self._deserialize ) self.group_quota_subscription_allocation_request = GroupQuotaSubscriptionAllocationRequestOperations( self._client, self._config, self._serialize, self._deserialize ) - self.group_quota_usages = GroupQuotaUsagesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.group_quota_location_settings = GroupQuotaLocationSettingsOperations( + self.group_quota_subscription_allocation = GroupQuotaSubscriptionAllocationOperations( self._client, self._config, self._serialize, self._deserialize ) self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) @@ -180,7 +167,7 @@ def _send_request( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "QuotaMgmtClient": + async def __aenter__(self) -> Self: await self._client.__aenter__() return self diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py index 4bec73e40834..7baec1eac569 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py @@ -5,39 +5,41 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._group_quotas_operations import GroupQuotasOperations -from ._group_quota_subscriptions_operations import GroupQuotaSubscriptionsOperations -from ._group_quota_subscription_requests_operations import GroupQuotaSubscriptionRequestsOperations -from ._group_quota_limits_operations import GroupQuotaLimitsOperations -from ._group_quota_limits_request_operations import GroupQuotaLimitsRequestOperations -from ._group_quota_subscription_allocation_operations import GroupQuotaSubscriptionAllocationOperations -from ._group_quota_subscription_allocation_request_operations import GroupQuotaSubscriptionAllocationRequestOperations -from ._group_quota_usages_operations import GroupQuotaUsagesOperations -from ._group_quota_location_settings_operations import GroupQuotaLocationSettingsOperations -from ._usages_operations import UsagesOperations -from ._quota_operations import QuotaOperations -from ._quota_request_status_operations import QuotaRequestStatusOperations -from ._quota_operation_operations import QuotaOperationOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._group_quotas_operations import GroupQuotasOperations # type: ignore +from ._group_quota_subscriptions_operations import GroupQuotaSubscriptionsOperations # type: ignore +from ._group_quota_subscription_requests_operations import GroupQuotaSubscriptionRequestsOperations # type: ignore +from ._group_quota_limits_request_operations import GroupQuotaLimitsRequestOperations # type: ignore +from ._group_quota_limits_operations import GroupQuotaLimitsOperations # type: ignore +from ._group_quota_subscription_allocation_request_operations import GroupQuotaSubscriptionAllocationRequestOperations # type: ignore +from ._group_quota_subscription_allocation_operations import GroupQuotaSubscriptionAllocationOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._quota_operations import QuotaOperations # type: ignore +from ._quota_request_status_operations import QuotaRequestStatusOperations # type: ignore +from ._quota_operation_operations import QuotaOperationOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "GroupQuotasOperations", "GroupQuotaSubscriptionsOperations", "GroupQuotaSubscriptionRequestsOperations", - "GroupQuotaLimitsOperations", "GroupQuotaLimitsRequestOperations", - "GroupQuotaSubscriptionAllocationOperations", + "GroupQuotaLimitsOperations", "GroupQuotaSubscriptionAllocationRequestOperations", - "GroupQuotaUsagesOperations", - "GroupQuotaLocationSettingsOperations", + "GroupQuotaSubscriptionAllocationOperations", "UsagesOperations", "QuotaOperations", "QuotaRequestStatusOperations", "QuotaOperationOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_limits_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_limits_operations.py index b64c3ca0b800..3532ca4bfeff 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_limits_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_limits_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse +import sys +from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -19,17 +17,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request -from ...operations._group_quota_limits_operations import build_get_request, build_list_request +from ...operations._group_quota_limits_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,20 +53,14 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - filter: str, - **kwargs: Any - ) -> _models.GroupQuotaLimit: - """Gets the GroupQuotaLimits for the specific resource. - - Gets the GroupQuotaLimits for the specific resource for a specific resource based on the - resourceProviders, resourceName and $filter passed. - The $filter=location eq {location} is required to location specific resources groupQuota. + async def list( + self, management_group_id: str, group_quota_name: str, resource_provider_name: str, location: str, **kwargs: Any + ) -> _models.GroupQuotaLimitList: + """Gets the GroupQuotaLimits for the specified resource provider and location for resource names + passed in $filter=resourceName eq {SKU}. + + Gets the GroupQuotaLimits for the specified resource provider and location for resource names + passed in $filter=resourceName eq {SKU}. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -77,24 +70,13 @@ async def get( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: GroupQuotaLimit or the result of cls(response) - :rtype: ~azure.mgmt.quota.models.GroupQuotaLimit + :param location: The name of the Azure region. Required. + :type location: str + :return: GroupQuotaLimitList or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.GroupQuotaLimitList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -106,19 +88,17 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GroupQuotaLimit] = kwargs.pop("cls", None) + cls: ClsType[_models.GroupQuotaLimitList] = kwargs.pop("cls", None) - _request = build_get_request( + _request = build_list_request( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, - filter=filter, + location=location, api_version=api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -133,115 +113,9 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GroupQuotaLimit", pipeline_response) + deserialized = self._deserialize("GroupQuotaLimitList", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list( - self, management_group_id: str, group_quota_name: str, resource_provider_name: str, filter: str, **kwargs: Any - ) -> AsyncIterable["_models.GroupQuotaLimit"]: - """Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location - eq {location}. - - Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter - passed. - The $filter=location eq {location} is required to location specific resources groupQuota. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: An iterator like instance of either GroupQuotaLimit or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.GroupQuotaLimit] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GroupQuotaLimitList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GroupQuotaLimitList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_limits_request_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_limits_request_operations.py index 85b360e07db2..ffeb592d9c3b 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_limits_request_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_limits_request_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -17,12 +17,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict @@ -30,14 +31,16 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request from ...operations._group_quota_limits_request_operations import ( - build_create_or_update_request, build_get_request, build_list_request, build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,276 +64,16 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def _create_or_update_initial( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[Union[_models.SubmittedResourceRequestStatus, IO[bytes]]] = None, - **kwargs: Any - ) -> Union[_models.SubmittedResourceRequestStatus, _models.LROResponse]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Union[_models.SubmittedResourceRequestStatus, _models.LROResponse]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(group_quota_request, (IOBase, bytes)): - _content = group_quota_request - else: - if group_quota_request is not None: - _json = self._serialize.body(group_quota_request, "SubmittedResourceRequestStatus") - else: - _json = None - - _request = build_create_or_update_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - resource_name=resource_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("LROResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[_models.SubmittedResourceRequestStatus] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SubmittedResourceRequestStatus]: - """Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - - Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - resourceName ("name": {"value" : "resourceName") properties are specified in the request body. - Only 1 resource quota can be requested. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SubmittedResourceRequestStatus or An - instance of AsyncLROPoller that returns either LROResponse or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] or - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SubmittedResourceRequestStatus]: - """Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - - Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - resourceName ("name": {"value" : "resourceName") properties are specified in the request body. - Only 1 resource quota can be requested. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Default value is None. - :type group_quota_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SubmittedResourceRequestStatus or An - instance of AsyncLROPoller that returns either LROResponse or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] or - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[Union[_models.SubmittedResourceRequestStatus, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.SubmittedResourceRequestStatus]: - """Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - - Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - resourceName ("name": {"value" : "resourceName") properties are specified in the request body. - Only 1 resource quota can be requested. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Is either a SubmittedResourceRequestStatus type or a - IO[bytes] type. Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SubmittedResourceRequestStatus or An - instance of AsyncLROPoller that returns either LROResponse or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] or - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SubmittedResourceRequestStatus] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - resource_name=resource_name, - group_quota_request=group_quota_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.SubmittedResourceRequestStatus].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SubmittedResourceRequestStatus]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - async def _update_initial( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[Union[_models.SubmittedResourceRequestStatus, IO[bytes]]] = None, + location: str, + group_quota_request: Optional[Union[_models.GroupQuotaLimitList, IO[bytes]]] = None, **kwargs: Any - ) -> Optional[_models.SubmittedResourceRequestStatus]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +86,7 @@ async def _update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.SubmittedResourceRequestStatus]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -352,7 +95,7 @@ async def _update_initial( _content = group_quota_request else: if group_quota_request is not None: - _json = self._serialize.body(group_quota_request, "SubmittedResourceRequestStatus") + _json = self._serialize.body(group_quota_request, "GroupQuotaLimitList") else: _json = None @@ -360,7 +103,7 @@ async def _update_initial( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + location=location, api_version=api_version, content_type=content_type, json=_json, @@ -368,10 +111,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -379,15 +122,15 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) - if response.status_code == 202: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -395,6 +138,8 @@ async def _update_initial( "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -406,16 +151,16 @@ async def begin_update( management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[_models.SubmittedResourceRequestStatus] = None, + location: str, + group_quota_request: Optional[_models.GroupQuotaLimitList] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SubmittedResourceRequestStatus]: + ) -> AsyncLROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. - Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location - and resourceName properties are specified in the request body. Only 1 resource quota can be + Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The + resourceName properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a new groupQuota request. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals @@ -429,18 +174,17 @@ async def begin_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific resourceProvider/location/resources. Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus + :type group_quota_request: ~azure.mgmt.quota.models.GroupQuotaLimitList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SubmittedResourceRequestStatus or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] + :return: An instance of AsyncLROPoller that returns either GroupQuotaLimitList or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotaLimitList] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -450,16 +194,16 @@ async def begin_update( management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, + location: str, group_quota_request: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SubmittedResourceRequestStatus]: + ) -> AsyncLROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. - Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location - and resourceName properties are specified in the request body. Only 1 resource quota can be + Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The + resourceName properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a new groupQuota request. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals @@ -473,18 +217,17 @@ async def begin_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific resourceProvider/location/resources. Default value is None. :type group_quota_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SubmittedResourceRequestStatus or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] + :return: An instance of AsyncLROPoller that returns either GroupQuotaLimitList or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotaLimitList] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -494,14 +237,14 @@ async def begin_update( management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[Union[_models.SubmittedResourceRequestStatus, IO[bytes]]] = None, + location: str, + group_quota_request: Optional[Union[_models.GroupQuotaLimitList, IO[bytes]]] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.SubmittedResourceRequestStatus]: + ) -> AsyncLROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. - Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location - and resourceName properties are specified in the request body. Only 1 resource quota can be + Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The + resourceName properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a new groupQuota request. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals @@ -515,16 +258,15 @@ async def begin_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Is either a SubmittedResourceRequestStatus type or a - IO[bytes] type. Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SubmittedResourceRequestStatus or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] + resourceProvider/location/resources. Is either a GroupQuotaLimitList type or a IO[bytes] type. + Default value is None. + :type group_quota_request: ~azure.mgmt.quota.models.GroupQuotaLimitList or IO[bytes] + :return: An instance of AsyncLROPoller that returns either GroupQuotaLimitList or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotaLimitList] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -532,7 +274,7 @@ async def begin_update( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SubmittedResourceRequestStatus] = kwargs.pop("cls", None) + cls: ClsType[_models.GroupQuotaLimitList] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -541,7 +283,7 @@ async def begin_update( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + location=location, group_quota_request=group_quota_request, api_version=api_version, content_type=content_type, @@ -550,10 +292,11 @@ async def begin_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) + deserialized = self._deserialize("GroupQuotaLimitList", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -567,13 +310,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.SubmittedResourceRequestStatus].from_continuation_token( + return AsyncLROPoller[_models.GroupQuotaLimitList].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.SubmittedResourceRequestStatus]( + return AsyncLROPoller[_models.GroupQuotaLimitList]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -596,7 +339,7 @@ async def get( :rtype: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -618,7 +361,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -633,7 +375,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) + deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -679,7 +421,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubmittedResourceRequestStatusList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -699,7 +441,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -715,7 +456,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_location_settings_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_location_settings_operations.py deleted file mode 100644 index 51c9f3cbdb4f..000000000000 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_location_settings_operations.py +++ /dev/null @@ -1,785 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._group_quota_location_settings_operations import ( - build_create_or_update_request, - build_get_request, - build_list_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GroupQuotaLocationSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.quota.aio.QuotaMgmtClient`'s - :attr:`group_quota_location_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementResponse, IO[bytes]]] = None, - **kwargs: Any - ) -> Union[_models.GroupQuotasEnforcementResponse, _models.LROResponse]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Union[_models.GroupQuotasEnforcementResponse, _models.LROResponse]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(location_settings, (IOBase, bytes)): - _content = location_settings - else: - if location_settings is not None: - _json = self._serialize.body(location_settings, "GroupQuotasEnforcementResponse") - else: - _json = None - - _request = build_create_or_update_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("LROResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[_models.GroupQuotasEnforcementResponse] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Default value is None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either GroupQuotasEnforcementResponse or An - instance of AsyncLROPoller that returns either LROResponse or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] or - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Default value is None. - :type location_settings: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either GroupQuotasEnforcementResponse or An - instance of AsyncLROPoller that returns either LROResponse or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] or - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementResponse, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Is either a GroupQuotasEnforcementResponse type or a IO[bytes] type. Default value is - None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse or IO[bytes] - :return: An instance of AsyncLROPoller that returns either GroupQuotasEnforcementResponse or An - instance of AsyncLROPoller that returns either LROResponse or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] or - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GroupQuotasEnforcementResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - location_settings=location_settings, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.GroupQuotasEnforcementResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.GroupQuotasEnforcementResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementResponse, IO[bytes]]] = None, - **kwargs: Any - ) -> Optional[_models.GroupQuotasEnforcementResponse]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.GroupQuotasEnforcementResponse]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(location_settings, (IOBase, bytes)): - _content = location_settings - else: - if location_settings is not None: - _json = self._serialize.body(location_settings, "GroupQuotasEnforcementResponse") - else: - _json = None - - _request = build_update_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[_models.GroupQuotasEnforcementResponse] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Default value is None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either GroupQuotasEnforcementResponse or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Default value is None. - :type location_settings: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either GroupQuotasEnforcementResponse or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementResponse, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Is either a GroupQuotasEnforcementResponse type or a IO[bytes] type. Default value is - None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse or IO[bytes] - :return: An instance of AsyncLROPoller that returns either GroupQuotasEnforcementResponse or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GroupQuotasEnforcementResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - location_settings=location_settings, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.GroupQuotasEnforcementResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.GroupQuotasEnforcementResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get( - self, management_group_id: str, group_quota_name: str, resource_provider_name: str, location: str, **kwargs: Any - ) -> _models.GroupQuotasEnforcementResponse: - """Gets the GroupQuotas enforcement settings for the resource provider/location. - - Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, - where GroupQuota enforcement is not enabled will return Not Found. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :return: GroupQuotasEnforcementResponse or the result of cls(response) - :rtype: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GroupQuotasEnforcementResponse] = kwargs.pop("cls", None) - - _request = build_get_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, management_group_id: str, group_quota_name: str, resource_provider_name: str, **kwargs: Any - ) -> AsyncIterable["_models.GroupQuotasEnforcementResponse"]: - """Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - - Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is - enabled. The locations not included in GroupQuota Enforcement will not be listed, the regions - in failed status with listed as status Failed. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :return: An iterator like instance of either GroupQuotasEnforcementResponse or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GroupQuotasEnforcementListResponse] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GroupQuotasEnforcementListResponse", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_allocation_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_allocation_operations.py index c985a4910a29..3ea33765adf6 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_allocation_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_allocation_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse +import sys +from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -19,17 +17,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request -from ...operations._group_quota_subscription_allocation_operations import build_get_request, build_list_request +from ...operations._group_quota_subscription_allocation_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,146 +52,33 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, management_group_id: str, group_quota_name: str, filter: str, **kwargs: Any - ) -> AsyncIterable["_models.SubscriptionQuotaAllocations"]: - """Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - - Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - This will include the GroupQuota and total quota allocated to the subscription. Only the Group - quota allocated to the subscription can be allocated back to the MG Group Quota. Use the - $filter parameter to filter out the specific resource based on the ResourceProvider/Location. - $filter is a required parameter. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: An iterator like instance of either SubscriptionQuotaAllocations or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.SubscriptionQuotaAllocations] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SubscriptionQuotaAllocationsList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SubscriptionQuotaAllocationsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @distributed_trace_async - async def get( - self, management_group_id: str, group_quota_name: str, resource_name: str, filter: str, **kwargs: Any - ) -> _models.SubscriptionQuotaAllocations: - """Gets Quota allocated to a subscription for the specific Resource Provider, Location, - ResourceName. + async def list( + self, management_group_id: str, group_quota_name: str, resource_provider_name: str, location: str, **kwargs: Any + ) -> _models.SubscriptionQuotaAllocationsList: + """Gets all the quota allocated to a subscription for the specified resource provider and location + for resource names passed in $filter=resourceName eq {SKU}. - Gets Quota allocated to a subscription for the specific Resource Provider, Location, - ResourceName. This will include the GroupQuota and total quota allocated to the subscription. - Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. + Gets all the quota allocated to a subscription for the specified resource provider and location + for resource names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota + and total quota allocated to the subscription. Only the Group quota allocated to the + subscription can be allocated back to the MG Group Quota. :param management_group_id: Management Group Id. Required. :type management_group_id: str :param group_quota_name: The GroupQuota name. The name should be unique for the provided context tenantId/MgId. Required. :type group_quota_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: SubscriptionQuotaAllocations or the result of cls(response) - :rtype: ~azure.mgmt.quota.models.SubscriptionQuotaAllocations + :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. + Currently only Microsoft.Compute resource provider supports this API. Required. + :type resource_provider_name: str + :param location: The name of the Azure region. Required. + :type location: str + :return: SubscriptionQuotaAllocationsList or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -204,19 +90,18 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SubscriptionQuotaAllocations] = kwargs.pop("cls", None) + cls: ClsType[_models.SubscriptionQuotaAllocationsList] = kwargs.pop("cls", None) - _request = build_get_request( + _request = build_list_request( management_group_id=management_group_id, group_quota_name=group_quota_name, - resource_name=resource_name, + resource_provider_name=resource_provider_name, + location=location, subscription_id=self._config.subscription_id, - filter=filter, api_version=api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -231,7 +116,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("SubscriptionQuotaAllocations", pipeline_response) + deserialized = self._deserialize("SubscriptionQuotaAllocationsList", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_allocation_request_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_allocation_request_operations.py index 1989ba53691e..eab120cfa967 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_allocation_request_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_allocation_request_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -17,12 +17,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict @@ -30,14 +31,16 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request from ...operations._group_quota_subscription_allocation_request_operations import ( - build_create_or_update_request, build_get_request, build_list_request, build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,187 +64,16 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def get( - self, management_group_id: str, group_quota_name: str, allocation_id: str, **kwargs: Any - ) -> _models.QuotaAllocationRequestStatus: - """Get the status of the quota allocation request for the subscriptionId. - - Get the quota allocation request status for the subscriptionId by allocationId. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param allocation_id: Request Id. Required. - :type allocation_id: str - :return: QuotaAllocationRequestStatus or the result of cls(response) - :rtype: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.QuotaAllocationRequestStatus] = kwargs.pop("cls", None) - - _request = build_get_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - allocation_id=allocation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, management_group_id: str, group_quota_name: str, resource_provider_name: str, filter: str, **kwargs: Any - ) -> AsyncIterable["_models.QuotaAllocationRequestStatus"]: - """Get all the quotaAllocationRequests for a resourceProvider/location. - - Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for - location is required. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: An iterator like instance of either QuotaAllocationRequestStatus or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.QuotaAllocationRequestStatusList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("QuotaAllocationRequestStatusList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _create_or_update_initial( + async def _update_initial( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - allocate_quota_request: Union[_models.QuotaAllocationRequestStatus, IO[bytes]], + location: str, + allocate_quota_request: Union[_models.SubscriptionQuotaAllocationsList, IO[bytes]], **kwargs: Any - ) -> Union[_models.QuotaAllocationRequestStatus, _models.LROResponse]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +86,7 @@ async def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Union[_models.QuotaAllocationRequestStatus, _models.LROResponse]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -262,13 +94,13 @@ async def _create_or_update_initial( if isinstance(allocate_quota_request, (IOBase, bytes)): _content = allocate_quota_request else: - _json = self._serialize.body(allocate_quota_request, "QuotaAllocationRequestStatus") + _json = self._serialize.body(allocate_quota_request, "SubscriptionQuotaAllocationsList") - _request = build_create_or_update_request( + _request = build_update_request( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -277,33 +109,34 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) - - if response.status_code == 201: + if response.status_code == 202: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("LROResponse", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -311,26 +144,26 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_update( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - allocate_quota_request: _models.QuotaAllocationRequestStatus, + location: str, + allocate_quota_request: _models.SubscriptionQuotaAllocationsList, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.QuotaAllocationRequestStatus]: + ) -> AsyncLROPoller[_models.SubscriptionQuotaAllocationsList]: """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern to check the status using Async polling as standards defined at - - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + Asynchronous pattern with 202 response and status polling API. Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. + the GroupQuota. User can collect unused quotas from multiple subscriptions within the + groupQuota and assign the groupQuota to the subscription, where it's needed. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -340,42 +173,41 @@ async def begin_create_or_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param allocate_quota_request: Quota requests payload. Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus + :type allocate_quota_request: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either QuotaAllocationRequestStatus or An - instance of AsyncLROPoller that returns either LROResponse or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either SubscriptionQuotaAllocationsList or + the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] or - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.LROResponse] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_update( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, + location: str, allocate_quota_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.QuotaAllocationRequestStatus]: + ) -> AsyncLROPoller[_models.SubscriptionQuotaAllocationsList]: """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern to check the status using Async polling as standards defined at - - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + Asynchronous pattern with 202 response and status polling API. Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. + the GroupQuota. User can collect unused quotas from multiple subscriptions within the + groupQuota and assign the groupQuota to the subscription, where it's needed. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -385,40 +217,39 @@ async def begin_create_or_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param allocate_quota_request: Quota requests payload. Required. :type allocate_quota_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either QuotaAllocationRequestStatus or An - instance of AsyncLROPoller that returns either LROResponse or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either SubscriptionQuotaAllocationsList or + the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] or - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.LROResponse] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_or_update( + async def begin_update( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - allocate_quota_request: Union[_models.QuotaAllocationRequestStatus, IO[bytes]], + location: str, + allocate_quota_request: Union[_models.SubscriptionQuotaAllocationsList, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.QuotaAllocationRequestStatus]: + ) -> AsyncLROPoller[_models.SubscriptionQuotaAllocationsList]: """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern to check the status using Async polling as standards defined at - - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + Asynchronous pattern with 202 response and status polling API. Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. + the GroupQuota. User can collect unused quotas from multiple subscriptions within the + groupQuota and assign the groupQuota to the subscription, where it's needed. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -428,17 +259,16 @@ async def begin_create_or_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param allocate_quota_request: Quota requests payload. Is either a QuotaAllocationRequestStatus - type or a IO[bytes] type. Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus or + :param location: The name of the Azure region. Required. + :type location: str + :param allocate_quota_request: Quota requests payload. Is either a + SubscriptionQuotaAllocationsList type or a IO[bytes] type. Required. + :type allocate_quota_request: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList or IO[bytes] - :return: An instance of AsyncLROPoller that returns either QuotaAllocationRequestStatus or An - instance of AsyncLROPoller that returns either LROResponse or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either SubscriptionQuotaAllocationsList or + the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] or - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.LROResponse] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -446,16 +276,16 @@ async def begin_create_or_update( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.QuotaAllocationRequestStatus] = kwargs.pop("cls", None) + cls: ClsType[_models.SubscriptionQuotaAllocationsList] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._update_initial( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + location=location, allocate_quota_request=allocate_quota_request, api_version=api_version, content_type=content_type, @@ -464,10 +294,11 @@ async def begin_create_or_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) + deserialized = self._deserialize("SubscriptionQuotaAllocationsList", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -481,26 +312,44 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.QuotaAllocationRequestStatus].from_continuation_token( + return AsyncLROPoller[_models.SubscriptionQuotaAllocationsList].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.QuotaAllocationRequestStatus]( + return AsyncLROPoller[_models.SubscriptionQuotaAllocationsList]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _update_initial( + @distributed_trace_async + async def get( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - allocate_quota_request: Union[_models.QuotaAllocationRequestStatus, IO[bytes]], + allocation_id: str, **kwargs: Any - ) -> Optional[_models.QuotaAllocationRequestStatus]: - error_map = { + ) -> _models.QuotaAllocationRequestStatus: + """Get the status of the quota allocation request for the subscriptionId. + + Get the quota allocation request status for the subscriptionId by allocationId. + + :param management_group_id: Management Group Id. Required. + :type management_group_id: str + :param group_quota_name: The GroupQuota name. The name should be unique for the provided + context tenantId/MgId. Required. + :type group_quota_name: str + :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. + Currently only Microsoft.Compute resource provider supports this API. Required. + :type resource_provider_name: str + :param allocation_id: Request Id. Required. + :type allocation_id: str + :return: QuotaAllocationRequestStatus or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,35 +357,22 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.QuotaAllocationRequestStatus]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(allocate_quota_request, (IOBase, bytes)): - _content = allocate_quota_request - else: - _json = self._serialize.body(allocate_quota_request, "QuotaAllocationRequestStatus") + cls: ClsType[_models.QuotaAllocationRequestStatus] = kwargs.pop("cls", None) - _request = build_update_request( + _request = build_get_request( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + allocation_id=allocation_id, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -546,49 +382,26 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) - - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - allocate_quota_request: _models.QuotaAllocationRequestStatus, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.QuotaAllocationRequestStatus]: - """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern with 202 response and status polling API. + @distributed_trace + def list( + self, management_group_id: str, group_quota_name: str, resource_provider_name: str, filter: str, **kwargs: Any + ) -> AsyncIterable["_models.QuotaAllocationRequestStatus"]: + """Get all the quotaAllocationRequests for a resourceProvider/location. - Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - subscriptions or reduce the quota allocated to subscription to give back the unused quota ( - quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions - and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. User can collect unused quotas from multiple subscriptions within the - groupQuota and assign the groupQuota to the subscription, where it's needed. + Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for + location is required. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -598,150 +411,90 @@ async def begin_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param allocate_quota_request: Quota requests payload. Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either QuotaAllocationRequestStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ + :param filter: .. list-table:: + :header-rows: 1 - @overload - async def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - allocate_quota_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.QuotaAllocationRequestStatus]: - """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern with 202 response and status polling API. + * - Field + - Supported operators + * - - Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - subscriptions or reduce the quota allocated to subscription to give back the unused quota ( - quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions - and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. User can collect unused quotas from multiple subscriptions within the - groupQuota and assign the groupQuota to the subscription, where it's needed. - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param allocate_quota_request: Quota requests payload. Required. - :type allocate_quota_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either QuotaAllocationRequestStatus or the - result of cls(response) + location eq {location} + Example: $filter=location eq eastus. Required. + :type filter: str + :return: An iterator like instance of either QuotaAllocationRequestStatus or the result of + cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @distributed_trace_async - async def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - allocate_quota_request: Union[_models.QuotaAllocationRequestStatus, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.QuotaAllocationRequestStatus]: - """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern with 202 response and status polling API. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.QuotaAllocationRequestStatusList] = kwargs.pop("cls", None) - Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - subscriptions or reduce the quota allocated to subscription to give back the unused quota ( - quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions - and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. User can collect unused quotas from multiple subscriptions within the - groupQuota and assign the groupQuota to the subscription, where it's needed. + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param allocate_quota_request: Quota requests payload. Is either a QuotaAllocationRequestStatus - type or a IO[bytes] type. Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either QuotaAllocationRequestStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.QuotaAllocationRequestStatus] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - resource_name=resource_name, - allocate_quota_request=allocate_quota_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) + _request = build_list_request( + management_group_id=management_group_id, + group_quota_name=group_quota_name, + resource_provider_name=resource_provider_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("QuotaAllocationRequestStatusList", pipeline_response) + list_of_elem = deserialized.value if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.QuotaAllocationRequestStatus].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return AsyncLROPoller[_models.QuotaAllocationRequestStatus]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_requests_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_requests_operations.py index 5b09f29c1dd8..e3c221acaaba 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_requests_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscription_requests_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,6 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -19,17 +19,19 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._group_quota_subscription_requests_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +81,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GroupQuotaSubscriptionRequestStatusList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -97,7 +99,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -113,7 +114,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -167,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.quota.models.GroupQuotaSubscriptionRequestStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -189,7 +189,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -204,7 +203,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GroupQuotaSubscriptionRequestStatus", pipeline_response) + deserialized = self._deserialize("GroupQuotaSubscriptionRequestStatus", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscriptions_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscriptions_operations.py index a887320125b8..159a469356d1 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscriptions_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_subscriptions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +5,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -16,12 +16,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict @@ -29,7 +30,6 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request from ...operations._group_quota_subscriptions_operations import ( build_create_or_update_request, build_delete_request, @@ -38,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,8 +67,8 @@ def __init__(self, *args, **kwargs) -> None: async def _create_or_update_initial( self, management_group_id: str, group_quota_name: str, **kwargs: Any - ) -> Union[_models.GroupQuotaSubscriptionId, _models.LROResponse]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -76,7 +80,7 @@ async def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Union[_models.GroupQuotaSubscriptionId, _models.LROResponse]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_create_or_update_request( management_group_id=management_group_id, @@ -86,10 +90,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -97,14 +101,15 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) - if response.status_code == 201: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -112,7 +117,7 @@ async def _create_or_update_initial( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("LROResponse", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -159,10 +164,11 @@ async def begin_create_or_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) + deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -188,8 +194,8 @@ def get_long_running_output(pipeline_response): async def _update_initial( self, management_group_id: str, group_quota_name: str, **kwargs: Any - ) -> Optional[_models.GroupQuotaSubscriptionId]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +207,7 @@ async def _update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.GroupQuotaSubscriptionId]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_update_request( management_group_id=management_group_id, @@ -211,10 +217,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -222,15 +228,15 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) - if response.status_code == 202: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -238,6 +244,8 @@ async def _update_initial( "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -281,10 +289,11 @@ async def begin_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) + deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -308,10 +317,10 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( # pylint: disable=inconsistent-return-statements + async def _delete_initial( self, management_group_id: str, group_quota_name: str, **kwargs: Any - ) -> None: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +332,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( management_group_id=management_group_id, @@ -333,10 +342,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -344,6 +353,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -356,8 +369,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def begin_delete( @@ -386,7 +403,7 @@ async def begin_delete( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_initial( # type: ignore + raw_result = await self._delete_initial( management_group_id=management_group_id, group_quota_name=group_quota_name, api_version=api_version, @@ -395,6 +412,7 @@ async def begin_delete( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements @@ -437,7 +455,7 @@ async def get( :rtype: ~azure.mgmt.quota.models.GroupQuotaSubscriptionId :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +477,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -474,7 +491,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) + deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -506,7 +523,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GroupQuotaSubscriptionIdList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -524,7 +541,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -540,7 +556,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_usages_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_usages_operations.py deleted file mode 100644 index 07665a95fc0e..000000000000 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quota_usages_operations.py +++ /dev/null @@ -1,147 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._group_quota_usages_operations import build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GroupQuotaUsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.quota.aio.QuotaMgmtClient`'s - :attr:`group_quota_usages` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, management_group_id: str, group_quota_name: str, resource_provider_name: str, location: str, **kwargs: Any - ) -> AsyncIterable["_models.ResourceUsages"]: - """Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - - Gets the GroupQuotas usages and limits(quota). Location is required paramter. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either ResourceUsages or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.ResourceUsages] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ResourceUsageList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ResourceUsageList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quotas_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quotas_operations.py index b3e39f24093c..6925bacce3c5 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quotas_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_group_quotas_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -17,12 +17,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict @@ -30,7 +31,6 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request from ...operations._group_quotas_operations import ( build_create_or_update_request, build_delete_request, @@ -39,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,8 +72,8 @@ async def _create_or_update_initial( group_quota_name: str, group_quota_put_request_body: Optional[Union[_models.GroupQuotasEntity, IO[bytes]]] = None, **kwargs: Any - ) -> Union[_models.GroupQuotasEntity, _models.LROResponse]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -82,7 +86,7 @@ async def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Union[_models.GroupQuotasEntity, _models.LROResponse]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -105,10 +109,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -116,14 +120,15 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) - if response.status_code == 201: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -131,7 +136,7 @@ async def _create_or_update_initial( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("LROResponse", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -265,10 +270,11 @@ async def begin_create_or_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) + deserialized = self._deserialize("GroupQuotasEntity", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -298,8 +304,8 @@ async def _update_initial( group_quota_name: str, group_quotas_patch_request_body: Optional[Union[_models.GroupQuotasEntityPatch, IO[bytes]]] = None, **kwargs: Any - ) -> Optional[_models.GroupQuotasEntity]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +318,7 @@ async def _update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.GroupQuotasEntity]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -335,10 +341,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -346,15 +352,15 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) - if response.status_code == 202: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -362,6 +368,8 @@ async def _update_initial( "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -498,10 +506,11 @@ async def begin_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) + deserialized = self._deserialize("GroupQuotasEntity", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -541,7 +550,7 @@ async def get(self, management_group_id: str, group_quota_name: str, **kwargs: A :rtype: ~azure.mgmt.quota.models.GroupQuotasEntity :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -562,7 +571,6 @@ async def get(self, management_group_id: str, group_quota_name: str, **kwargs: A headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -577,17 +585,17 @@ async def get(self, management_group_id: str, group_quota_name: str, **kwargs: A error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) + deserialized = self._deserialize("GroupQuotasEntity", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _delete_initial( # pylint: disable=inconsistent-return-statements + async def _delete_initial( self, management_group_id: str, group_quota_name: str, **kwargs: Any - ) -> None: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -599,7 +607,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( management_group_id=management_group_id, @@ -608,10 +616,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -619,6 +627,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -631,8 +643,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def begin_delete( @@ -661,7 +677,7 @@ async def begin_delete( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_initial( # type: ignore + raw_result = await self._delete_initial( management_group_id=management_group_id, group_quota_name=group_quota_name, api_version=api_version, @@ -670,6 +686,7 @@ async def begin_delete( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements @@ -712,7 +729,7 @@ def list(self, management_group_id: str, **kwargs: Any) -> AsyncIterable["_model api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GroupQuotaList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -729,7 +746,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -745,7 +761,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operation_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operation_operations.py index b0eb60fc342d..158809704a3e 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operation_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operation_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,6 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -19,16 +19,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._quota_operation_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +70,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationResponse"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -84,7 +86,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -100,7 +101,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py index e5467d57f95b..327acb131fc2 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -17,12 +17,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict @@ -30,7 +31,6 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request from ...operations._quota_operations import ( build_create_or_update_request, build_get_request, @@ -38,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,6 +67,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQuotaLimitBase: + # pylint: disable=line-too-long """Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request. @@ -76,14 +81,14 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: CurrentQuotaLimitBase or the result of cls(response) :rtype: ~azure.mgmt.quota.models.CurrentQuotaLimitBase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -104,7 +109,6 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -122,7 +126,7 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu response_headers = {} response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -135,8 +139,8 @@ async def _create_or_update_initial( scope: str, create_quota_request: Union[_models.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CurrentQuotaLimitBase]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +153,7 @@ async def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CurrentQuotaLimitBase]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -169,10 +173,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -180,13 +184,15 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -203,6 +209,7 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Create or update the quota limit for the specified resource with the requested value. To update the quota, follow these steps: @@ -224,8 +231,8 @@ async def begin_create_or_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota request payload. Required. :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase @@ -248,6 +255,7 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Create or update the quota limit for the specified resource with the requested value. To update the quota, follow these steps: @@ -269,8 +277,8 @@ async def begin_create_or_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota request payload. Required. :type create_quota_request: IO[bytes] @@ -291,6 +299,7 @@ async def begin_create_or_update( create_quota_request: Union[_models.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Create or update the quota limit for the specified resource with the requested value. To update the quota, follow these steps: @@ -312,8 +321,8 @@ async def begin_create_or_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota request payload. Is either a CurrentQuotaLimitBase type or a IO[bytes] type. Required. @@ -344,10 +353,11 @@ async def begin_create_or_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -378,8 +388,8 @@ async def _update_initial( scope: str, create_quota_request: Union[_models.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CurrentQuotaLimitBase]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -392,7 +402,7 @@ async def _update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CurrentQuotaLimitBase]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -412,10 +422,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -423,13 +433,15 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -446,6 +458,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Update the quota limit for a specific resource to the specified value: @@ -466,8 +479,8 @@ async def begin_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota requests payload. Required. :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase @@ -490,6 +503,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Update the quota limit for a specific resource to the specified value: @@ -510,8 +524,8 @@ async def begin_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota requests payload. Required. :type create_quota_request: IO[bytes] @@ -532,6 +546,7 @@ async def begin_update( create_quota_request: Union[_models.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Update the quota limit for a specific resource to the specified value: @@ -552,8 +567,8 @@ async def begin_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota requests payload. Is either a CurrentQuotaLimitBase type or a IO[bytes] type. Required. @@ -584,10 +599,11 @@ async def begin_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -614,14 +630,15 @@ def get_long_running_output(pipeline_response): @distributed_trace def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.CurrentQuotaLimitBase"]: + # pylint: disable=line-too-long """Get a list of current quota limits of all resources for the specified scope. The response from this GET operation can be leveraged to submit requests to update a quota. :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: An iterator like instance of either CurrentQuotaLimitBase or the result of cls(response) @@ -634,7 +651,7 @@ def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.CurrentQuota api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.QuotaLimits] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -651,7 +668,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -667,7 +683,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py index 61ea64967466..b9d7169a37f2 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,6 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -19,17 +19,19 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._quota_request_status_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -55,6 +57,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails: + # pylint: disable=line-too-long """Get the quota request details and status by quota request ID for the resources of the resource provider at a specific location. The quota request ID **id** is returned in the response of the PUT operation. @@ -64,14 +67,14 @@ async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestD :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: QuotaRequestDetails or the result of cls(response) :rtype: ~azure.mgmt.quota.models.QuotaRequestDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -92,7 +95,6 @@ async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestD headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -107,7 +109,7 @@ async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestD error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("QuotaRequestDetails", pipeline_response) + deserialized = self._deserialize("QuotaRequestDetails", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -123,14 +125,15 @@ def list( skiptoken: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.QuotaRequestDetails"]: + # pylint: disable=line-too-long """For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the **oData** filter to select quota requests. :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param filter: .. list-table:: :header-rows: 1 @@ -161,7 +164,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.QuotaRequestDetailsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -181,7 +184,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -197,7 +199,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py index dbc4f0050f1e..dd52b0779414 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,6 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -19,17 +19,19 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._usages_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -55,6 +57,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentUsagesBase: + # pylint: disable=line-too-long """Get the current usage of a resource. :param resource_name: Resource name for a given resource provider. For example: @@ -67,14 +70,14 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: CurrentUsagesBase or the result of cls(response) :rtype: ~azure.mgmt.quota.models.CurrentUsagesBase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -95,7 +98,6 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -113,7 +115,7 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu response_headers = {} response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - deserialized = self._deserialize("CurrentUsagesBase", pipeline_response) + deserialized = self._deserialize("CurrentUsagesBase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -122,13 +124,14 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu @distributed_trace def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.CurrentUsagesBase"]: + # pylint: disable=line-too-long """Get a list of current usage for all resources for the scope specified. :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: An iterator like instance of either CurrentUsagesBase or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.CurrentUsagesBase] @@ -140,7 +143,7 @@ def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.CurrentUsage api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UsagesLimits] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +160,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -173,7 +175,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py index e4f5c2ec6969..76744306190b 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py @@ -5,111 +5,115 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import AdditionalAttributes -from ._models_py3 import AdditionalAttributesPatch -from ._models_py3 import AllocatedQuotaToSubscriptionList -from ._models_py3 import AllocatedToSubscription -from ._models_py3 import BillingAccountId -from ._models_py3 import CommonResourceProperties -from ._models_py3 import CreateGenericQuotaRequestParameters -from ._models_py3 import CurrentQuotaLimitBase -from ._models_py3 import CurrentUsagesBase -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import ExceptionResponse -from ._models_py3 import GroupQuotaDetails -from ._models_py3 import GroupQuotaDetailsName -from ._models_py3 import GroupQuotaLimit -from ._models_py3 import GroupQuotaLimitList -from ._models_py3 import GroupQuotaList -from ._models_py3 import GroupQuotaRequestBase -from ._models_py3 import GroupQuotaRequestBaseProperties -from ._models_py3 import GroupQuotaRequestBasePropertiesName -from ._models_py3 import GroupQuotaSubscriptionId -from ._models_py3 import GroupQuotaSubscriptionIdList -from ._models_py3 import GroupQuotaSubscriptionIdProperties -from ._models_py3 import GroupQuotaSubscriptionRequestStatus -from ._models_py3 import GroupQuotaSubscriptionRequestStatusList -from ._models_py3 import GroupQuotaSubscriptionRequestStatusProperties -from ._models_py3 import GroupQuotaUsagesBase -from ._models_py3 import GroupQuotaUsagesBaseName -from ._models_py3 import GroupQuotasEnforcementListResponse -from ._models_py3 import GroupQuotasEnforcementResponse -from ._models_py3 import GroupQuotasEnforcementResponseProperties -from ._models_py3 import GroupQuotasEntity -from ._models_py3 import GroupQuotasEntityBase -from ._models_py3 import GroupQuotasEntityBasePatch -from ._models_py3 import GroupQuotasEntityPatch -from ._models_py3 import GroupingId -from ._models_py3 import LROResponse -from ._models_py3 import LROResponseProperties -from ._models_py3 import LimitJsonObject -from ._models_py3 import LimitObject -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationList -from ._models_py3 import OperationResponse -from ._models_py3 import ProxyResource -from ._models_py3 import QuotaAllocationRequestBase -from ._models_py3 import QuotaAllocationRequestBaseProperties -from ._models_py3 import QuotaAllocationRequestBasePropertiesName -from ._models_py3 import QuotaAllocationRequestStatus -from ._models_py3 import QuotaAllocationRequestStatusList -from ._models_py3 import QuotaAllocationRequestStatusProperties -from ._models_py3 import QuotaLimits -from ._models_py3 import QuotaLimitsResponse -from ._models_py3 import QuotaProperties -from ._models_py3 import QuotaRequestDetails -from ._models_py3 import QuotaRequestDetailsList -from ._models_py3 import QuotaRequestOneResourceProperties -from ._models_py3 import QuotaRequestOneResourceSubmitResponse -from ._models_py3 import QuotaRequestProperties -from ._models_py3 import QuotaRequestStatusDetails -from ._models_py3 import QuotaRequestSubmitResponse -from ._models_py3 import QuotaRequestSubmitResponse202 -from ._models_py3 import Resource -from ._models_py3 import ResourceBaseRequest -from ._models_py3 import ResourceName -from ._models_py3 import ResourceUsageList -from ._models_py3 import ResourceUsages -from ._models_py3 import ServiceError -from ._models_py3 import ServiceErrorDetail -from ._models_py3 import SubRequest -from ._models_py3 import SubmittedResourceRequestStatus -from ._models_py3 import SubmittedResourceRequestStatusList -from ._models_py3 import SubmittedResourceRequestStatusProperties -from ._models_py3 import SubscriptionGroupQuotaAssignment -from ._models_py3 import SubscriptionQuotaAllocationRequestList -from ._models_py3 import SubscriptionQuotaAllocations -from ._models_py3 import SubscriptionQuotaAllocationsList -from ._models_py3 import SubscriptionQuotaAllocationsStatusList -from ._models_py3 import SubscriptionQuotaDetails -from ._models_py3 import SubscriptionQuotaDetailsName -from ._models_py3 import SystemData -from ._models_py3 import UsagesLimits -from ._models_py3 import UsagesObject -from ._models_py3 import UsagesProperties +from typing import TYPE_CHECKING -from ._quota_mgmt_client_enums import CreatedByType -from ._quota_mgmt_client_enums import EnforcementState -from ._quota_mgmt_client_enums import EnvironmentType -from ._quota_mgmt_client_enums import GroupingIdType -from ._quota_mgmt_client_enums import LimitType -from ._quota_mgmt_client_enums import QuotaLimitTypes -from ._quota_mgmt_client_enums import QuotaRequestState -from ._quota_mgmt_client_enums import RequestState -from ._quota_mgmt_client_enums import UsagesTypes +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models_py3 import ( # type: ignore + AllocatedQuotaToSubscriptionList, + AllocatedToSubscription, + CommonResourceProperties, + CreateGenericQuotaRequestParameters, + CurrentQuotaLimitBase, + CurrentUsagesBase, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + ExceptionResponse, + GroupQuotaDetails, + GroupQuotaDetailsName, + GroupQuotaLimit, + GroupQuotaLimitList, + GroupQuotaLimitListProperties, + GroupQuotaLimitProperties, + GroupQuotaList, + GroupQuotaRequestBase, + GroupQuotaRequestBaseProperties, + GroupQuotaRequestBasePropertiesName, + GroupQuotaSubscriptionId, + GroupQuotaSubscriptionIdList, + GroupQuotaSubscriptionIdProperties, + GroupQuotaSubscriptionRequestStatus, + GroupQuotaSubscriptionRequestStatusList, + GroupQuotaSubscriptionRequestStatusProperties, + GroupQuotaUsagesBase, + GroupQuotaUsagesBaseName, + GroupQuotasEntity, + GroupQuotasEntityBase, + GroupQuotasEntityBasePatch, + GroupQuotasEntityPatch, + GroupQuotasEntityPatchProperties, + GroupQuotasEntityProperties, + LROResponse, + LROResponseProperties, + LimitJsonObject, + LimitObject, + OperationDisplay, + OperationList, + OperationResponse, + ProxyResource, + QuotaAllocationRequestBase, + QuotaAllocationRequestBaseProperties, + QuotaAllocationRequestBasePropertiesName, + QuotaAllocationRequestStatus, + QuotaAllocationRequestStatusList, + QuotaAllocationRequestStatusProperties, + QuotaLimits, + QuotaLimitsResponse, + QuotaProperties, + QuotaRequestDetails, + QuotaRequestDetailsList, + QuotaRequestOneResourceProperties, + QuotaRequestOneResourceSubmitResponse, + QuotaRequestProperties, + QuotaRequestStatusDetails, + QuotaRequestSubmitResponse, + QuotaRequestSubmitResponse202, + Resource, + ResourceBaseRequest, + ResourceName, + ResourceUsageList, + ResourceUsages, + ServiceError, + ServiceErrorDetail, + SubRequest, + SubmittedResourceRequestStatus, + SubmittedResourceRequestStatusList, + SubmittedResourceRequestStatusProperties, + SubscriptionGroupQuotaAssignment, + SubscriptionQuotaAllocationRequestList, + SubscriptionQuotaAllocations, + SubscriptionQuotaAllocationsList, + SubscriptionQuotaAllocationsListProperties, + SubscriptionQuotaAllocationsProperties, + SubscriptionQuotaAllocationsStatusList, + SubscriptionQuotaDetails, + SubscriptionQuotaDetailsName, + SystemData, + UsagesLimits, + UsagesObject, + UsagesProperties, +) + +from ._quota_mgmt_client_enums import ( # type: ignore + CreatedByType, + LimitType, + QuotaLimitTypes, + QuotaRequestState, + RequestState, + UsagesTypes, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "AdditionalAttributes", - "AdditionalAttributesPatch", "AllocatedQuotaToSubscriptionList", "AllocatedToSubscription", - "BillingAccountId", "CommonResourceProperties", "CreateGenericQuotaRequestParameters", "CurrentQuotaLimitBase", @@ -122,6 +126,8 @@ "GroupQuotaDetailsName", "GroupQuotaLimit", "GroupQuotaLimitList", + "GroupQuotaLimitListProperties", + "GroupQuotaLimitProperties", "GroupQuotaList", "GroupQuotaRequestBase", "GroupQuotaRequestBaseProperties", @@ -134,14 +140,12 @@ "GroupQuotaSubscriptionRequestStatusProperties", "GroupQuotaUsagesBase", "GroupQuotaUsagesBaseName", - "GroupQuotasEnforcementListResponse", - "GroupQuotasEnforcementResponse", - "GroupQuotasEnforcementResponseProperties", "GroupQuotasEntity", "GroupQuotasEntityBase", "GroupQuotasEntityBasePatch", "GroupQuotasEntityPatch", - "GroupingId", + "GroupQuotasEntityPatchProperties", + "GroupQuotasEntityProperties", "LROResponse", "LROResponseProperties", "LimitJsonObject", @@ -182,6 +186,8 @@ "SubscriptionQuotaAllocationRequestList", "SubscriptionQuotaAllocations", "SubscriptionQuotaAllocationsList", + "SubscriptionQuotaAllocationsListProperties", + "SubscriptionQuotaAllocationsProperties", "SubscriptionQuotaAllocationsStatusList", "SubscriptionQuotaDetails", "SubscriptionQuotaDetailsName", @@ -190,14 +196,11 @@ "UsagesObject", "UsagesProperties", "CreatedByType", - "EnforcementState", - "EnvironmentType", - "GroupingIdType", "LimitType", "QuotaLimitTypes", "QuotaRequestState", "RequestState", "UsagesTypes", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py index e5ba7140afe0..e8a6f41044c5 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py @@ -1,5 +1,5 @@ -# coding=utf-8 # pylint: disable=too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -16,90 +16,13 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -class AdditionalAttributes(_serialization.Model): - """Additional attribute or filter to allow subscriptions meeting the requirements to be part of - the GroupQuota. - - All required parameters must be populated in order to send to server. - - :ivar group_id: The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if - applicable. Required. - :vartype group_id: ~azure.mgmt.quota.models.GroupingId - :ivar environment: Environment name. Known values are: "NonProduction" and "Production". - :vartype environment: str or ~azure.mgmt.quota.models.EnvironmentType - """ - - _validation = { - "group_id": {"required": True}, - } - - _attribute_map = { - "group_id": {"key": "groupId", "type": "GroupingId"}, - "environment": {"key": "environment", "type": "str"}, - } - - def __init__( - self, - *, - group_id: "_models.GroupingId", - environment: Optional[Union[str, "_models.EnvironmentType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword group_id: The grouping Id for the group quota. It can be Billing Id or ServiceTreeId - if applicable. Required. - :paramtype group_id: ~azure.mgmt.quota.models.GroupingId - :keyword environment: Environment name. Known values are: "NonProduction" and "Production". - :paramtype environment: str or ~azure.mgmt.quota.models.EnvironmentType - """ - super().__init__(**kwargs) - self.group_id = group_id - self.environment = environment - - -class AdditionalAttributesPatch(_serialization.Model): - """Additional attribute or filter to allow subscriptions meeting the requirements to be part of - the GroupQuota. - - :ivar group_id: The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if - applicable. - :vartype group_id: ~azure.mgmt.quota.models.GroupingId - :ivar environment: Environment name. Known values are: "NonProduction" and "Production". - :vartype environment: str or ~azure.mgmt.quota.models.EnvironmentType - """ - - _attribute_map = { - "group_id": {"key": "groupId", "type": "GroupingId"}, - "environment": {"key": "environment", "type": "str"}, - } - - def __init__( - self, - *, - group_id: Optional["_models.GroupingId"] = None, - environment: Optional[Union[str, "_models.EnvironmentType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword group_id: The grouping Id for the group quota. It can be Billing Id or ServiceTreeId - if applicable. - :paramtype group_id: ~azure.mgmt.quota.models.GroupingId - :keyword environment: Environment name. Known values are: "NonProduction" and "Production". - :paramtype environment: str or ~azure.mgmt.quota.models.EnvironmentType - """ - super().__init__(**kwargs) - self.group_id = group_id - self.environment = environment - - class AllocatedQuotaToSubscriptionList(_serialization.Model): """Quota allocated to subscriptions. @@ -150,26 +73,6 @@ def __init__( self.quota_allocated = quota_allocated -class BillingAccountId(_serialization.Model): - """A Billing Account Id. - - :ivar id: - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - class CommonResourceProperties(_serialization.Model): """Resource properties. @@ -417,57 +320,23 @@ def __init__(self, *, error: Optional["_models.ServiceError"] = None, **kwargs: self.error = error -class GroupingId(_serialization.Model): - """The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if applicable. - - :ivar grouping_id_type: GroupingId type. It is a required property. More types of groupIds can - be supported in future. Known values are: "ServiceTreeId" and "BillingId". - :vartype grouping_id_type: str or ~azure.mgmt.quota.models.GroupingIdType - :ivar value: GroupId value based on the groupingType selected - Billing Id or ServiceTreeId. - :vartype value: str - """ - - _attribute_map = { - "grouping_id_type": {"key": "groupingIdType", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__( - self, - *, - grouping_id_type: Optional[Union[str, "_models.GroupingIdType"]] = None, - value: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword grouping_id_type: GroupingId type. It is a required property. More types of groupIds - can be supported in future. Known values are: "ServiceTreeId" and "BillingId". - :paramtype grouping_id_type: str or ~azure.mgmt.quota.models.GroupingIdType - :keyword value: GroupId value based on the groupingType selected - Billing Id or ServiceTreeId. - :paramtype value: str - """ - super().__init__(**kwargs) - self.grouping_id_type = grouping_id_type - self.value = value - - class GroupQuotaDetails(_serialization.Model): """Group Quota details. Variables are only populated by the server, and will be ignored when sending a request. - :ivar region: Location/Azure region for the quota requested for resource. - :vartype region: str + :ivar resource_name: The resource name, such as SKU name. + :vartype resource_name: str :ivar limit: The current Group Quota Limit at the parentId level. :vartype limit: int :ivar comment: Any comment related to quota request. :vartype comment: str - :ivar name: Name of the resource provided by the resource provider. This property is already - included in the request URI, so it is a readonly property returned in the response. - :vartype name: ~azure.mgmt.quota.models.GroupQuotaDetailsName :ivar unit: The usages units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET response in the request body of your PUT operation. :vartype unit: str + :ivar name: Name of the resource provided by the resource provider. This property is already + included in the request URI, so it is a readonly property returned in the response. + :vartype name: ~azure.mgmt.quota.models.GroupQuotaDetailsName :ivar available_limit: The available Group Quota Limit at the MG level. This Group quota can be allocated to subscription(s). :vartype available_limit: int @@ -476,39 +345,44 @@ class GroupQuotaDetails(_serialization.Model): """ _validation = { - "name": {"readonly": True}, "unit": {"readonly": True}, + "name": {"readonly": True}, "available_limit": {"readonly": True}, "allocated_to_subscriptions": {"readonly": True}, } _attribute_map = { - "region": {"key": "region", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, "limit": {"key": "limit", "type": "int"}, "comment": {"key": "comment", "type": "str"}, - "name": {"key": "name", "type": "GroupQuotaDetailsName"}, "unit": {"key": "unit", "type": "str"}, + "name": {"key": "name", "type": "GroupQuotaDetailsName"}, "available_limit": {"key": "availableLimit", "type": "int"}, "allocated_to_subscriptions": {"key": "allocatedToSubscriptions", "type": "AllocatedQuotaToSubscriptionList"}, } def __init__( - self, *, region: Optional[str] = None, limit: Optional[int] = None, comment: Optional[str] = None, **kwargs: Any + self, + *, + resource_name: Optional[str] = None, + limit: Optional[int] = None, + comment: Optional[str] = None, + **kwargs: Any ) -> None: """ - :keyword region: Location/Azure region for the quota requested for resource. - :paramtype region: str + :keyword resource_name: The resource name, such as SKU name. + :paramtype resource_name: str :keyword limit: The current Group Quota Limit at the parentId level. :paramtype limit: int :keyword comment: Any comment related to quota request. :paramtype comment: str """ super().__init__(**kwargs) - self.region = region + self.resource_name = resource_name self.limit = limit self.comment = comment - self.name = None self.unit = None + self.name = None self.available_limit = None self.allocated_to_subscriptions = None @@ -542,6 +416,26 @@ def __init__(self, **kwargs: Any) -> None: self.localized_value = None +class GroupQuotaLimit(_serialization.Model): + """Group Quota limit. + + :ivar properties: Group Quota properties for the specified resource. + :vartype properties: ~azure.mgmt.quota.models.GroupQuotaLimitProperties + """ + + _attribute_map = { + "properties": {"key": "properties", "type": "GroupQuotaLimitProperties"}, + } + + def __init__(self, *, properties: Optional["_models.GroupQuotaLimitProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Group Quota properties for the specified resource. + :paramtype properties: ~azure.mgmt.quota.models.GroupQuotaLimitProperties + """ + super().__init__(**kwargs) + self.properties = properties + + class Resource(_serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. @@ -603,8 +497,8 @@ class ProxyResource(Resource): """ -class GroupQuotaLimit(ProxyResource): - """Group Quota limit. +class GroupQuotaLimitList(ProxyResource): + """List of Group Quota Limit details. Variables are only populated by the server, and will be ignored when sending a request. @@ -619,8 +513,8 @@ class GroupQuotaLimit(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.quota.models.SystemData - :ivar properties: Group Quota properties for the specified resource. - :vartype properties: ~azure.mgmt.quota.models.GroupQuotaDetails + :ivar properties: + :vartype properties: ~azure.mgmt.quota.models.GroupQuotaLimitListProperties """ _validation = { @@ -635,23 +529,26 @@ class GroupQuotaLimit(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "GroupQuotaDetails"}, + "properties": {"key": "properties", "type": "GroupQuotaLimitListProperties"}, } - def __init__(self, *, properties: Optional["_models.GroupQuotaDetails"] = None, **kwargs: Any) -> None: + def __init__(self, *, properties: Optional["_models.GroupQuotaLimitListProperties"] = None, **kwargs: Any) -> None: """ - :keyword properties: Group Quota properties for the specified resource. - :paramtype properties: ~azure.mgmt.quota.models.GroupQuotaDetails + :keyword properties: + :paramtype properties: ~azure.mgmt.quota.models.GroupQuotaLimitListProperties """ super().__init__(**kwargs) self.properties = properties -class GroupQuotaLimitList(_serialization.Model): - """List of Group Quota Limit details. +class GroupQuotaLimitListProperties(_serialization.Model): + """GroupQuotaLimitListProperties. Variables are only populated by the server, and will be ignored when sending a request. + :ivar provisioning_state: Request status. Known values are: "Accepted", "Created", "Invalid", + "Succeeded", "Failed", "InProgress", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.RequestState :ivar value: List of Group Quota Limit details. :vartype value: list[~azure.mgmt.quota.models.GroupQuotaLimit] :ivar next_link: The URL to use for getting the next set of results. @@ -659,10 +556,12 @@ class GroupQuotaLimitList(_serialization.Model): """ _validation = { + "provisioning_state": {"readonly": True}, "next_link": {"readonly": True}, } _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, "value": {"key": "value", "type": "[GroupQuotaLimit]"}, "next_link": {"key": "nextLink", "type": "str"}, } @@ -673,10 +572,36 @@ def __init__(self, *, value: Optional[List["_models.GroupQuotaLimit"]] = None, * :paramtype value: list[~azure.mgmt.quota.models.GroupQuotaLimit] """ super().__init__(**kwargs) + self.provisioning_state = None self.value = value self.next_link = None +class GroupQuotaLimitProperties(GroupQuotaDetails): + """Group Quota properties for the specified resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_name: The resource name, such as SKU name. + :vartype resource_name: str + :ivar limit: The current Group Quota Limit at the parentId level. + :vartype limit: int + :ivar comment: Any comment related to quota request. + :vartype comment: str + :ivar unit: The usages units, such as Count and Bytes. When requesting quota, use the **unit** + value returned in the GET response in the request body of your PUT operation. + :vartype unit: str + :ivar name: Name of the resource provided by the resource provider. This property is already + included in the request URI, so it is a readonly property returned in the response. + :vartype name: ~azure.mgmt.quota.models.GroupQuotaDetailsName + :ivar available_limit: The available Group Quota Limit at the MG level. This Group quota can be + allocated to subscription(s). + :vartype available_limit: int + :ivar allocated_to_subscriptions: Quota allocated to subscriptions. + :vartype allocated_to_subscriptions: ~azure.mgmt.quota.models.AllocatedQuotaToSubscriptionList + """ + + class GroupQuotaList(_serialization.Model): """List of Group Quotas at MG level. @@ -812,124 +737,6 @@ def __init__(self, **kwargs: Any) -> None: self.localized_value = None -class GroupQuotasEnforcementListResponse(_serialization.Model): - """List of Azure regions, where the group quotas is enabled for enforcement. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Azure Regions. - :vartype value: list[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - :ivar next_link: The URL to use for getting the next set of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GroupQuotasEnforcementResponse]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.GroupQuotasEnforcementResponse"]] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of Azure Regions. - :paramtype value: list[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class GroupQuotasEnforcementResponse(ProxyResource): - """The GroupQuota Enforcement status for a Azure Location/Region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.quota.models.SystemData - :ivar properties: - :vartype properties: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponseProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "GroupQuotasEnforcementResponseProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.GroupQuotasEnforcementResponseProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponseProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class GroupQuotasEnforcementResponseProperties(_serialization.Model): - """GroupQuotasEnforcementResponseProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar enforcement_enabled: Is the GroupQuota Enforcement enabled for the Azure region. Known - values are: "Enabled", "Disabled", and "NotAvailable". - :vartype enforcement_enabled: str or ~azure.mgmt.quota.models.EnforcementState - :ivar provisioning_state: Request status. Known values are: "Accepted", "Created", "Invalid", - "Succeeded", "Failed", "InProgress", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.quota.models.RequestState - :ivar fault_code: Details of the failure. - :vartype fault_code: str - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "fault_code": {"readonly": True}, - } - - _attribute_map = { - "enforcement_enabled": {"key": "enforcementEnabled", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "fault_code": {"key": "faultCode", "type": "str"}, - } - - def __init__( - self, *, enforcement_enabled: Optional[Union[str, "_models.EnforcementState"]] = None, **kwargs: Any - ) -> None: - """ - :keyword enforcement_enabled: Is the GroupQuota Enforcement enabled for the Azure region. Known - values are: "Enabled", "Disabled", and "NotAvailable". - :paramtype enforcement_enabled: str or ~azure.mgmt.quota.models.EnforcementState - """ - super().__init__(**kwargs) - self.enforcement_enabled = enforcement_enabled - self.provisioning_state = None - self.fault_code = None - - class GroupQuotasEntity(ProxyResource): """Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. @@ -947,9 +754,8 @@ class GroupQuotasEntity(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.quota.models.SystemData - :ivar properties: Properties and filters for ShareQuota. The request parameter is optional, if - there are no filters specified. - :vartype properties: ~azure.mgmt.quota.models.GroupQuotasEntityBase + :ivar properties: Properties. + :vartype properties: ~azure.mgmt.quota.models.GroupQuotasEntityProperties """ _validation = { @@ -964,14 +770,13 @@ class GroupQuotasEntity(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "GroupQuotasEntityBase"}, + "properties": {"key": "properties", "type": "GroupQuotasEntityProperties"}, } - def __init__(self, *, properties: Optional["_models.GroupQuotasEntityBase"] = None, **kwargs: Any) -> None: + def __init__(self, *, properties: Optional["_models.GroupQuotasEntityProperties"] = None, **kwargs: Any) -> None: """ - :keyword properties: Properties and filters for ShareQuota. The request parameter is optional, - if there are no filters specified. - :paramtype properties: ~azure.mgmt.quota.models.GroupQuotasEntityBase + :keyword properties: Properties. + :paramtype properties: ~azure.mgmt.quota.models.GroupQuotasEntityProperties """ super().__init__(**kwargs) self.properties = properties @@ -985,9 +790,6 @@ class GroupQuotasEntityBase(_serialization.Model): :ivar display_name: Display name of the GroupQuota entity. :vartype display_name: str - :ivar additional_attributes: Additional attributes to filter/restrict the subscriptions, which - can be added to the subscriptionIds. - :vartype additional_attributes: ~azure.mgmt.quota.models.AdditionalAttributes :ivar provisioning_state: Provisioning state of the operation. Known values are: "Accepted", "Created", "Invalid", "Succeeded", "Failed", "InProgress", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.quota.models.RequestState @@ -999,27 +801,16 @@ class GroupQuotasEntityBase(_serialization.Model): _attribute_map = { "display_name": {"key": "displayName", "type": "str"}, - "additional_attributes": {"key": "additionalAttributes", "type": "AdditionalAttributes"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - *, - display_name: Optional[str] = None, - additional_attributes: Optional["_models.AdditionalAttributes"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, display_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword display_name: Display name of the GroupQuota entity. :paramtype display_name: str - :keyword additional_attributes: Additional attributes to filter/restrict the subscriptions, - which can be added to the subscriptionIds. - :paramtype additional_attributes: ~azure.mgmt.quota.models.AdditionalAttributes """ super().__init__(**kwargs) self.display_name = display_name - self.additional_attributes = additional_attributes self.provisioning_state = None @@ -1031,9 +822,6 @@ class GroupQuotasEntityBasePatch(_serialization.Model): :ivar display_name: Display name of the GroupQuota entity. :vartype display_name: str - :ivar additional_attributes: Additional attributes to filter/restrict the subscriptions, which - can be added to the subscriptionIds. - :vartype additional_attributes: ~azure.mgmt.quota.models.AdditionalAttributesPatch :ivar provisioning_state: Provisioning state of the operation. Known values are: "Accepted", "Created", "Invalid", "Succeeded", "Failed", "InProgress", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.quota.models.RequestState @@ -1045,27 +833,16 @@ class GroupQuotasEntityBasePatch(_serialization.Model): _attribute_map = { "display_name": {"key": "displayName", "type": "str"}, - "additional_attributes": {"key": "additionalAttributes", "type": "AdditionalAttributesPatch"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - *, - display_name: Optional[str] = None, - additional_attributes: Optional["_models.AdditionalAttributesPatch"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, display_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword display_name: Display name of the GroupQuota entity. :paramtype display_name: str - :keyword additional_attributes: Additional attributes to filter/restrict the subscriptions, - which can be added to the subscriptionIds. - :paramtype additional_attributes: ~azure.mgmt.quota.models.AdditionalAttributesPatch """ super().__init__(**kwargs) self.display_name = display_name - self.additional_attributes = additional_attributes self.provisioning_state = None @@ -1086,9 +863,8 @@ class GroupQuotasEntityPatch(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.quota.models.SystemData - :ivar properties: Properties and filters for ShareQuota. The request parameter is optional, if - there are no filters specified. - :vartype properties: ~azure.mgmt.quota.models.GroupQuotasEntityBasePatch + :ivar properties: Properties. + :vartype properties: ~azure.mgmt.quota.models.GroupQuotasEntityPatchProperties """ _validation = { @@ -1103,19 +879,46 @@ class GroupQuotasEntityPatch(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "GroupQuotasEntityBasePatch"}, + "properties": {"key": "properties", "type": "GroupQuotasEntityPatchProperties"}, } - def __init__(self, *, properties: Optional["_models.GroupQuotasEntityBasePatch"] = None, **kwargs: Any) -> None: + def __init__( + self, *, properties: Optional["_models.GroupQuotasEntityPatchProperties"] = None, **kwargs: Any + ) -> None: """ - :keyword properties: Properties and filters for ShareQuota. The request parameter is optional, - if there are no filters specified. - :paramtype properties: ~azure.mgmt.quota.models.GroupQuotasEntityBasePatch + :keyword properties: Properties. + :paramtype properties: ~azure.mgmt.quota.models.GroupQuotasEntityPatchProperties """ super().__init__(**kwargs) self.properties = properties +class GroupQuotasEntityPatchProperties(GroupQuotasEntityBasePatch): + """Properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display name of the GroupQuota entity. + :vartype display_name: str + :ivar provisioning_state: Provisioning state of the operation. Known values are: "Accepted", + "Created", "Invalid", "Succeeded", "Failed", "InProgress", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.RequestState + """ + + +class GroupQuotasEntityProperties(GroupQuotasEntityBase): + """Properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display name of the GroupQuota entity. + :vartype display_name: str + :ivar provisioning_state: Provisioning state of the operation. Known values are: "Accepted", + "Created", "Invalid", "Succeeded", "Failed", "InProgress", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.RequestState + """ + + class GroupQuotaSubscriptionId(ProxyResource): """This represents a Azure subscriptionId that is associated with a GroupQuotasEntity. @@ -1206,7 +1009,6 @@ class GroupQuotaSubscriptionIdProperties(_serialization.Model): """ _validation = { - "subscription_id": {"readonly": True}, "provisioning_state": {"readonly": True}, } @@ -1215,10 +1017,13 @@ class GroupQuotaSubscriptionIdProperties(_serialization.Model): "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, subscription_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword subscription_id: An Azure subscriptionId. + :paramtype subscription_id: str + """ super().__init__(**kwargs) - self.subscription_id = None + self.subscription_id = subscription_id self.provisioning_state = None @@ -1980,7 +1785,7 @@ class QuotaProperties(_serialization.Model): :vartype resource_type: str :ivar quota_period: The time period over which the quota usage values are summarized. For example: - *P1D (per one day)*\ PT1M (per one minute) + *P1D (per one day)*\\ PT1M (per one minute) *PT1S (per one second). This parameter is optional because, for some resources like compute, the period is irrelevant. :vartype quota_period: str @@ -2110,7 +1915,7 @@ def __init__( self.next_link = next_link -class QuotaRequestOneResourceProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes +class QuotaRequestOneResourceProperties(_serialization.Model): """Quota request. Variables are only populated by the server, and will be ignored when sending a request. @@ -2137,7 +1942,7 @@ class QuotaRequestOneResourceProperties(_serialization.Model): # pylint: disabl :vartype resource_type: str :ivar quota_period: The time period over which the quota usage values are summarized. For example: - *P1D (per one day)*\ PT1M (per one minute) + *P1D (per one day)*\\ PT1M (per one minute) *PT1S (per one second). This parameter is optional because, for some resources like compute, the period is irrelevant. :vartype quota_period: str @@ -2333,7 +2138,7 @@ class QuotaRequestStatusDetails(_serialization.Model): :vartype resource_type: str :ivar quota_period: The time period over which the quota usage values are summarized. For example: - *P1D (per one day)*\ PT1M (per one minute) + *P1D (per one day)*\\ PT1M (per one minute) *PT1S (per one second). This parameter is optional because, for some resources like compute, the period is irrelevant. :vartype quota_period: str @@ -2930,11 +2735,33 @@ def __init__(self, *, value: Optional[List["_models.QuotaAllocationRequestStatus self.next_link = None -class SubscriptionQuotaAllocations(ProxyResource): +class SubscriptionQuotaAllocations(_serialization.Model): """Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. + :ivar properties: Quota properties for the specified resource. + :vartype properties: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsProperties + """ + + _attribute_map = { + "properties": {"key": "properties", "type": "SubscriptionQuotaAllocationsProperties"}, + } + + def __init__( + self, *, properties: Optional["_models.SubscriptionQuotaAllocationsProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: Quota properties for the specified resource. + :paramtype properties: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class SubscriptionQuotaAllocationsList(ProxyResource): + """Subscription quota list. + Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. @@ -2948,8 +2775,8 @@ class SubscriptionQuotaAllocations(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.quota.models.SystemData - :ivar properties: Quota properties for the specified resource. - :vartype properties: ~azure.mgmt.quota.models.SubscriptionQuotaDetails + :ivar properties: + :vartype properties: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsListProperties """ _validation = { @@ -2964,23 +2791,28 @@ class SubscriptionQuotaAllocations(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "SubscriptionQuotaDetails"}, + "properties": {"key": "properties", "type": "SubscriptionQuotaAllocationsListProperties"}, } - def __init__(self, *, properties: Optional["_models.SubscriptionQuotaDetails"] = None, **kwargs: Any) -> None: + def __init__( + self, *, properties: Optional["_models.SubscriptionQuotaAllocationsListProperties"] = None, **kwargs: Any + ) -> None: """ - :keyword properties: Quota properties for the specified resource. - :paramtype properties: ~azure.mgmt.quota.models.SubscriptionQuotaDetails + :keyword properties: + :paramtype properties: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsListProperties """ super().__init__(**kwargs) self.properties = properties -class SubscriptionQuotaAllocationsList(_serialization.Model): - """Subscription quota list. +class SubscriptionQuotaAllocationsListProperties(_serialization.Model): # pylint: disable=name-too-long + """SubscriptionQuotaAllocationsListProperties. Variables are only populated by the server, and will be ignored when sending a request. + :ivar provisioning_state: Request status. Known values are: "Accepted", "Created", "Invalid", + "Succeeded", "Failed", "InProgress", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.RequestState :ivar value: Subscription quota list. :vartype value: list[~azure.mgmt.quota.models.SubscriptionQuotaAllocations] :ivar next_link: The URL to use for getting the next set of results. @@ -2988,10 +2820,12 @@ class SubscriptionQuotaAllocationsList(_serialization.Model): """ _validation = { + "provisioning_state": {"readonly": True}, "next_link": {"readonly": True}, } _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, "value": {"key": "value", "type": "[SubscriptionQuotaAllocations]"}, "next_link": {"key": "nextLink", "type": "str"}, } @@ -3002,49 +2836,60 @@ def __init__(self, *, value: Optional[List["_models.SubscriptionQuotaAllocations :paramtype value: list[~azure.mgmt.quota.models.SubscriptionQuotaAllocations] """ super().__init__(**kwargs) + self.provisioning_state = None self.value = value self.next_link = None -class SubscriptionQuotaAllocationsStatusList(_serialization.Model): - """Subscription quota allocation requests status list. +class SubscriptionQuotaDetails(_serialization.Model): + """Subscription Quota details. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: Subscription quota allocation status list. - :vartype value: list[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] - :ivar next_link: The URL to use for getting the next set of results. - :vartype next_link: str + :ivar resource_name: The resource name, such as SKU name. + :vartype resource_name: str + :ivar limit: The total quota limit for the subscription. + :vartype limit: int + :ivar shareable_quota: The shareable quota for the subscription. + :vartype shareable_quota: int + :ivar name: Name of the resource provided by the resource provider. This property is already + included in the request URI, so it is a readonly property returned in the response. + :vartype name: ~azure.mgmt.quota.models.SubscriptionQuotaDetailsName """ _validation = { - "next_link": {"readonly": True}, + "shareable_quota": {"readonly": True}, + "name": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[SubmittedResourceRequestStatus]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + "limit": {"key": "limit", "type": "int"}, + "shareable_quota": {"key": "shareableQuota", "type": "int"}, + "name": {"key": "name", "type": "SubscriptionQuotaDetailsName"}, } - def __init__( - self, *, value: Optional[List["_models.SubmittedResourceRequestStatus"]] = None, **kwargs: Any - ) -> None: + def __init__(self, *, resource_name: Optional[str] = None, limit: Optional[int] = None, **kwargs: Any) -> None: """ - :keyword value: Subscription quota allocation status list. - :paramtype value: list[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] + :keyword resource_name: The resource name, such as SKU name. + :paramtype resource_name: str + :keyword limit: The total quota limit for the subscription. + :paramtype limit: int """ super().__init__(**kwargs) - self.value = value - self.next_link = None + self.resource_name = resource_name + self.limit = limit + self.shareable_quota = None + self.name = None -class SubscriptionQuotaDetails(_serialization.Model): - """Subscription Quota details. +class SubscriptionQuotaAllocationsProperties(SubscriptionQuotaDetails): + """Quota properties for the specified resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar region: Location/Azure region for the quota requested for resource. - :vartype region: str + :ivar resource_name: The resource name, such as SKU name. + :vartype resource_name: str :ivar limit: The total quota limit for the subscription. :vartype limit: int :ivar shareable_quota: The shareable quota for the subscription. @@ -3054,30 +2899,37 @@ class SubscriptionQuotaDetails(_serialization.Model): :vartype name: ~azure.mgmt.quota.models.SubscriptionQuotaDetailsName """ + +class SubscriptionQuotaAllocationsStatusList(_serialization.Model): + """Subscription quota allocation requests status list. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Subscription quota allocation status list. + :vartype value: list[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + _validation = { - "shareable_quota": {"readonly": True}, - "name": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - "region": {"key": "region", "type": "str"}, - "limit": {"key": "limit", "type": "int"}, - "shareable_quota": {"key": "shareableQuota", "type": "int"}, - "name": {"key": "name", "type": "SubscriptionQuotaDetailsName"}, + "value": {"key": "value", "type": "[SubmittedResourceRequestStatus]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, region: Optional[str] = None, limit: Optional[int] = None, **kwargs: Any) -> None: + def __init__( + self, *, value: Optional[List["_models.SubmittedResourceRequestStatus"]] = None, **kwargs: Any + ) -> None: """ - :keyword region: Location/Azure region for the quota requested for resource. - :paramtype region: str - :keyword limit: The total quota limit for the subscription. - :paramtype limit: int + :keyword value: Subscription quota allocation status list. + :paramtype value: list[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] """ super().__init__(**kwargs) - self.region = region - self.limit = limit - self.shareable_quota = None - self.name = None + self.value = value + self.next_link = None class SubscriptionQuotaDetailsName(_serialization.Model): @@ -3259,7 +3111,7 @@ class UsagesProperties(_serialization.Model): :ivar resource_type: The name of the resource type. Optional field. :vartype resource_type: str :ivar quota_period: The time period for the summary of the quota usage values. For example: - *P1D (per one day)*\ PT1M (per one minute) + *P1D (per one day)*\\ PT1M (per one minute) *PT1S (per one second). This parameter is optional because it is not relevant for all resources such as compute. :vartype quota_period: str diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_quota_mgmt_client_enums.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_quota_mgmt_client_enums.py index 089b1b37bedf..1dbc3d00ea7d 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_quota_mgmt_client_enums.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_quota_mgmt_client_enums.py @@ -19,28 +19,6 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KEY = "Key" -class EnforcementState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enforcement status.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - NOT_AVAILABLE = "NotAvailable" - - -class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment name.""" - - NON_PRODUCTION = "NonProduction" - PRODUCTION = "Production" - - -class GroupingIdType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """GroupingId type. It is a required property. More types of groupIds can be supported in future.""" - - SERVICE_TREE_ID = "ServiceTreeId" - BILLING_ID = "BillingId" - - class LimitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The limit object type.""" diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py index 4bec73e40834..7baec1eac569 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py @@ -5,39 +5,41 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._group_quotas_operations import GroupQuotasOperations -from ._group_quota_subscriptions_operations import GroupQuotaSubscriptionsOperations -from ._group_quota_subscription_requests_operations import GroupQuotaSubscriptionRequestsOperations -from ._group_quota_limits_operations import GroupQuotaLimitsOperations -from ._group_quota_limits_request_operations import GroupQuotaLimitsRequestOperations -from ._group_quota_subscription_allocation_operations import GroupQuotaSubscriptionAllocationOperations -from ._group_quota_subscription_allocation_request_operations import GroupQuotaSubscriptionAllocationRequestOperations -from ._group_quota_usages_operations import GroupQuotaUsagesOperations -from ._group_quota_location_settings_operations import GroupQuotaLocationSettingsOperations -from ._usages_operations import UsagesOperations -from ._quota_operations import QuotaOperations -from ._quota_request_status_operations import QuotaRequestStatusOperations -from ._quota_operation_operations import QuotaOperationOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._group_quotas_operations import GroupQuotasOperations # type: ignore +from ._group_quota_subscriptions_operations import GroupQuotaSubscriptionsOperations # type: ignore +from ._group_quota_subscription_requests_operations import GroupQuotaSubscriptionRequestsOperations # type: ignore +from ._group_quota_limits_request_operations import GroupQuotaLimitsRequestOperations # type: ignore +from ._group_quota_limits_operations import GroupQuotaLimitsOperations # type: ignore +from ._group_quota_subscription_allocation_request_operations import GroupQuotaSubscriptionAllocationRequestOperations # type: ignore +from ._group_quota_subscription_allocation_operations import GroupQuotaSubscriptionAllocationOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._quota_operations import QuotaOperations # type: ignore +from ._quota_request_status_operations import QuotaRequestStatusOperations # type: ignore +from ._quota_operation_operations import QuotaOperationOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "GroupQuotasOperations", "GroupQuotaSubscriptionsOperations", "GroupQuotaSubscriptionRequestsOperations", - "GroupQuotaLimitsOperations", "GroupQuotaLimitsRequestOperations", - "GroupQuotaSubscriptionAllocationOperations", + "GroupQuotaLimitsOperations", "GroupQuotaSubscriptionAllocationRequestOperations", - "GroupQuotaUsagesOperations", - "GroupQuotaLocationSettingsOperations", + "GroupQuotaSubscriptionAllocationOperations", "UsagesOperations", "QuotaOperations", "QuotaRequestStatusOperations", "QuotaOperationOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_limits_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_limits_operations.py index fc78bb311bd1..9759d6e9701d 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_limits_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_limits_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +5,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse +import sys +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,18 +16,19 @@ ResourceNotModifiedError, map_error, ) -from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -36,69 +36,19 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - *, - filter: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{resourceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "managementGroupId": _SERIALIZER.url( - "management_group_id", management_group_id, "str", max_length=63, min_length=3 - ), - "groupQuotaName": _SERIALIZER.url( - "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - "resourceProviderName": _SERIALIZER.url( - "resource_provider_name", - resource_provider_name, - "str", - pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}", ) # pylint: disable=line-too-long path_format_arguments = { "managementGroupId": _SERIALIZER.url( @@ -113,13 +63,13 @@ def build_list_request( "str", pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? _models.GroupQuotaLimit: - """Gets the GroupQuotaLimits for the specific resource. + def list( + self, management_group_id: str, group_quota_name: str, resource_provider_name: str, location: str, **kwargs: Any + ) -> _models.GroupQuotaLimitList: + """Gets the GroupQuotaLimits for the specified resource provider and location for resource names + passed in $filter=resourceName eq {SKU}. - Gets the GroupQuotaLimits for the specific resource for a specific resource based on the - resourceProviders, resourceName and $filter passed. - The $filter=location eq {location} is required to location specific resources groupQuota. + Gets the GroupQuotaLimits for the specified resource provider and location for resource names + passed in $filter=resourceName eq {SKU}. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -170,24 +114,13 @@ def get( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: GroupQuotaLimit or the result of cls(response) - :rtype: ~azure.mgmt.quota.models.GroupQuotaLimit + :param location: The name of the Azure region. Required. + :type location: str + :return: GroupQuotaLimitList or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.GroupQuotaLimitList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -199,19 +132,17 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GroupQuotaLimit] = kwargs.pop("cls", None) + cls: ClsType[_models.GroupQuotaLimitList] = kwargs.pop("cls", None) - _request = build_get_request( + _request = build_list_request( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, - filter=filter, + location=location, api_version=api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -226,115 +157,9 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GroupQuotaLimit", pipeline_response) + deserialized = self._deserialize("GroupQuotaLimitList", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list( - self, management_group_id: str, group_quota_name: str, resource_provider_name: str, filter: str, **kwargs: Any - ) -> Iterable["_models.GroupQuotaLimit"]: - """Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location - eq {location}. - - Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter - passed. - The $filter=location eq {location} is required to location specific resources groupQuota. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: An iterator like instance of either GroupQuotaLimit or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.GroupQuotaLimit] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GroupQuotaLimitList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GroupQuotaLimitList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_limits_request_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_limits_request_operations.py index 16dfaa1c381c..959092f4c9c8 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_limits_request_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_limits_request_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -16,13 +16,14 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat @@ -30,8 +31,11 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -39,66 +43,20 @@ _SERIALIZER.client_side_validation = False -def build_create_or_update_request( - management_group_id: str, group_quota_name: str, resource_provider_name: str, resource_name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaRequests/{resourceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "managementGroupId": _SERIALIZER.url( - "management_group_id", management_group_id, "str", max_length=63, min_length=3 - ), - "groupQuotaName": _SERIALIZER.url( - "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - "resourceProviderName": _SERIALIZER.url( - "resource_provider_name", - resource_provider_name, - "str", - pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaRequests/{resourceName}", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}", ) # pylint: disable=line-too-long path_format_arguments = { "managementGroupId": _SERIALIZER.url( @@ -113,9 +71,7 @@ def build_update_request( "str", pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? Union[_models.SubmittedResourceRequestStatus, _models.LROResponse]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Union[_models.SubmittedResourceRequestStatus, _models.LROResponse]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(group_quota_request, (IOBase, bytes)): - _content = group_quota_request - else: - if group_quota_request is not None: - _json = self._serialize.body(group_quota_request, "SubmittedResourceRequestStatus") - else: - _json = None - - _request = build_create_or_update_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - resource_name=resource_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("LROResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[_models.SubmittedResourceRequestStatus] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SubmittedResourceRequestStatus]: - """Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - - Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - resourceName ("name": {"value" : "resourceName") properties are specified in the request body. - Only 1 resource quota can be requested. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SubmittedResourceRequestStatus or An - instance of LROPoller that returns either LROResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] - or ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SubmittedResourceRequestStatus]: - """Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - - Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - resourceName ("name": {"value" : "resourceName") properties are specified in the request body. - Only 1 resource quota can be requested. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Default value is None. - :type group_quota_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SubmittedResourceRequestStatus or An - instance of LROPoller that returns either LROResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] - or ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[Union[_models.SubmittedResourceRequestStatus, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.SubmittedResourceRequestStatus]: - """Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - - Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - resourceName ("name": {"value" : "resourceName") properties are specified in the request body. - Only 1 resource quota can be requested. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Is either a SubmittedResourceRequestStatus type or a - IO[bytes] type. Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus or IO[bytes] - :return: An instance of LROPoller that returns either SubmittedResourceRequestStatus or An - instance of LROPoller that returns either LROResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] - or ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SubmittedResourceRequestStatus] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - resource_name=resource_name, - group_quota_request=group_quota_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SubmittedResourceRequestStatus].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SubmittedResourceRequestStatus]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - def _update_initial( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[Union[_models.SubmittedResourceRequestStatus, IO[bytes]]] = None, + location: str, + group_quota_request: Optional[Union[_models.GroupQuotaLimitList, IO[bytes]]] = None, **kwargs: Any - ) -> Optional[_models.SubmittedResourceRequestStatus]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +204,7 @@ def _update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.SubmittedResourceRequestStatus]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -514,7 +213,7 @@ def _update_initial( _content = group_quota_request else: if group_quota_request is not None: - _json = self._serialize.body(group_quota_request, "SubmittedResourceRequestStatus") + _json = self._serialize.body(group_quota_request, "GroupQuotaLimitList") else: _json = None @@ -522,7 +221,7 @@ def _update_initial( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + location=location, api_version=api_version, content_type=content_type, json=_json, @@ -530,10 +229,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -541,15 +240,15 @@ def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) - if response.status_code == 202: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -557,6 +256,8 @@ def _update_initial( "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -568,16 +269,16 @@ def begin_update( management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[_models.SubmittedResourceRequestStatus] = None, + location: str, + group_quota_request: Optional[_models.GroupQuotaLimitList] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SubmittedResourceRequestStatus]: + ) -> LROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. - Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location - and resourceName properties are specified in the request body. Only 1 resource quota can be + Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The + resourceName properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a new groupQuota request. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals @@ -591,17 +292,17 @@ def begin_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific resourceProvider/location/resources. Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus + :type group_quota_request: ~azure.mgmt.quota.models.GroupQuotaLimitList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either SubmittedResourceRequestStatus or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] + :return: An instance of LROPoller that returns either GroupQuotaLimitList or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotaLimitList] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -611,16 +312,16 @@ def begin_update( management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, + location: str, group_quota_request: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SubmittedResourceRequestStatus]: + ) -> LROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. - Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location - and resourceName properties are specified in the request body. Only 1 resource quota can be + Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The + resourceName properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a new groupQuota request. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals @@ -634,17 +335,17 @@ def begin_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific resourceProvider/location/resources. Default value is None. :type group_quota_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either SubmittedResourceRequestStatus or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] + :return: An instance of LROPoller that returns either GroupQuotaLimitList or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotaLimitList] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -654,14 +355,14 @@ def begin_update( management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - group_quota_request: Optional[Union[_models.SubmittedResourceRequestStatus, IO[bytes]]] = None, + location: str, + group_quota_request: Optional[Union[_models.GroupQuotaLimitList, IO[bytes]]] = None, **kwargs: Any - ) -> LROPoller[_models.SubmittedResourceRequestStatus]: + ) -> LROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. - Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location - and resourceName properties are specified in the request body. Only 1 resource quota can be + Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The + resourceName properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a new groupQuota request. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals @@ -675,15 +376,15 @@ def begin_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Is either a SubmittedResourceRequestStatus type or a - IO[bytes] type. Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus or IO[bytes] - :return: An instance of LROPoller that returns either SubmittedResourceRequestStatus or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.SubmittedResourceRequestStatus] + resourceProvider/location/resources. Is either a GroupQuotaLimitList type or a IO[bytes] type. + Default value is None. + :type group_quota_request: ~azure.mgmt.quota.models.GroupQuotaLimitList or IO[bytes] + :return: An instance of LROPoller that returns either GroupQuotaLimitList or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotaLimitList] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -691,7 +392,7 @@ def begin_update( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SubmittedResourceRequestStatus] = kwargs.pop("cls", None) + cls: ClsType[_models.GroupQuotaLimitList] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -700,7 +401,7 @@ def begin_update( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + location=location, group_quota_request=group_quota_request, api_version=api_version, content_type=content_type, @@ -709,10 +410,11 @@ def begin_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) + deserialized = self._deserialize("GroupQuotaLimitList", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -726,13 +428,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.SubmittedResourceRequestStatus].from_continuation_token( + return LROPoller[_models.GroupQuotaLimitList].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.SubmittedResourceRequestStatus]( + return LROPoller[_models.GroupQuotaLimitList]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -755,7 +457,7 @@ def get( :rtype: ~azure.mgmt.quota.models.SubmittedResourceRequestStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -777,7 +479,6 @@ def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -792,7 +493,7 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response) + deserialized = self._deserialize("SubmittedResourceRequestStatus", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -837,7 +538,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubmittedResourceRequestStatusList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -857,7 +558,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -873,7 +573,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_location_settings_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_location_settings_operations.py deleted file mode 100644 index dcacb1e73bd7..000000000000 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_location_settings_operations.py +++ /dev/null @@ -1,944 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - management_group_id: str, group_quota_name: str, resource_provider_name: str, location: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "managementGroupId": _SERIALIZER.url( - "management_group_id", management_group_id, "str", max_length=63, min_length=3 - ), - "groupQuotaName": _SERIALIZER.url( - "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - "resourceProviderName": _SERIALIZER.url( - "resource_provider_name", - resource_provider_name, - "str", - pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "managementGroupId": _SERIALIZER.url( - "management_group_id", management_group_id, "str", max_length=63, min_length=3 - ), - "groupQuotaName": _SERIALIZER.url( - "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - "resourceProviderName": _SERIALIZER.url( - "resource_provider_name", - resource_provider_name, - "str", - pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "managementGroupId": _SERIALIZER.url( - "management_group_id", management_group_id, "str", max_length=63, min_length=3 - ), - "groupQuotaName": _SERIALIZER.url( - "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - "resourceProviderName": _SERIALIZER.url( - "resource_provider_name", - resource_provider_name, - "str", - pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings", - ) # pylint: disable=line-too-long - path_format_arguments = { - "managementGroupId": _SERIALIZER.url( - "management_group_id", management_group_id, "str", max_length=63, min_length=3 - ), - "groupQuotaName": _SERIALIZER.url( - "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - "resourceProviderName": _SERIALIZER.url( - "resource_provider_name", - resource_provider_name, - "str", - pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? Union[_models.GroupQuotasEnforcementResponse, _models.LROResponse]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Union[_models.GroupQuotasEnforcementResponse, _models.LROResponse]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(location_settings, (IOBase, bytes)): - _content = location_settings - else: - if location_settings is not None: - _json = self._serialize.body(location_settings, "GroupQuotasEnforcementResponse") - else: - _json = None - - _request = build_create_or_update_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("LROResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[_models.GroupQuotasEnforcementResponse] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Default value is None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either GroupQuotasEnforcementResponse or An - instance of LROPoller that returns either LROResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - or ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Default value is None. - :type location_settings: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either GroupQuotasEnforcementResponse or An - instance of LROPoller that returns either LROResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - or ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementResponse, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Is either a GroupQuotasEnforcementResponse type or a IO[bytes] type. Default value is - None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse or IO[bytes] - :return: An instance of LROPoller that returns either GroupQuotasEnforcementResponse or An - instance of LROPoller that returns either LROResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - or ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.LROResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GroupQuotasEnforcementResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - location_settings=location_settings, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.GroupQuotasEnforcementResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.GroupQuotasEnforcementResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementResponse, IO[bytes]]] = None, - **kwargs: Any - ) -> Optional[_models.GroupQuotasEnforcementResponse]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.GroupQuotasEnforcementResponse]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(location_settings, (IOBase, bytes)): - _content = location_settings - else: - if location_settings is not None: - _json = self._serialize.body(location_settings, "GroupQuotasEnforcementResponse") - else: - _json = None - - _request = build_update_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[_models.GroupQuotasEnforcementResponse] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Default value is None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either GroupQuotasEnforcementResponse or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Default value is None. - :type location_settings: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either GroupQuotasEnforcementResponse or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementResponse, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.GroupQuotasEnforcementResponse]: - """Enables the GroupQuotas enforcement settings for the resource provider and the location - specified. - - Enables the GroupQuotas enforcement for the resource provider and the location specified. The - resource provider will start using the group quotas as the overall quota for the subscriptions - included in the GroupQuota. The subscriptions cannot request quota at subscription level. - The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the - GroupQuotaLimits is used, then submit a groupQuotaLimit request for the specific resource - - provider/location/resource. - Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To - disable GroupQuota Enforcement - - - - #. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions - (Check the example - GroupQuotaSubscriptions_Delete). - #. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Is either a GroupQuotasEnforcementResponse type or a IO[bytes] type. Default value is - None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse or IO[bytes] - :return: An instance of LROPoller that returns either GroupQuotasEnforcementResponse or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GroupQuotasEnforcementResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - location_settings=location_settings, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.GroupQuotasEnforcementResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.GroupQuotasEnforcementResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get( - self, management_group_id: str, group_quota_name: str, resource_provider_name: str, location: str, **kwargs: Any - ) -> _models.GroupQuotasEnforcementResponse: - """Gets the GroupQuotas enforcement settings for the resource provider/location. - - Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, - where GroupQuota enforcement is not enabled will return Not Found. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :return: GroupQuotasEnforcementResponse or the result of cls(response) - :rtype: ~azure.mgmt.quota.models.GroupQuotasEnforcementResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GroupQuotasEnforcementResponse] = kwargs.pop("cls", None) - - _request = build_get_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GroupQuotasEnforcementResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, management_group_id: str, group_quota_name: str, resource_provider_name: str, **kwargs: Any - ) -> Iterable["_models.GroupQuotasEnforcementResponse"]: - """Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - - Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is - enabled. The locations not included in GroupQuota Enforcement will not be listed, the regions - in failed status with listed as status Failed. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :return: An iterator like instance of either GroupQuotasEnforcementResponse or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.GroupQuotasEnforcementResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GroupQuotasEnforcementListResponse] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GroupQuotasEnforcementListResponse", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_allocation_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_allocation_operations.py index 825c0b450d30..e2a5986e7281 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_allocation_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_allocation_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +5,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse +import sys +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,18 +16,19 @@ ResourceNotModifiedError, map_error, ) -from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -37,60 +37,23 @@ def build_list_request( - management_group_id: str, group_quota_name: str, subscription_id: str, *, filter: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/quotaAllocations", - ) # pylint: disable=line-too-long - path_format_arguments = { - "managementGroupId": _SERIALIZER.url( - "management_group_id", management_group_id, "str", max_length=63, min_length=3 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "groupQuotaName": _SERIALIZER.url( - "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _params["$filter"] = _SERIALIZER.query("filter", filter, "str", min_length=12) - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( management_group_id: str, group_quota_name: str, - resource_name: str, + resource_provider_name: str, + location: str, subscription_id: str, - *, - filter: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/quotaAllocations/{resourceName}", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}", ) # pylint: disable=line-too-long path_format_arguments = { "managementGroupId": _SERIALIZER.url( @@ -100,16 +63,19 @@ def build_get_request( "groupQuotaName": _SERIALIZER.url( "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" ), - "resourceName": _SERIALIZER.url( - "resource_name", resource_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + "resourceProviderName": _SERIALIZER.url( + "resource_provider_name", + resource_provider_name, + "str", + pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? Iterable["_models.SubscriptionQuotaAllocations"]: - """Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - - Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - This will include the GroupQuota and total quota allocated to the subscription. Only the Group - quota allocated to the subscription can be allocated back to the MG Group Quota. Use the - $filter parameter to filter out the specific resource based on the ResourceProvider/Location. - $filter is a required parameter. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: An iterator like instance of either SubscriptionQuotaAllocations or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.SubscriptionQuotaAllocations] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + self, management_group_id: str, group_quota_name: str, resource_provider_name: str, location: str, **kwargs: Any + ) -> _models.SubscriptionQuotaAllocationsList: + """Gets all the quota allocated to a subscription for the specified resource provider and location + for resource names passed in $filter=resourceName eq {SKU}. - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SubscriptionQuotaAllocationsList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SubscriptionQuotaAllocationsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, management_group_id: str, group_quota_name: str, resource_name: str, filter: str, **kwargs: Any - ) -> _models.SubscriptionQuotaAllocations: - """Gets Quota allocated to a subscription for the specific Resource Provider, Location, - ResourceName. - - Gets Quota allocated to a subscription for the specific Resource Provider, Location, - ResourceName. This will include the GroupQuota and total quota allocated to the subscription. - Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. + Gets all the quota allocated to a subscription for the specified resource provider and location + for resource names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota + and total quota allocated to the subscription. Only the Group quota allocated to the + subscription can be allocated back to the MG Group Quota. :param management_group_id: Management Group Id. Required. :type management_group_id: str :param group_quota_name: The GroupQuota name. The name should be unique for the provided context tenantId/MgId. Required. :type group_quota_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: SubscriptionQuotaAllocations or the result of cls(response) - :rtype: ~azure.mgmt.quota.models.SubscriptionQuotaAllocations + :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. + Currently only Microsoft.Compute resource provider supports this API. Required. + :type resource_provider_name: str + :param location: The name of the Azure region. Required. + :type location: str + :return: SubscriptionQuotaAllocationsList or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -286,19 +140,18 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SubscriptionQuotaAllocations] = kwargs.pop("cls", None) + cls: ClsType[_models.SubscriptionQuotaAllocationsList] = kwargs.pop("cls", None) - _request = build_get_request( + _request = build_list_request( management_group_id=management_group_id, group_quota_name=group_quota_name, - resource_name=resource_name, + resource_provider_name=resource_provider_name, + location=location, subscription_id=self._config.subscription_id, - filter=filter, api_version=api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -313,7 +166,7 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("SubscriptionQuotaAllocations", pipeline_response) + deserialized = self._deserialize("SubscriptionQuotaAllocationsList", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_allocation_request_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_allocation_request_operations.py index aabf4db81820..14d0c4cd6502 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_allocation_request_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_allocation_request_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -16,13 +16,14 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat @@ -30,8 +31,11 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -39,61 +43,25 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - management_group_id: str, group_quota_name: str, allocation_id: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/quotaAllocationRequests/{allocationId}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "managementGroupId": _SERIALIZER.url( - "management_group_id", management_group_id, "str", max_length=63, min_length=3 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "groupQuotaName": _SERIALIZER.url( - "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - "allocationId": _SERIALIZER.url("allocation_id", allocation_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_request( +def build_update_request( management_group_id: str, group_quota_name: str, resource_provider_name: str, + location: str, subscription_id: str, - *, - filter: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}", ) # pylint: disable=line-too-long path_format_arguments = { "managementGroupId": _SERIALIZER.url( @@ -109,39 +77,40 @@ def build_list_request( "str", pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{resourceName}", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{allocationId}", ) # pylint: disable=line-too-long path_format_arguments = { "managementGroupId": _SERIALIZER.url( @@ -157,9 +126,7 @@ def build_create_or_update_request( "str", pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{resourceName}", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests", ) # pylint: disable=line-too-long path_format_arguments = { "managementGroupId": _SERIALIZER.url( @@ -209,22 +174,18 @@ def build_update_request( "str", pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? _models.QuotaAllocationRequestStatus: - """Get the status of the quota allocation request for the subscriptionId. - - Get the quota allocation request status for the subscriptionId by allocationId. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param allocation_id: Request Id. Required. - :type allocation_id: str - :return: QuotaAllocationRequestStatus or the result of cls(response) - :rtype: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.QuotaAllocationRequestStatus] = kwargs.pop("cls", None) - - _request = build_get_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - allocation_id=allocation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, management_group_id: str, group_quota_name: str, resource_provider_name: str, filter: str, **kwargs: Any - ) -> Iterable["_models.QuotaAllocationRequestStatus"]: - """Get all the quotaAllocationRequests for a resourceProvider/location. - - Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for - location is required. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param filter: .. list-table:: - :header-rows: 1 - - * - Field - - Supported operators - * - - - - location eq {location} - Example: $filter=location eq eastus. Required. - :type filter: str - :return: An iterator like instance of either QuotaAllocationRequestStatus or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.QuotaAllocationRequestStatusList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("QuotaAllocationRequestStatusList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _create_or_update_initial( + def _update_initial( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - allocate_quota_request: Union[_models.QuotaAllocationRequestStatus, IO[bytes]], + location: str, + allocate_quota_request: Union[_models.SubscriptionQuotaAllocationsList, IO[bytes]], **kwargs: Any - ) -> Union[_models.QuotaAllocationRequestStatus, _models.LROResponse]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +229,7 @@ def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Union[_models.QuotaAllocationRequestStatus, _models.LROResponse]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -446,13 +237,13 @@ def _create_or_update_initial( if isinstance(allocate_quota_request, (IOBase, bytes)): _content = allocate_quota_request else: - _json = self._serialize.body(allocate_quota_request, "QuotaAllocationRequestStatus") + _json = self._serialize.body(allocate_quota_request, "SubscriptionQuotaAllocationsList") - _request = build_create_or_update_request( + _request = build_update_request( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -461,33 +252,34 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) - - if response.status_code == 201: + if response.status_code == 202: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("LROResponse", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -495,26 +287,26 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_update( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - allocate_quota_request: _models.QuotaAllocationRequestStatus, + location: str, + allocate_quota_request: _models.SubscriptionQuotaAllocationsList, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.QuotaAllocationRequestStatus]: + ) -> LROPoller[_models.SubscriptionQuotaAllocationsList]: """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern to check the status using Async polling as standards defined at - - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + Asynchronous pattern with 202 response and status polling API. Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. + the GroupQuota. User can collect unused quotas from multiple subscriptions within the + groupQuota and assign the groupQuota to the subscription, where it's needed. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -524,41 +316,41 @@ def begin_create_or_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param allocate_quota_request: Quota requests payload. Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus + :type allocate_quota_request: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either QuotaAllocationRequestStatus or An - instance of LROPoller that returns either LROResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] or - ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.LROResponse] + :return: An instance of LROPoller that returns either SubscriptionQuotaAllocationsList or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, + location: str, allocate_quota_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.QuotaAllocationRequestStatus]: + ) -> LROPoller[_models.SubscriptionQuotaAllocationsList]: """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern to check the status using Async polling as standards defined at - - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + Asynchronous pattern with 202 response and status polling API. Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. + the GroupQuota. User can collect unused quotas from multiple subscriptions within the + groupQuota and assign the groupQuota to the subscription, where it's needed. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -568,39 +360,39 @@ def begin_create_or_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str + :param location: The name of the Azure region. Required. + :type location: str :param allocate_quota_request: Quota requests payload. Required. :type allocate_quota_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either QuotaAllocationRequestStatus or An - instance of LROPoller that returns either LROResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] or - ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.LROResponse] + :return: An instance of LROPoller that returns either SubscriptionQuotaAllocationsList or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def begin_update( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - allocate_quota_request: Union[_models.QuotaAllocationRequestStatus, IO[bytes]], + location: str, + allocate_quota_request: Union[_models.SubscriptionQuotaAllocationsList, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.QuotaAllocationRequestStatus]: + ) -> LROPoller[_models.SubscriptionQuotaAllocationsList]: """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern to check the status using Async polling as standards defined at - - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + Asynchronous pattern with 202 response and status polling API. Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. + the GroupQuota. User can collect unused quotas from multiple subscriptions within the + groupQuota and assign the groupQuota to the subscription, where it's needed. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -610,16 +402,16 @@ def begin_create_or_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param allocate_quota_request: Quota requests payload. Is either a QuotaAllocationRequestStatus - type or a IO[bytes] type. Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus or + :param location: The name of the Azure region. Required. + :type location: str + :param allocate_quota_request: Quota requests payload. Is either a + SubscriptionQuotaAllocationsList type or a IO[bytes] type. Required. + :type allocate_quota_request: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList or IO[bytes] - :return: An instance of LROPoller that returns either QuotaAllocationRequestStatus or An - instance of LROPoller that returns either LROResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] or - ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.LROResponse] + :return: An instance of LROPoller that returns either SubscriptionQuotaAllocationsList or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -627,16 +419,16 @@ def begin_create_or_update( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.QuotaAllocationRequestStatus] = kwargs.pop("cls", None) + cls: ClsType[_models.SubscriptionQuotaAllocationsList] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._update_initial( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + location=location, allocate_quota_request=allocate_quota_request, api_version=api_version, content_type=content_type, @@ -645,10 +437,11 @@ def begin_create_or_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) + deserialized = self._deserialize("SubscriptionQuotaAllocationsList", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -662,26 +455,44 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.QuotaAllocationRequestStatus].from_continuation_token( + return LROPoller[_models.SubscriptionQuotaAllocationsList].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.QuotaAllocationRequestStatus]( + return LROPoller[_models.SubscriptionQuotaAllocationsList]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _update_initial( + @distributed_trace + def get( self, management_group_id: str, group_quota_name: str, resource_provider_name: str, - resource_name: str, - allocate_quota_request: Union[_models.QuotaAllocationRequestStatus, IO[bytes]], + allocation_id: str, **kwargs: Any - ) -> Optional[_models.QuotaAllocationRequestStatus]: - error_map = { + ) -> _models.QuotaAllocationRequestStatus: + """Get the status of the quota allocation request for the subscriptionId. + + Get the quota allocation request status for the subscriptionId by allocationId. + + :param management_group_id: Management Group Id. Required. + :type management_group_id: str + :param group_quota_name: The GroupQuota name. The name should be unique for the provided + context tenantId/MgId. Required. + :type group_quota_name: str + :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. + Currently only Microsoft.Compute resource provider supports this API. Required. + :type resource_provider_name: str + :param allocation_id: Request Id. Required. + :type allocation_id: str + :return: QuotaAllocationRequestStatus or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -689,35 +500,22 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.QuotaAllocationRequestStatus]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(allocate_quota_request, (IOBase, bytes)): - _content = allocate_quota_request - else: - _json = self._serialize.body(allocate_quota_request, "QuotaAllocationRequestStatus") + cls: ClsType[_models.QuotaAllocationRequestStatus] = kwargs.pop("cls", None) - _request = build_update_request( + _request = build_get_request( management_group_id=management_group_id, group_quota_name=group_quota_name, resource_provider_name=resource_provider_name, - resource_name=resource_name, + allocation_id=allocation_id, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -727,49 +525,26 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) - - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - allocate_quota_request: _models.QuotaAllocationRequestStatus, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.QuotaAllocationRequestStatus]: - """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern with 202 response and status polling API. + @distributed_trace + def list( + self, management_group_id: str, group_quota_name: str, resource_provider_name: str, filter: str, **kwargs: Any + ) -> Iterable["_models.QuotaAllocationRequestStatus"]: + """Get all the quotaAllocationRequests for a resourceProvider/location. - Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - subscriptions or reduce the quota allocated to subscription to give back the unused quota ( - quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions - and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. User can collect unused quotas from multiple subscriptions within the - groupQuota and assign the groupQuota to the subscription, where it's needed. + Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for + location is required. :param management_group_id: Management Group Id. Required. :type management_group_id: str @@ -779,147 +554,89 @@ def begin_update( :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. Currently only Microsoft.Compute resource provider supports this API. Required. :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param allocate_quota_request: Quota requests payload. Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either QuotaAllocationRequestStatus or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ + :param filter: .. list-table:: + :header-rows: 1 - @overload - def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - allocate_quota_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.QuotaAllocationRequestStatus]: - """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern with 202 response and status polling API. + * - Field + - Supported operators + * - - Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - subscriptions or reduce the quota allocated to subscription to give back the unused quota ( - quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions - and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. User can collect unused quotas from multiple subscriptions within the - groupQuota and assign the groupQuota to the subscription, where it's needed. - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param allocate_quota_request: Quota requests payload. Required. - :type allocate_quota_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either QuotaAllocationRequestStatus or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] + location eq {location} + Example: $filter=location eq eastus. Required. + :type filter: str + :return: An iterator like instance of either QuotaAllocationRequestStatus or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @distributed_trace - def begin_update( - self, - management_group_id: str, - group_quota_name: str, - resource_provider_name: str, - resource_name: str, - allocate_quota_request: Union[_models.QuotaAllocationRequestStatus, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.QuotaAllocationRequestStatus]: - """Request to assign quota from group quota to a specific Subscription. This request will use - Asynchronous pattern with 202 response and status polling API. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.QuotaAllocationRequestStatusList] = kwargs.pop("cls", None) - Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - subscriptions or reduce the quota allocated to subscription to give back the unused quota ( - quota >= usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions - and assign back unused quota to group quota, which can be assigned to another subscriptions in - the GroupQuota. User can collect unused quotas from multiple subscriptions within the - groupQuota and assign the groupQuota to the subscription, where it's needed. + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param resource_name: Resource name. Required. - :type resource_name: str - :param allocate_quota_request: Quota requests payload. Is either a QuotaAllocationRequestStatus - type or a IO[bytes] type. Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.QuotaAllocationRequestStatus or - IO[bytes] - :return: An instance of LROPoller that returns either QuotaAllocationRequestStatus or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaAllocationRequestStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.QuotaAllocationRequestStatus] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - resource_name=resource_name, - allocate_quota_request=allocate_quota_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) + _request = build_list_request( + management_group_id=management_group_id, + group_quota_name=group_quota_name, + resource_provider_name=resource_provider_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("QuotaAllocationRequestStatus", pipeline_response) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("QuotaAllocationRequestStatusList", pipeline_response) + list_of_elem = deserialized.value if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.QuotaAllocationRequestStatus].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return LROPoller[_models.QuotaAllocationRequestStatus]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_requests_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_requests_operations.py index 14fb393141c7..b4b06c967c9b 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_requests_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscription_requests_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,6 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -19,16 +19,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +42,7 @@ def build_list_request(management_group_id: str, group_quota_name: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +150,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GroupQuotaSubscriptionRequestStatusList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +168,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -182,7 +183,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -236,7 +236,7 @@ def get( :rtype: ~azure.mgmt.quota.models.GroupQuotaSubscriptionRequestStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -258,7 +258,6 @@ def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -273,7 +272,7 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GroupQuotaSubscriptionRequestStatus", pipeline_response) + deserialized = self._deserialize("GroupQuotaSubscriptionRequestStatus", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscriptions_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscriptions_operations.py index b4f6518c7d68..94c30129027a 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscriptions_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_subscriptions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +5,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +import sys +from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse from azure.core.exceptions import ( @@ -15,13 +15,14 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat @@ -29,8 +30,11 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +48,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,7 +83,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +118,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +153,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +186,7 @@ def build_list_request(management_group_id: str, group_quota_name: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -231,8 +235,8 @@ def __init__(self, *args, **kwargs): def _create_or_update_initial( self, management_group_id: str, group_quota_name: str, **kwargs: Any - ) -> Union[_models.GroupQuotaSubscriptionId, _models.LROResponse]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +248,7 @@ def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Union[_models.GroupQuotaSubscriptionId, _models.LROResponse]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_create_or_update_request( management_group_id=management_group_id, @@ -254,10 +258,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -265,14 +269,15 @@ def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) - if response.status_code == 201: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -280,7 +285,7 @@ def _create_or_update_initial( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("LROResponse", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -327,10 +332,11 @@ def begin_create_or_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) + deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -354,10 +360,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _update_initial( - self, management_group_id: str, group_quota_name: str, **kwargs: Any - ) -> Optional[_models.GroupQuotaSubscriptionId]: - error_map = { + def _update_initial(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +373,7 @@ def _update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.GroupQuotaSubscriptionId]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_update_request( management_group_id=management_group_id, @@ -379,10 +383,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -390,15 +394,15 @@ def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) - if response.status_code == 202: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -406,6 +410,8 @@ def _update_initial( "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -449,10 +455,11 @@ def begin_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) + deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -476,10 +483,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, management_group_id: str, group_quota_name: str, **kwargs: Any - ) -> None: - error_map = { + def _delete_initial(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +496,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( management_group_id=management_group_id, @@ -501,10 +506,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -512,6 +517,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -524,8 +533,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace def begin_delete(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> LROPoller[None]: @@ -552,7 +565,7 @@ def begin_delete(self, management_group_id: str, group_quota_name: str, **kwargs lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( # type: ignore + raw_result = self._delete_initial( management_group_id=management_group_id, group_quota_name=group_quota_name, api_version=api_version, @@ -561,6 +574,7 @@ def begin_delete(self, management_group_id: str, group_quota_name: str, **kwargs params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements @@ -601,7 +615,7 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.quota.models.GroupQuotaSubscriptionId :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -623,7 +637,6 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -638,7 +651,7 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response) + deserialized = self._deserialize("GroupQuotaSubscriptionId", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -669,7 +682,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GroupQuotaSubscriptionIdList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -687,7 +700,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -703,7 +715,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_usages_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_usages_operations.py deleted file mode 100644 index 3379fe14f2b8..000000000000 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quota_usages_operations.py +++ /dev/null @@ -1,191 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - management_group_id: str, group_quota_name: str, resource_provider_name: str, location: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationUsages/{location}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "managementGroupId": _SERIALIZER.url( - "management_group_id", management_group_id, "str", max_length=63, min_length=3 - ), - "groupQuotaName": _SERIALIZER.url( - "group_quota_name", group_quota_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - "resourceProviderName": _SERIALIZER.url( - "resource_provider_name", - resource_provider_name, - "str", - pattern=r"^((?!-)[a-zA-Z0-9-]{1,63}(? Iterable["_models.ResourceUsages"]: - """Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - - Gets the GroupQuotas usages and limits(quota). Location is required paramter. - - :param management_group_id: Management Group Id. Required. - :type management_group_id: str - :param group_quota_name: The GroupQuota name. The name should be unique for the provided - context tenantId/MgId. Required. - :type group_quota_name: str - :param resource_provider_name: The resource provider name, such as - Microsoft.Compute. - Currently only Microsoft.Compute resource provider supports this API. Required. - :type resource_provider_name: str - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either ResourceUsages or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.ResourceUsages] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ResourceUsageList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - management_group_id=management_group_id, - group_quota_name=group_quota_name, - resource_provider_name=resource_provider_name, - location=location, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ResourceUsageList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quotas_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quotas_operations.py index 1b15e85d1c91..5219b00ff8de 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quotas_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_group_quotas_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -16,13 +16,14 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat @@ -30,8 +31,11 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +47,7 @@ def build_create_or_update_request(management_group_id: str, group_quota_name: s _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -78,7 +82,7 @@ def build_update_request(management_group_id: str, group_quota_name: str, **kwar _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -113,7 +117,7 @@ def build_get_request(management_group_id: str, group_quota_name: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +149,7 @@ def build_delete_request(management_group_id: str, group_quota_name: str, **kwar _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +181,7 @@ def build_list_request(management_group_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,8 +231,8 @@ def _create_or_update_initial( group_quota_name: str, group_quota_put_request_body: Optional[Union[_models.GroupQuotasEntity, IO[bytes]]] = None, **kwargs: Any - ) -> Union[_models.GroupQuotasEntity, _models.LROResponse]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +245,7 @@ def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Union[_models.GroupQuotasEntity, _models.LROResponse]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -264,10 +268,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -275,14 +279,15 @@ def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) - if response.status_code == 201: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -290,7 +295,7 @@ def _create_or_update_initial( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("LROResponse", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -424,10 +429,11 @@ def begin_create_or_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) + deserialized = self._deserialize("GroupQuotasEntity", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -457,8 +463,8 @@ def _update_initial( group_quota_name: str, group_quotas_patch_request_body: Optional[Union[_models.GroupQuotasEntityPatch, IO[bytes]]] = None, **kwargs: Any - ) -> Optional[_models.GroupQuotasEntity]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -471,7 +477,7 @@ def _update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.GroupQuotasEntity]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -494,10 +500,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -505,15 +511,15 @@ def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) - if response.status_code == 202: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) @@ -521,6 +527,8 @@ def _update_initial( "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -657,10 +665,11 @@ def begin_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) + deserialized = self._deserialize("GroupQuotasEntity", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -700,7 +709,7 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.quota.models.GroupQuotasEntity :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -721,7 +730,6 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -736,17 +744,15 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GroupQuotasEntity", pipeline_response) + deserialized = self._deserialize("GroupQuotasEntity", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, management_group_id: str, group_quota_name: str, **kwargs: Any - ) -> None: - error_map = { + def _delete_initial(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -758,7 +764,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( management_group_id=management_group_id, @@ -767,10 +773,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -778,6 +784,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -790,8 +800,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements "str", response.headers.get("Azure-AsyncOperation") ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace def begin_delete(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> LROPoller[None]: @@ -818,7 +832,7 @@ def begin_delete(self, management_group_id: str, group_quota_name: str, **kwargs lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( # type: ignore + raw_result = self._delete_initial( management_group_id=management_group_id, group_quota_name=group_quota_name, api_version=api_version, @@ -827,6 +841,7 @@ def begin_delete(self, management_group_id: str, group_quota_name: str, **kwargs params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements @@ -869,7 +884,7 @@ def list(self, management_group_id: str, **kwargs: Any) -> Iterable["_models.Gro api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GroupQuotaList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +901,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -902,7 +916,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operation_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operation_operations.py index 265f3bd184d4..3fb4bd07f64b 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operation_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operation_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,6 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -19,16 +19,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +42,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +92,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationResponse"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -106,7 +108,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -122,7 +123,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py index f22065db1050..092c78768f2c 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -16,13 +16,14 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat @@ -30,8 +31,11 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +47,7 @@ def build_get_request(resource_name: str, scope: str, **kwargs: Any) -> HttpRequ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +72,7 @@ def build_create_or_update_request(resource_name: str, scope: str, **kwargs: Any _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -96,7 +100,7 @@ def build_update_request(resource_name: str, scope: str, **kwargs: Any) -> HttpR _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -124,7 +128,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,6 +169,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQuotaLimitBase: + # pylint: disable=line-too-long """Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request. @@ -178,14 +183,14 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQ :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: CurrentQuotaLimitBase or the result of cls(response) :rtype: ~azure.mgmt.quota.models.CurrentQuotaLimitBase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -206,7 +211,6 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQ headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -224,7 +228,7 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQ response_headers = {} response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -237,8 +241,8 @@ def _create_or_update_initial( scope: str, create_quota_request: Union[_models.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CurrentQuotaLimitBase]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -251,7 +255,7 @@ def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CurrentQuotaLimitBase]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -271,10 +275,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -282,13 +286,15 @@ def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -305,6 +311,7 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Create or update the quota limit for the specified resource with the requested value. To update the quota, follow these steps: @@ -326,8 +333,8 @@ def begin_create_or_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota request payload. Required. :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase @@ -350,6 +357,7 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Create or update the quota limit for the specified resource with the requested value. To update the quota, follow these steps: @@ -371,8 +379,8 @@ def begin_create_or_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota request payload. Required. :type create_quota_request: IO[bytes] @@ -393,6 +401,7 @@ def begin_create_or_update( create_quota_request: Union[_models.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Create or update the quota limit for the specified resource with the requested value. To update the quota, follow these steps: @@ -414,8 +423,8 @@ def begin_create_or_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota request payload. Is either a CurrentQuotaLimitBase type or a IO[bytes] type. Required. @@ -446,10 +455,11 @@ def begin_create_or_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -479,8 +489,8 @@ def _update_initial( scope: str, create_quota_request: Union[_models.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CurrentQuotaLimitBase]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -493,7 +503,7 @@ def _update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CurrentQuotaLimitBase]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -513,10 +523,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -524,13 +534,15 @@ def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -547,6 +559,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Update the quota limit for a specific resource to the specified value: @@ -567,8 +580,8 @@ def begin_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota requests payload. Required. :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase @@ -591,6 +604,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Update the quota limit for a specific resource to the specified value: @@ -611,8 +625,8 @@ def begin_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota requests payload. Required. :type create_quota_request: IO[bytes] @@ -633,6 +647,7 @@ def begin_update( create_quota_request: Union[_models.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CurrentQuotaLimitBase]: + # pylint: disable=line-too-long """Update the quota limit for a specific resource to the specified value: @@ -653,8 +668,8 @@ def begin_update( :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param create_quota_request: Quota requests payload. Is either a CurrentQuotaLimitBase type or a IO[bytes] type. Required. @@ -685,10 +700,11 @@ def begin_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response) + deserialized = self._deserialize("CurrentQuotaLimitBase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -714,14 +730,15 @@ def get_long_running_output(pipeline_response): @distributed_trace def list(self, scope: str, **kwargs: Any) -> Iterable["_models.CurrentQuotaLimitBase"]: + # pylint: disable=line-too-long """Get a list of current quota limits of all resources for the specified scope. The response from this GET operation can be leveraged to submit requests to update a quota. :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: An iterator like instance of either CurrentQuotaLimitBase or the result of cls(response) @@ -734,7 +751,7 @@ def list(self, scope: str, **kwargs: Any) -> Iterable["_models.CurrentQuotaLimit api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.QuotaLimits] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -751,7 +768,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -767,7 +783,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py index 680f5ddea375..44769df0b435 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,6 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -19,16 +19,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +42,7 @@ def build_get_request(id: str, scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +74,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,6 +121,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails: + # pylint: disable=line-too-long """Get the quota request details and status by quota request ID for the resources of the resource provider at a specific location. The quota request ID **id** is returned in the response of the PUT operation. @@ -128,14 +131,14 @@ def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: QuotaRequestDetails or the result of cls(response) :rtype: ~azure.mgmt.quota.models.QuotaRequestDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +159,6 @@ def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -171,7 +173,7 @@ def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("QuotaRequestDetails", pipeline_response) + deserialized = self._deserialize("QuotaRequestDetails", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -187,14 +189,15 @@ def list( skiptoken: Optional[str] = None, **kwargs: Any ) -> Iterable["_models.QuotaRequestDetails"]: + # pylint: disable=line-too-long """For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the **oData** filter to select quota requests. :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :param filter: .. list-table:: :header-rows: 1 @@ -225,7 +228,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.QuotaRequestDetailsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +248,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -261,7 +263,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py index 08d7c591b503..f9e07ff83a46 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,6 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -19,16 +19,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +42,7 @@ def build_get_request(resource_name: str, scope: str, **kwargs: Any) -> HttpRequ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +67,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-18-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,6 +108,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentUsagesBase: + # pylint: disable=line-too-long """Get the current usage of a resource. :param resource_name: Resource name for a given resource provider. For example: @@ -118,14 +121,14 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: CurrentUsagesBase or the result of cls(response) :rtype: ~azure.mgmt.quota.models.CurrentUsagesBase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +149,6 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -164,7 +166,7 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU response_headers = {} response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - deserialized = self._deserialize("CurrentUsagesBase", pipeline_response) + deserialized = self._deserialize("CurrentUsagesBase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -173,13 +175,14 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU @distributed_trace def list(self, scope: str, **kwargs: Any) -> Iterable["_models.CurrentUsagesBase"]: + # pylint: disable=line-too-long """Get a list of current usage for all resources for the scope specified. :param scope: The target Azure resource URI. For example, ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is - added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the - specific resource. Required. + added after ``/quotas``\\ , then it's the target Azure resource URI in the GET operation for + the specific resource. Required. :type scope: str :return: An iterator like instance of either CurrentUsagesBase or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.CurrentUsagesBase] @@ -191,7 +194,7 @@ def list(self, scope: str, **kwargs: Any) -> Iterable["_models.CurrentUsagesBase api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UsagesLimits] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +211,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -224,7 +226,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/quota/azure-mgmt-quota/dev_requirements.txt b/sdk/quota/azure-mgmt-quota/dev_requirements.txt index 6ccb7f031ddd..6195bb36ac8e 100644 --- a/sdk/quota/azure-mgmt-quota/dev_requirements.txt +++ b/sdk/quota/azure-mgmt-quota/dev_requirements.txt @@ -1 +1,2 @@ -e ../../../tools/azure-sdk-tools +aiohttp \ No newline at end of file diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py index c0cd5e4f40dd..1965cd7e3bca 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeOneSkuQuotaLimit.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getComputeOneSkuQuotaLimit.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py index 50d977fdace6..568c6dbc5c0c 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeOneSkuUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getComputeOneSkuUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py index 9769dd829332..27f53a972555 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeQuotaLimits.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getComputeQuotaLimits.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py index 39b2dd500fbd..3bc0ed73ffed 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getComputeUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py index 270e278748d6..5e22cb5cc42e 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getMachineLearningServicesQuotaLimits.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getMachineLearningServicesQuotaLimits.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py index d4654c449965..7aec6802e225 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getMachineLearningServicesUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getMachineLearningServicesUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py index e8c2263f0498..243c7cccf590 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkOneSkuQuotaLimit.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getNetworkOneSkuQuotaLimit.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py index bcd92ea649c0..efd3ea041665 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkOneSkuUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getNetworkOneSkuUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py index f838c6cd0153..695efd8e98b6 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkQuotaLimits.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getNetworkQuotaLimits.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py index b64e3a265cd4..60438532daa9 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getNetworkUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py index 4fc48c3f9531..422047efca09 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GetOperations.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GetOperations.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py index b80909055b84..9be828056321 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getQuotaRequestStatusById.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getQuotaRequestStatusById.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py index 96246e072fa6..04cd6b356b39 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getQuotaRequestStatusFailed.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getQuotaRequestStatusFailed.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py index 90d084706698..9db696ba73f0 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getQuotaRequestStatusInProgress.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getQuotaRequestStatusInProgress.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py index f667b546be1b..7b19485db1d1 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getQuotaRequestsHistory.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/getQuotaRequestsHistory.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_usages/get_group_quota_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits/list_group_quota_limits_compute.py similarity index 86% rename from sdk/quota/azure-mgmt-quota/generated_samples/group_quota_usages/get_group_quota_usages.py rename to sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits/list_group_quota_limits_compute.py index bc1933186d0f..bfb5ed641e27 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_usages/get_group_quota_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits/list_group_quota_limits_compute.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python get_group_quota_usages.py + python list_group_quota_limits_compute.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,16 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.group_quota_usages.list( + response = client.group_quota_limits.list( management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", group_quota_name="groupquota1", resource_provider_name="Microsoft.Compute", location="westus", ) - for item in response: - print(item) + print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaUsages/GetGroupQuotaUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotaLimits/ListGroupQuotaLimits-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/get_group_quota_enforcement.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/group_quota_limits_requests_get.py similarity index 83% rename from sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/get_group_quota_enforcement.py rename to sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/group_quota_limits_requests_get.py index f5a831eb29ee..f587d57f8866 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/get_group_quota_enforcement.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/group_quota_limits_requests_get.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python get_group_quota_enforcement.py + python group_quota_limits_requests_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,15 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.group_quota_location_settings.get( + response = client.group_quota_limits_request.get( management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", group_quota_name="groupquota1", - resource_provider_name="Microsoft.Compute", - location="eastus", + request_id_parameter="requestId", ) print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/GetGroupQuotaEnforcement.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_Get.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/list_group_quota_enforcement.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/group_quota_limits_requests_list.py similarity index 85% rename from sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/list_group_quota_enforcement.py rename to sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/group_quota_limits_requests_list.py index 370bafd60457..535acdcf0a93 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/list_group_quota_enforcement.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/group_quota_limits_requests_list.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python list_group_quota_enforcement.py + python group_quota_limits_requests_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,15 +30,16 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.group_quota_location_settings.list( + response = client.group_quota_limits_request.list( management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", group_quota_name="groupquota1", resource_provider_name="Microsoft.Compute", + filter="location eq westus", ) for item in response: print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ListGroupQuotaEnforcement.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_List.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/patch_group_quota_limits_requests_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/patch_group_quota_limits_requests_compute.py index f261d97f998f..1820a9aafa6e 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/patch_group_quota_limits_requests_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/patch_group_quota_limits_requests_compute.py @@ -34,11 +34,11 @@ def main(): management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", group_quota_name="groupquota1", resource_provider_name="Microsoft.Compute", - resource_name="standardav2family", + location="westus", ).result() print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests/PatchGroupQuotaLimitsRequests-Compute.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotaLimitsRequests/PatchGroupQuotaLimitsRequests-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/put_group_quota_limits_requests_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/put_group_quota_limits_requests_compute.py deleted file mode 100644 index ff3fc743b593..000000000000 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests/put_group_quota_limits_requests_compute.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.quota import QuotaMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-quota -# USAGE - python put_group_quota_limits_requests_compute.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = QuotaMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.group_quota_limits_request.begin_create_or_update( - management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", - group_quota_name="groupquota1", - resource_provider_name="Microsoft.Compute", - resource_name="standardav2family", - ).result() - print(response) - - -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests/PutGroupQuotaLimitsRequests-Compute.json -if __name__ == "__main__": - main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/delete_group_quotas.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/delete_group_quotas.py index fdb271fe342c..9d6b8d649e29 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/delete_group_quotas.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/delete_group_quotas.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/DeleteGroupQuotas.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotas/DeleteGroupQuotas.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/get_group_quotas.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/get_group_quotas.py index 764ef79e7fb2..74cd1c4c0e9f 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/get_group_quotas.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/get_group_quotas.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/GetGroupQuotas.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotas/GetGroupQuotas.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/get_group_quotas_list.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/get_group_quotas_list.py index 8d8500e87981..41746c835f80 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/get_group_quotas_list.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/get_group_quotas_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/GetGroupQuotasList.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotas/GetGroupQuotasList.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/patch_group_quotas.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/patch_group_quotas.py index 81dc1db6c2e8..652570e37cc3 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/patch_group_quotas.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/patch_group_quotas.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/PatchGroupQuotas.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotas/PatchGroupQuotas.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/put_group_quotas.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/put_group_quotas.py index 9fcc055f977e..e1df93b1e0d1 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/put_group_quotas.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas/put_group_quotas.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/PutGroupQuotas.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotas/PutGroupQuotas.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/put_group_quota_enforcement_failed.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/put_group_quota_enforcement_failed.py deleted file mode 100644 index 799470d1607b..000000000000 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/put_group_quota_enforcement_failed.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.quota import QuotaMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-quota -# USAGE - python put_group_quota_enforcement_failed.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = QuotaMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.group_quota_location_settings.begin_create_or_update( - management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", - group_quota_name="groupquota1", - resource_provider_name="Microsoft.Compute", - location="eastus", - ).result() - print(response) - - -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/PutGroupQuotaEnforcementFailed.json -if __name__ == "__main__": - main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/delete_group_quota_subscriptions.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/delete_group_quota_subscriptions.py index 54d4895f0ab7..7707b911cbd0 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/delete_group_quota_subscriptions.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/delete_group_quota_subscriptions.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions/DeleteGroupQuotaSubscriptions.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotasSubscriptions/DeleteGroupQuotaSubscriptions.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/get_group_quota_subscriptions.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/get_group_quota_subscriptions.py index 59e2818751aa..deb48cc5a7f5 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/get_group_quota_subscriptions.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/get_group_quota_subscriptions.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions/GetGroupQuotaSubscriptions.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotasSubscriptions/GetGroupQuotaSubscriptions.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/list_group_quota_subscriptions.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/list_group_quota_subscriptions.py index 2e1ced786c5d..db871aba266e 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/list_group_quota_subscriptions.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/list_group_quota_subscriptions.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions/ListGroupQuotaSubscriptions.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotasSubscriptions/ListGroupQuotaSubscriptions.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/patch_group_quotas_subscription.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/patch_group_quotas_subscription.py index 3d5e98344ea0..719ddcd89a0a 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/patch_group_quotas_subscription.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/patch_group_quotas_subscription.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions/PatchGroupQuotasSubscription.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotasSubscriptions/PatchGroupQuotasSubscription.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/put_group_quotas_subscription.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/put_group_quotas_subscription.py index aab7cb1bd821..d7dc810bdc69 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/put_group_quotas_subscription.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_subscriptions/put_group_quotas_subscription.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions/PutGroupQuotasSubscription.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/GroupQuotasSubscriptions/PutGroupQuotasSubscription.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py index dcb3e0516a0d..4c563049ad45 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.quota import QuotaMgmtClient @@ -45,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/patchComputeQuotaRequest.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/patchComputeQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py index 2b0798c1a9cb..19a4cc2e93c2 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.quota import QuotaMgmtClient @@ -46,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/patchNetworkOneSkuQuotaRequest.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/patchNetworkOneSkuQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py index 557b1c01aa9c..eb2c08fc1c25 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.quota import QuotaMgmtClient @@ -45,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/putComputeOneSkuQuotaRequest.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/putComputeOneSkuQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py index baa5790f1623..395bb1a2203c 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.quota import QuotaMgmtClient @@ -46,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/putMachineLearningServicesQuotaRequestLowPriority.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/putMachineLearningServicesQuotaRequestLowPriority.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py index 7ac218cb05dc..527bf7a491e7 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.quota import QuotaMgmtClient @@ -46,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/putNetworkOneSkuQuotaRequest.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/putNetworkOneSkuQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py index 166bb7ec74b2..186fcfcf397a 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.quota import QuotaMgmtClient @@ -46,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/put_group_quota_enforcement.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation/subscription_quota_allocation_list_compute.py similarity index 80% rename from sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/put_group_quota_enforcement.py rename to sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation/subscription_quota_allocation_list_compute.py index 2038a8b2dfa9..7f2993cafb09 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/put_group_quota_enforcement.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation/subscription_quota_allocation_list_compute.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python put_group_quota_enforcement.py + python subscription_quota_allocation_list_compute.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -27,18 +27,18 @@ def main(): client = QuotaMgmtClient( credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", + subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.group_quota_location_settings.begin_create_or_update( + response = client.group_quota_subscription_allocation.list( management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", group_quota_name="groupquota1", resource_provider_name="Microsoft.Compute", - location="eastus", - ).result() + location="westus", + ) print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/PutGroupQuotaEnforcement.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/SubscriptionQuotaAllocation/SubscriptionQuotaAllocation_List-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/patch_subscription_quota_allocation_request_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/patch_subscription_quota_allocation_request_compute.py index 11939d20179b..c68a4a827dfa 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/patch_subscription_quota_allocation_request_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/patch_subscription_quota_allocation_request_compute.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.quota import QuotaMgmtClient @@ -36,12 +34,19 @@ def main(): management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", group_quota_name="groupquota1", resource_provider_name="Microsoft.Compute", - resource_name="standardav2family", - allocate_quota_request={"properties": {"requestedResource": {"properties": {"limit": 10, "region": "westus"}}}}, + location="westus", + allocate_quota_request={ + "properties": { + "value": [ + {"properties": {"limit": 110, "resourceName": "standardddv4family"}}, + {"properties": {"limit": 110, "resourceName": "standardav2family"}}, + ] + } + }, ).result() print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/SubscriptionQuotaAllocationRequests/PatchSubscriptionQuotaAllocationRequest-Compute.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/SubscriptionQuotaAllocationRequests/PatchSubscriptionQuotaAllocationRequest-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/subscription_quota_allocation_requests_get_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/subscription_quota_allocation_requests_get_compute.py index dca9a0ff7dd9..637667ec646f 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/subscription_quota_allocation_requests_get_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/subscription_quota_allocation_requests_get_compute.py @@ -33,11 +33,12 @@ def main(): response = client.group_quota_subscription_allocation_request.get( management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", group_quota_name="groupquota1", + resource_provider_name="Microsoft.Compute", allocation_id="AE000000-0000-0000-0000-00000000000A", ) print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_Get-Compute.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_Get-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/put_subscription_quota_allocation_request_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/subscription_quota_allocation_requests_list_compute.py similarity index 76% rename from sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/put_subscription_quota_allocation_request_compute.py rename to sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/subscription_quota_allocation_requests_list_compute.py index 403032ea4440..81df258f0fd5 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/put_subscription_quota_allocation_request_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests/subscription_quota_allocation_requests_list_compute.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.quota import QuotaMgmtClient @@ -17,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python put_subscription_quota_allocation_request_compute.py + python subscription_quota_allocation_requests_list_compute.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,16 +30,16 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.group_quota_subscription_allocation_request.begin_create_or_update( + response = client.group_quota_subscription_allocation_request.list( management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", group_quota_name="groupquota1", resource_provider_name="Microsoft.Compute", - resource_name="standardav2family", - allocate_quota_request={"properties": {"requestedResource": {"properties": {"limit": 10, "region": "westus"}}}}, - ).result() - print(response) + filter="location eq westus", + ) + for item in response: + print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/SubscriptionQuotaAllocationRequests/PutSubscriptionQuotaAllocationRequest-Compute.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_List-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/patch_group_quota_enforcement.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests/subscription_requests_get.py similarity index 82% rename from sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/patch_group_quota_enforcement.py rename to sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests/subscription_requests_get.py index f39d48ae8cb1..530d88caf479 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quotas_enforcement/patch_group_quota_enforcement.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests/subscription_requests_get.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python patch_group_quota_enforcement.py + python subscription_requests_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,15 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.group_quota_location_settings.begin_update( + response = client.group_quota_subscription_requests.get( management_group_id="E7EC67B3-7657-4966-BFFC-41EFD36BAA09", group_quota_name="groupquota1", - resource_provider_name="Microsoft.Compute", - location="eastus", - ).result() + request_id_parameter="00000000-0000-0000-0000-000000000000", + ) print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/PatchGroupQuotaEnforcement.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/SubscriptionRequests/SubscriptionRequests_Get.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests/subscription_requests_list.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests/subscription_requests_list.py index 9c220faf58ba..d0de50f19131 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests/subscription_requests_list.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests/subscription_requests_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/SubscriptionRequests/SubscriptionRequests_List.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2024-12-18-preview/examples/SubscriptionRequests/SubscriptionRequests_List.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/conftest.py b/sdk/quota/azure-mgmt-quota/generated_tests/conftest.py new file mode 100644 index 000000000000..40c13c29b825 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/conftest.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + quotamgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + quotamgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + quotamgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + quotamgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=quotamgmt_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=quotamgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=quotamgmt_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=quotamgmt_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_operations.py new file mode 100644 index 000000000000..9b3692c3a940 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_operations.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaLimitsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_limits_list(self, resource_group): + response = self.client.group_quota_limits.list( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + location="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_operations_async.py new file mode 100644 index 000000000000..68a7a5518e00 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_operations_async.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaLimitsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_limits_list(self, resource_group): + response = await self.client.group_quota_limits.list( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + location="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_request_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_request_operations.py new file mode 100644 index 000000000000..fa643d913ca3 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_request_operations.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaLimitsRequestOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_limits_request_begin_update(self, resource_group): + response = self.client.group_quota_limits_request.begin_update( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + location="str", + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_limits_request_get(self, resource_group): + response = self.client.group_quota_limits_request.get( + management_group_id="str", + group_quota_name="str", + request_id_parameter="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_limits_request_list(self, resource_group): + response = self.client.group_quota_limits_request.list( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + filter="str", + api_version="2024-12-18-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_request_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_request_operations_async.py new file mode 100644 index 000000000000..83cd78b471cd --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_limits_request_operations_async.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaLimitsRequestOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_limits_request_begin_update(self, resource_group): + response = await ( + await self.client.group_quota_limits_request.begin_update( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + location="str", + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_limits_request_get(self, resource_group): + response = await self.client.group_quota_limits_request.get( + management_group_id="str", + group_quota_name="str", + request_id_parameter="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_limits_request_list(self, resource_group): + response = self.client.group_quota_limits_request.list( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + filter="str", + api_version="2024-12-18-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_operations.py new file mode 100644 index 000000000000..7f397b6efbf3 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_operations.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaSubscriptionAllocationOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscription_allocation_list(self, resource_group): + response = self.client.group_quota_subscription_allocation.list( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + location="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_operations_async.py new file mode 100644 index 000000000000..44b2018e2db5 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_operations_async.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaSubscriptionAllocationOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscription_allocation_list(self, resource_group): + response = await self.client.group_quota_subscription_allocation.list( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + location="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_request_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_request_operations.py new file mode 100644 index 000000000000..a514ed6c7324 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_request_operations.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaSubscriptionAllocationRequestOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscription_allocation_request_begin_update(self, resource_group): + response = self.client.group_quota_subscription_allocation_request.begin_update( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + location="str", + allocate_quota_request={ + "id": "str", + "name": "str", + "properties": { + "nextLink": "str", + "provisioningState": "str", + "value": [ + { + "properties": { + "limit": 0, + "name": {"localizedValue": "str", "value": "str"}, + "resourceName": "str", + "shareableQuota": 0, + } + } + ], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscription_allocation_request_get(self, resource_group): + response = self.client.group_quota_subscription_allocation_request.get( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + allocation_id="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscription_allocation_request_list(self, resource_group): + response = self.client.group_quota_subscription_allocation_request.list( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + filter="str", + api_version="2024-12-18-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_request_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_request_operations_async.py new file mode 100644 index 000000000000..fe45b4f687e4 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_allocation_request_operations_async.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaSubscriptionAllocationRequestOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscription_allocation_request_begin_update(self, resource_group): + response = await ( + await self.client.group_quota_subscription_allocation_request.begin_update( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + location="str", + allocate_quota_request={ + "id": "str", + "name": "str", + "properties": { + "nextLink": "str", + "provisioningState": "str", + "value": [ + { + "properties": { + "limit": 0, + "name": {"localizedValue": "str", "value": "str"}, + "resourceName": "str", + "shareableQuota": 0, + } + } + ], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscription_allocation_request_get(self, resource_group): + response = await self.client.group_quota_subscription_allocation_request.get( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + allocation_id="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscription_allocation_request_list(self, resource_group): + response = self.client.group_quota_subscription_allocation_request.list( + management_group_id="str", + group_quota_name="str", + resource_provider_name="str", + filter="str", + api_version="2024-12-18-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_requests_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_requests_operations.py new file mode 100644 index 000000000000..cd4ea1a3c1b9 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_requests_operations.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaSubscriptionRequestsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscription_requests_list(self, resource_group): + response = self.client.group_quota_subscription_requests.list( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscription_requests_get(self, resource_group): + response = self.client.group_quota_subscription_requests.get( + management_group_id="str", + group_quota_name="str", + request_id_parameter="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_requests_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_requests_operations_async.py new file mode 100644 index 000000000000..31ce9dce8f54 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscription_requests_operations_async.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaSubscriptionRequestsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscription_requests_list(self, resource_group): + response = self.client.group_quota_subscription_requests.list( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscription_requests_get(self, resource_group): + response = await self.client.group_quota_subscription_requests.get( + management_group_id="str", + group_quota_name="str", + request_id_parameter="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscriptions_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscriptions_operations.py new file mode 100644 index 000000000000..01b57bd267e0 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscriptions_operations.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaSubscriptionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscriptions_begin_create_or_update(self, resource_group): + response = self.client.group_quota_subscriptions.begin_create_or_update( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscriptions_begin_update(self, resource_group): + response = self.client.group_quota_subscriptions.begin_update( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscriptions_begin_delete(self, resource_group): + response = self.client.group_quota_subscriptions.begin_delete( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscriptions_get(self, resource_group): + response = self.client.group_quota_subscriptions.get( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quota_subscriptions_list(self, resource_group): + response = self.client.group_quota_subscriptions.list( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscriptions_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscriptions_operations_async.py new file mode 100644 index 000000000000..76554ad9b368 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quota_subscriptions_operations_async.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotaSubscriptionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscriptions_begin_create_or_update(self, resource_group): + response = await ( + await self.client.group_quota_subscriptions.begin_create_or_update( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscriptions_begin_update(self, resource_group): + response = await ( + await self.client.group_quota_subscriptions.begin_update( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscriptions_begin_delete(self, resource_group): + response = await ( + await self.client.group_quota_subscriptions.begin_delete( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscriptions_get(self, resource_group): + response = await self.client.group_quota_subscriptions.get( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quota_subscriptions_list(self, resource_group): + response = self.client.group_quota_subscriptions.list( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quotas_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quotas_operations.py new file mode 100644 index 000000000000..0f1a9fe7e0a9 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quotas_operations.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotasOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quotas_begin_create_or_update(self, resource_group): + response = self.client.group_quotas.begin_create_or_update( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quotas_begin_update(self, resource_group): + response = self.client.group_quotas.begin_update( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quotas_get(self, resource_group): + response = self.client.group_quotas.get( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quotas_begin_delete(self, resource_group): + response = self.client.group_quotas.begin_delete( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_group_quotas_list(self, resource_group): + response = self.client.group_quotas.list( + management_group_id="str", + api_version="2024-12-18-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quotas_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quotas_operations_async.py new file mode 100644 index 000000000000..33f869f23eae --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_group_quotas_operations_async.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtGroupQuotasOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quotas_begin_create_or_update(self, resource_group): + response = await ( + await self.client.group_quotas.begin_create_or_update( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quotas_begin_update(self, resource_group): + response = await ( + await self.client.group_quotas.begin_update( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quotas_get(self, resource_group): + response = await self.client.group_quotas.get( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quotas_begin_delete(self, resource_group): + response = await ( + await self.client.group_quotas.begin_delete( + management_group_id="str", + group_quota_name="str", + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_group_quotas_list(self, resource_group): + response = self.client.group_quotas.list( + management_group_id="str", + api_version="2024-12-18-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operation_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operation_operations.py new file mode 100644 index 000000000000..07dfdbdc2997 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operation_operations.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtQuotaOperationOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_operation_list(self, resource_group): + response = self.client.quota_operation.list( + api_version="2024-12-18-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operation_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operation_operations_async.py new file mode 100644 index 000000000000..f4d3da57a93d --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operation_operations_async.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtQuotaOperationOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_operation_list(self, resource_group): + response = self.client.quota_operation.list( + api_version="2024-12-18-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations.py new file mode 100644 index 000000000000..99d4fddc6b56 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtQuotaOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_get(self, resource_group): + response = self.client.quota.get( + resource_name="str", + scope="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_begin_create_or_update(self, resource_group): + response = self.client.quota.begin_create_or_update( + resource_name="str", + scope="str", + create_quota_request={ + "id": "str", + "name": "str", + "properties": { + "isQuotaApplicable": bool, + "limit": "limit_json_object", + "name": {"localizedValue": "str", "value": "str"}, + "properties": {}, + "quotaPeriod": "str", + "resourceType": "str", + "unit": "str", + }, + "type": "str", + }, + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_begin_update(self, resource_group): + response = self.client.quota.begin_update( + resource_name="str", + scope="str", + create_quota_request={ + "id": "str", + "name": "str", + "properties": { + "isQuotaApplicable": bool, + "limit": "limit_json_object", + "name": {"localizedValue": "str", "value": "str"}, + "properties": {}, + "quotaPeriod": "str", + "resourceType": "str", + "unit": "str", + }, + "type": "str", + }, + api_version="2024-12-18-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_list(self, resource_group): + response = self.client.quota.list( + scope="str", + api_version="2024-12-18-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations_async.py new file mode 100644 index 000000000000..0c223991abf5 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations_async.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtQuotaOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_get(self, resource_group): + response = await self.client.quota.get( + resource_name="str", + scope="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_begin_create_or_update(self, resource_group): + response = await ( + await self.client.quota.begin_create_or_update( + resource_name="str", + scope="str", + create_quota_request={ + "id": "str", + "name": "str", + "properties": { + "isQuotaApplicable": bool, + "limit": "limit_json_object", + "name": {"localizedValue": "str", "value": "str"}, + "properties": {}, + "quotaPeriod": "str", + "resourceType": "str", + "unit": "str", + }, + "type": "str", + }, + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_begin_update(self, resource_group): + response = await ( + await self.client.quota.begin_update( + resource_name="str", + scope="str", + create_quota_request={ + "id": "str", + "name": "str", + "properties": { + "isQuotaApplicable": bool, + "limit": "limit_json_object", + "name": {"localizedValue": "str", "value": "str"}, + "properties": {}, + "quotaPeriod": "str", + "resourceType": "str", + "unit": "str", + }, + "type": "str", + }, + api_version="2024-12-18-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_list(self, resource_group): + response = self.client.quota.list( + scope="str", + api_version="2024-12-18-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations.py new file mode 100644 index 000000000000..6206c8d6bc02 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtQuotaRequestStatusOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_request_status_get(self, resource_group): + response = self.client.quota_request_status.get( + id="str", + scope="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_request_status_list(self, resource_group): + response = self.client.quota_request_status.list( + scope="str", + api_version="2024-12-18-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations_async.py new file mode 100644 index 000000000000..1a4cc55db330 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations_async.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtQuotaRequestStatusOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_request_status_get(self, resource_group): + response = await self.client.quota_request_status.get( + id="str", + scope="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_request_status_list(self, resource_group): + response = self.client.quota_request_status.list( + scope="str", + api_version="2024-12-18-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations.py new file mode 100644 index 000000000000..f2c5143cf536 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtUsagesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_usages_get(self, resource_group): + response = self.client.usages.get( + resource_name="str", + scope="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_usages_list(self, resource_group): + response = self.client.usages.list( + scope="str", + api_version="2024-12-18-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations_async.py new file mode 100644 index 000000000000..56ea85446fe6 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations_async.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtUsagesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_usages_get(self, resource_group): + response = await self.client.usages.get( + resource_name="str", + scope="str", + api_version="2024-12-18-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_usages_list(self, resource_group): + response = self.client.usages.list( + scope="str", + api_version="2024-12-18-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/setup.py b/sdk/quota/azure-mgmt-quota/setup.py index ba4638cbced9..e38b1517297a 100644 --- a/sdk/quota/azure-mgmt-quota/setup.py +++ b/sdk/quota/azure-mgmt-quota/setup.py @@ -75,6 +75,7 @@ }, install_requires=[ "isodate>=0.6.1", + "typing-extensions>=4.6.0", "azure-common>=1.1", "azure-mgmt-core>=1.3.2", ], diff --git a/sdk/quota/azure-mgmt-quota/tests/conftest.py b/sdk/quota/azure-mgmt-quota/tests/conftest.py new file mode 100644 index 000000000000..40c13c29b825 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/tests/conftest.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + quotamgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + quotamgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + quotamgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + quotamgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=quotamgmt_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=quotamgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=quotamgmt_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=quotamgmt_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/quota/azure-mgmt-quota/tests/test_quota_mgmt_quota_operation_operations_async_test.py b/sdk/quota/azure-mgmt-quota/tests/test_quota_mgmt_quota_operation_operations_async_test.py new file mode 100644 index 000000000000..bd6435fad435 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/tests/test_quota_mgmt_quota_operation_operations_async_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestQuotaMgmtQuotaOperationOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_operation_list(self, resource_group): + response = self.client.quota_operation.list() + result = [r async for r in response] + assert result diff --git a/sdk/quota/azure-mgmt-quota/tests/test_quota_mgmt_quota_operation_operations_test.py b/sdk/quota/azure-mgmt-quota/tests/test_quota_mgmt_quota_operation_operations_test.py new file mode 100644 index 000000000000..b3e67de60a8d --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/tests/test_quota_mgmt_quota_operation_operations_test.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestQuotaMgmtQuotaOperationOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_operation_list(self, resource_group): + response = self.client.quota_operation.list() + result = [r for r in response] + assert result From 9c4268fe43f9cb9492783740f1d87d0c827a861f Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 21 Jan 2025 23:29:33 -0800 Subject: [PATCH 09/29] [AutoRelease] t2-servicenetworking-2025-01-21-47646(can only be merged by SDK owner) (#39322) * code and test * Remove duplicate method overloads from changelog * Update CHANGELOG.md to remove instance variables * Fix typo in changelog entry * Update CHANGELOG for version 2.0.0 --------- Co-authored-by: azure-sdk Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> --- .../azure-mgmt-servicenetworking/CHANGELOG.md | 38 +- .../azure-mgmt-servicenetworking/_meta.json | 11 +- .../azure/mgmt/servicenetworking/__init__.py | 4 +- ...e_networking_mgmt_client.py => _client.py} | 51 +- .../mgmt/servicenetworking/_configuration.py | 21 +- .../mgmt/servicenetworking/_model_base.py | 1175 ++++++ .../mgmt/servicenetworking/_serialization.py | 70 +- .../mgmt/servicenetworking/_validation.py | 50 + .../azure/mgmt/servicenetworking/_version.py | 4 +- .../mgmt/servicenetworking/aio/__init__.py | 4 +- ...e_networking_mgmt_client.py => _client.py} | 51 +- .../servicenetworking/aio/_configuration.py | 21 +- .../aio/operations/__init__.py | 14 +- .../_associations_interface_operations.py | 683 --- .../_frontends_interface_operations.py | 682 --- .../aio/operations/_operations.py | 3157 +++++++++++++- ..._security_policies_interface_operations.py | 683 --- ...traffic_controller_interface_operations.py | 731 ---- .../mgmt/servicenetworking/models/__init__.py | 38 +- ...working_mgmt_client_enums.py => _enums.py} | 16 +- .../mgmt/servicenetworking/models/_models.py | 1048 +++++ .../servicenetworking/models/_models_py3.py | 1172 ----- .../servicenetworking/operations/__init__.py | 14 +- .../_associations_interface_operations.py | 885 ---- .../_frontends_interface_operations.py | 882 ---- .../operations/_operations.py | 3753 ++++++++++++++++- ..._security_policies_interface_operations.py | 913 ---- ...traffic_controller_interface_operations.py | 926 ---- .../generated_samples/association_delete.py | 6 +- .../generated_samples/association_get.py | 6 +- .../generated_samples/association_patch.py | 6 +- .../generated_samples/association_put.py | 6 +- .../generated_samples/associations_get.py | 6 +- .../generated_samples/frontend_delete.py | 6 +- .../generated_samples/frontend_get.py | 6 +- .../generated_samples/frontend_put.py | 6 +- .../generated_samples/frontends_get.py | 6 +- .../generated_samples/operations_list.py | 4 +- .../security_policies_get_list.py | 6 +- .../security_policy_delete.py | 6 +- .../generated_samples/security_policy_get.py | 6 +- .../security_policy_patch.py | 6 +- .../generated_samples/security_policy_put.py | 6 +- .../traffic_controller_delete.py | 6 +- .../traffic_controller_get.py | 6 +- .../traffic_controller_patch.py | 6 +- .../traffic_controller_put.py | 6 +- .../traffic_controllers_get.py | 6 +- .../traffic_controllers_get_list.py | 6 +- .../generated_tests/conftest.py | 2 +- ..._mgmt_associations_interface_operations.py | 35 +- ...associations_interface_operations_async.py | 35 +- ...ing_mgmt_frontends_interface_operations.py | 32 +- ...mt_frontends_interface_operations_async.py | 32 +- ...test_service_networking_mgmt_operations.py | 6 +- ...ervice_networking_mgmt_operations_async.py | 6 +- ..._security_policies_interface_operations.py | 35 +- ...ity_policies_interface_operations_async.py | 35 +- ...traffic_controller_interface_operations.py | 64 +- ...c_controller_interface_operations_async.py | 64 +- .../tsp-location.yaml | 4 + 61 files changed, 9512 insertions(+), 8059 deletions(-) rename sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/{_service_networking_mgmt_client.py => _client.py} (84%) create mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_model_base.py create mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_validation.py rename sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/{_service_networking_mgmt_client.py => _client.py} (85%) delete mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_associations_interface_operations.py delete mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_frontends_interface_operations.py delete mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_security_policies_interface_operations.py delete mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_traffic_controller_interface_operations.py rename sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/{_service_networking_mgmt_client_enums.py => _enums.py} (74%) create mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models.py delete mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models_py3.py delete mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_associations_interface_operations.py delete mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_frontends_interface_operations.py delete mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_security_policies_interface_operations.py delete mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_traffic_controller_interface_operations.py create mode 100644 sdk/servicenetworking/azure-mgmt-servicenetworking/tsp-location.yaml diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/CHANGELOG.md b/sdk/servicenetworking/azure-mgmt-servicenetworking/CHANGELOG.md index 84359a026f2e..772e0d537ce1 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/CHANGELOG.md +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/CHANGELOG.md @@ -1,24 +1,44 @@ # Release History -## 1.1.0 (2025-01-20) +## 2.0.0 (2025-01-20) ### Features Added - Client `ServiceNetworkingMgmtClient` added operation group `security_policies_interface` - - Model `TrafficController` added property `security_policies` - - Model `TrafficController` added property `security_policy_configurations` - - Model `TrafficControllerUpdate` added property `security_policy_configurations` + - Model `Association` added property `properties` + - Model `AssociationUpdate` added property `properties` + - Model `Frontend` added property `properties` + - Model `TrafficController` added property `properties` + - Model `TrafficControllerUpdate` added property `properties` + - Added model `AssociationProperties` + - Added model `AssociationUpdateProperties` + - Added model `FrontendProperties` - Added enum `PolicyType` - Added model `SecurityPolicy` - Added model `SecurityPolicyConfigurations` - - Added model `SecurityPolicyConfigurationsUpdate` - - Added model `SecurityPolicyListResult` + - Added model `SecurityPolicyProperties` - Added model `SecurityPolicyUpdate` + - Added model `SecurityPolicyUpdateProperties` + - Added model `TrafficControllerProperties` + - Added model `TrafficControllerUpdateProperties` - Added model `WafPolicy` - - Added model `WafPolicyUpdate` - Added model `WafSecurityPolicy` - - Added model `WafSecurityPolicyUpdate` - - Added model `SecurityPoliciesInterfaceOperations` + - Added operation group `SecurityPoliciesInterfaceOperations` + +### Breaking Changes + + - Model `Association` deleted or renamed its instance variable `association_type` + - Model `Association` deleted or renamed its instance variable `subnet` + - Model `Association` deleted or renamed its instance variable `provisioning_state` + - Model `AssociationUpdate` deleted or renamed its instance variable `association_type` + - Model `AssociationUpdate` deleted or renamed its instance variable `subnet` + - Model `Frontend` deleted or renamed its instance variable `fqdn` + - Model `Frontend` deleted or renamed its instance variable `provisioning_state` + - Model `TrafficController` deleted or renamed its instance variable `configuration_endpoints` + - Model `TrafficController` deleted or renamed its instance variable `frontends` + - Model `TrafficController` deleted or renamed its instance variable `associations` + - Model `TrafficController` deleted or renamed its instance variable `provisioning_state` + - Deleted or renamed model `AssociationSubnetUpdate` ## 1.1.0b1 (2024-09-29) diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/_meta.json b/sdk/servicenetworking/azure-mgmt-servicenetworking/_meta.json index 36c36e6c089b..9edd48b5d392 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/_meta.json +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/_meta.json @@ -1,11 +1,6 @@ { - "commit": "64f6997950d8bee63f314563cedaa20148db2186", + "commit": "ae6e92d62421bfafa2b695d742f3820d5de204eb", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.27.2", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/servicenetworking/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.27.2 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/servicenetworking/resource-manager/readme.md" + "typespec_src": "specification/servicenetworking/ServiceNetworking.Management", + "@azure-tools/typespec-python": "0.38.1" } \ No newline at end of file diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/__init__.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/__init__.py index 92dbc744cec6..6215ebd1a50a 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/__init__.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._service_networking_mgmt_client import ServiceNetworkingMgmtClient # type: ignore +from ._client import ServiceNetworkingMgmtClient # type: ignore from ._version import VERSION __version__ = VERSION diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_service_networking_mgmt_client.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_client.py similarity index 84% rename from sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_service_networking_mgmt_client.py rename to sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_client.py index 2f3a60c555e2..19bd1b7c6960 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_service_networking_mgmt_client.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_client.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,6 @@ from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy -from . import models as _models from ._configuration import ServiceNetworkingMgmtClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( @@ -33,11 +32,6 @@ class ServiceNetworkingMgmtClient: """Traffic Controller Provider management API. - :ivar operations: Operations operations - :vartype operations: azure.mgmt.servicenetworking.operations.Operations - :ivar traffic_controller_interface: TrafficControllerInterfaceOperations operations - :vartype traffic_controller_interface: - azure.mgmt.servicenetworking.operations.TrafficControllerInterfaceOperations :ivar associations_interface: AssociationsInterfaceOperations operations :vartype associations_interface: azure.mgmt.servicenetworking.operations.AssociationsInterfaceOperations @@ -47,14 +41,19 @@ class ServiceNetworkingMgmtClient: :ivar security_policies_interface: SecurityPoliciesInterfaceOperations operations :vartype security_policies_interface: azure.mgmt.servicenetworking.operations.SecurityPoliciesInterfaceOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar traffic_controller_interface: TrafficControllerInterfaceOperations operations + :vartype traffic_controller_interface: + azure.mgmt.servicenetworking.operations.TrafficControllerInterfaceOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.servicenetworking.operations.Operations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is "2025-01-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -67,8 +66,9 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: + _endpoint = "{endpoint}" self._config = ServiceNetworkingMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs ) _policies = kwargs.pop("policies", None) if _policies is None: @@ -88,16 +88,11 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.traffic_controller_interface = TrafficControllerInterfaceOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.associations_interface = AssociationsInterfaceOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -107,14 +102,18 @@ def __init__( self.security_policies_interface = SecurityPoliciesInterfaceOperations( self._client, self._config, self._serialize, self._deserialize ) + self.traffic_controller_interface = TrafficControllerInterfaceOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = client._send_request(request) + >>> response = client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -127,7 +126,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_configuration.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_configuration.py index b41c19146723..a5574d6848ce 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_configuration.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -23,16 +23,24 @@ class ServiceNetworkingMgmtClientConfiguration: # pylint: disable=too-many-inst Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is "2025-01-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: api_version: str = kwargs.pop("api_version", "2025-01-01") if credential is None: @@ -42,6 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-servicenetworking/{}".format(VERSION)) diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_model_base.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_model_base.py new file mode 100644 index 000000000000..7f73b97b23ef --- /dev/null +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_model_base.py @@ -0,0 +1,1175 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object + def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + return self._data.popitem() + + def clear(self) -> None: + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field( + attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str +) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: typing.Set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) # pylint: disable=no-value-for-parameter + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: typing.Dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: typing.List[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + if annotation._name == "Dict": # pyright: ignore + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value) + except ValueError: + # for unknown value, return raw value + return value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + + @property + def _class_type(self) -> typing.Any: + return getattr(self._type, "args", [None])[0] + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + item = obj.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + return _deserialize(self._type, _serialize(item, self._format), rf=self) + + def __set__(self, obj: Model, value) -> None: + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, typing.List[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[typing.Dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element(tag, prefix=None, ns=None): + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: typing.Dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: typing.List[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_serialization.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_serialization.py index b24ab2885450..670738f0789c 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_serialization.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_serialization.py @@ -185,73 +185,7 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0. - - :param datetime.datetime dt: The datetime - :returns: The offset - :rtype: datetime.timedelta - """ - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation. - - :param datetime.datetime dt: The datetime - :returns: The timestamp representation - :rtype: str - """ - return "Z" - - def dst(self, dt): - """No daylight saving for UTC. - - :param datetime.datetime dt: The datetime - :returns: The daylight saving time - :rtype: datetime.timedelta - """ - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset) -> None: - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? client_api_version: + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and api_version > client_api_version + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_version.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_version.py index 59deb8c7263b..8f2350dd3b0c 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_version.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_version.py @@ -2,8 +2,8 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0" +VERSION = "2.0.0" diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/__init__.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/__init__.py index 2b2bc1048d36..e3e26fced5f6 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/__init__.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._service_networking_mgmt_client import ServiceNetworkingMgmtClient # type: ignore +from ._client import ServiceNetworkingMgmtClient # type: ignore try: from ._patch import __all__ as _patch_all diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_service_networking_mgmt_client.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_client.py similarity index 85% rename from sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_service_networking_mgmt_client.py rename to sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_client.py index 8d82b73b45b0..657c56c35d3b 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_service_networking_mgmt_client.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_client.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,6 @@ from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy -from .. import models as _models from .._serialization import Deserializer, Serializer from ._configuration import ServiceNetworkingMgmtClientConfiguration from .operations import ( @@ -33,11 +32,6 @@ class ServiceNetworkingMgmtClient: """Traffic Controller Provider management API. - :ivar operations: Operations operations - :vartype operations: azure.mgmt.servicenetworking.aio.operations.Operations - :ivar traffic_controller_interface: TrafficControllerInterfaceOperations operations - :vartype traffic_controller_interface: - azure.mgmt.servicenetworking.aio.operations.TrafficControllerInterfaceOperations :ivar associations_interface: AssociationsInterfaceOperations operations :vartype associations_interface: azure.mgmt.servicenetworking.aio.operations.AssociationsInterfaceOperations @@ -47,14 +41,19 @@ class ServiceNetworkingMgmtClient: :ivar security_policies_interface: SecurityPoliciesInterfaceOperations operations :vartype security_policies_interface: azure.mgmt.servicenetworking.aio.operations.SecurityPoliciesInterfaceOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar traffic_controller_interface: TrafficControllerInterfaceOperations operations + :vartype traffic_controller_interface: + azure.mgmt.servicenetworking.aio.operations.TrafficControllerInterfaceOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.servicenetworking.aio.operations.Operations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is "2025-01-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -67,8 +66,9 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: + _endpoint = "{endpoint}" self._config = ServiceNetworkingMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs ) _policies = kwargs.pop("policies", None) if _policies is None: @@ -88,16 +88,11 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.traffic_controller_interface = TrafficControllerInterfaceOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.associations_interface = AssociationsInterfaceOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -107,8 +102,12 @@ def __init__( self.security_policies_interface = SecurityPoliciesInterfaceOperations( self._client, self._config, self._serialize, self._deserialize ) + self.traffic_controller_interface = TrafficControllerInterfaceOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - def _send_request( + def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -116,7 +115,7 @@ def _send_request( >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client._send_request(request) + >>> response = await client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -129,7 +128,11 @@ def _send_request( """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_configuration.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_configuration.py index 917c9be1c455..08554628adc7 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_configuration.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -23,16 +23,24 @@ class ServiceNetworkingMgmtClientConfiguration: # pylint: disable=too-many-inst Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is "2025-01-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: api_version: str = kwargs.pop("api_version", "2025-01-01") if credential is None: @@ -42,6 +50,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-servicenetworking/{}".format(VERSION)) diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/__init__.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/__init__.py index d82c1a8087d3..38a4f6af8bbf 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/__init__.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,22 +12,22 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import AssociationsInterfaceOperations # type: ignore +from ._operations import FrontendsInterfaceOperations # type: ignore +from ._operations import SecurityPoliciesInterfaceOperations # type: ignore +from ._operations import TrafficControllerInterfaceOperations # type: ignore from ._operations import Operations # type: ignore -from ._traffic_controller_interface_operations import TrafficControllerInterfaceOperations # type: ignore -from ._associations_interface_operations import AssociationsInterfaceOperations # type: ignore -from ._frontends_interface_operations import FrontendsInterfaceOperations # type: ignore -from ._security_policies_interface_operations import SecurityPoliciesInterfaceOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "Operations", - "TrafficControllerInterfaceOperations", "AssociationsInterfaceOperations", "FrontendsInterfaceOperations", "SecurityPoliciesInterfaceOperations", + "TrafficControllerInterfaceOperations", + "Operations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_associations_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_associations_interface_operations.py deleted file mode 100644 index c60423159a8e..000000000000 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_associations_interface_operations.py +++ /dev/null @@ -1,683 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._associations_interface_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_traffic_controller_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AssociationsInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicenetworking.aio.ServiceNetworkingMgmtClient`'s - :attr:`associations_interface` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_traffic_controller( - self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Association"]: - """List Association resources by TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: An iterator like instance of either Association or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.Association] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AssociationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_traffic_controller_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AssociationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any - ) -> _models.Association: - """Get a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :return: Association or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Association - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Association] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Association", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - resource: Union[_models.Association, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "Association") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - resource: _models.Association, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Association]: - """Create a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.servicenetworking.models.Association - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Association or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Association] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Association]: - """Create a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Association or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Association] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - resource: Union[_models.Association, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Association]: - """Create a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param resource: Resource create parameters. Is either a Association type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.servicenetworking.models.Association or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Association or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Association] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Association] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Association", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Association].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Association]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - properties: _models.AssociationUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Association: - """Update a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.servicenetworking.models.AssociationUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Association or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Association - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Association: - """Update a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Association or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Association - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - properties: Union[_models.AssociationUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.Association: - """Update a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param properties: The resource properties to be updated. Is either a AssociationUpdate type or - a IO[bytes] type. Required. - :type properties: ~azure.mgmt.servicenetworking.models.AssociationUpdate or IO[bytes] - :return: Association or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Association - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Association] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "AssociationUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Association", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_frontends_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_frontends_interface_operations.py deleted file mode 100644 index 84643d8ebad4..000000000000 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_frontends_interface_operations.py +++ /dev/null @@ -1,682 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._frontends_interface_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_traffic_controller_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class FrontendsInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicenetworking.aio.ServiceNetworkingMgmtClient`'s - :attr:`frontends_interface` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_traffic_controller( - self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Frontend"]: - """List Frontend resources by TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: An iterator like instance of either Frontend or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.Frontend] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.FrontendListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_traffic_controller_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FrontendListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any - ) -> _models.Frontend: - """Get a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :return: Frontend or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Frontend - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Frontend", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - resource: Union[_models.Frontend, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "Frontend") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - resource: _models.Frontend, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Frontend]: - """Create a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.servicenetworking.models.Frontend - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Frontend or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Frontend] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Frontend]: - """Create a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Frontend or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Frontend] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - resource: Union[_models.Frontend, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Frontend]: - """Create a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param resource: Resource create parameters. Is either a Frontend type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.servicenetworking.models.Frontend or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Frontend or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Frontend] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Frontend", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Frontend].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Frontend]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - properties: _models.FrontendUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Frontend: - """Update a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.servicenetworking.models.FrontendUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Frontend or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Frontend - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Frontend: - """Update a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Frontend or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Frontend - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - properties: Union[_models.FrontendUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.Frontend: - """Update a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param properties: The resource properties to be updated. Is either a FrontendUpdate type or a - IO[bytes] type. Required. - :type properties: ~azure.mgmt.servicenetworking.models.FrontendUpdate or IO[bytes] - :return: Frontend or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Frontend - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "FrontendUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Frontend", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_operations.py index 82028445ec87..0d758988cb8e 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_operations.py @@ -1,14 +1,18 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase +import json import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -16,57 +20,711 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ...operations._operations import build_list_request +from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._serialization import Deserializer, Serializer +from ..._validation import api_version_validation +from ...operations._operations import ( + build_associations_interface_create_or_update_request, + build_associations_interface_delete_request, + build_associations_interface_get_request, + build_associations_interface_list_by_traffic_controller_request, + build_associations_interface_update_request, + build_frontends_interface_create_or_update_request, + build_frontends_interface_delete_request, + build_frontends_interface_get_request, + build_frontends_interface_list_by_traffic_controller_request, + build_frontends_interface_update_request, + build_operations_list_request, + build_security_policies_interface_create_or_update_request, + build_security_policies_interface_delete_request, + build_security_policies_interface_get_request, + build_security_policies_interface_list_by_traffic_controller_request, + build_security_policies_interface_update_request, + build_traffic_controller_interface_create_or_update_request, + build_traffic_controller_interface_delete_request, + build_traffic_controller_interface_get_request, + build_traffic_controller_interface_list_by_resource_group_request, + build_traffic_controller_interface_list_by_subscription_request, + build_traffic_controller_interface_update_request, +) +from .._configuration import ServiceNetworkingMgmtClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class Operations: +class AssociationsInterfaceOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.servicenetworking.aio.ServiceNetworkingMgmtClient`'s - :attr:`operations` attribute. + :attr:`associations_interface` attribute. """ - models = _models - def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any + ) -> _models.Association: + """Get a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Association] = kwargs.pop("cls", None) + + _request = build_associations_interface_get_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Association, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: Union[_models.Association, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_associations_interface_create_or_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: _models.Association, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Association]: + """Create a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.servicenetworking.models.Association + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Association. The Association is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Association] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Association]: + """Create a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Association. The Association is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Association] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Association]: + """Create a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Association. The Association is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Association] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: Union[_models.Association, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Association]: + """Create a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param resource: Resource create parameters. Is one of the following types: Association, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.servicenetworking.models.Association or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Association. The Association is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Association] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Association] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Association, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Association].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Association]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + properties: _models.AssociationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Association: + """Update a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.servicenetworking.models.AssociationUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Association: + """Update a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Association: + """Update a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + properties: Union[_models.AssociationUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Association: + """Update a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param properties: The resource properties to be updated. Is one of the following types: + AssociationUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.servicenetworking.models.AssociationUpdate or JSON or IO[bytes] + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Association] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_associations_interface_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Association, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_associations_interface_delete_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """List the operations for the provider. + def list_by_traffic_controller( + self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Association"]: + """List Association resources by TrafficController. - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.Operation] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: An iterator like instance of Association + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.Association] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Association]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -79,12 +737,20 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_associations_interface_list_by_traffic_controller_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -99,16 +765,2453 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Association], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FrontendsInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.servicenetworking.aio.ServiceNetworkingMgmtClient`'s + :attr:`frontends_interface` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any + ) -> _models.Frontend: + """Get a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) + + _request = build_frontends_interface_get_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Frontend, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: Union[_models.Frontend, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_frontends_interface_create_or_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: _models.Frontend, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Frontend]: + """Create a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.servicenetworking.models.Frontend + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Frontend. The Frontend is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Frontend]: + """Create a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Frontend. The Frontend is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Frontend]: + """Create a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Frontend. The Frontend is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: Union[_models.Frontend, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Frontend]: + """Create a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param resource: Resource create parameters. Is one of the following types: Frontend, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.servicenetworking.models.Frontend or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Frontend. The Frontend is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Frontend, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Frontend].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Frontend]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + properties: _models.FrontendUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Frontend: + """Update a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.servicenetworking.models.FrontendUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Frontend: + """Update a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Frontend: + """Update a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + properties: Union[_models.FrontendUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Frontend: + """Update a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param properties: The resource properties to be updated. Is one of the following types: + FrontendUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.servicenetworking.models.FrontendUpdate or JSON or IO[bytes] + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_frontends_interface_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Frontend, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_frontends_interface_delete_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_traffic_controller( + self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Frontend"]: + """List Frontend resources by TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: An iterator like instance of Frontend + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Frontend]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_frontends_interface_list_by_traffic_controller_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Frontend], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SecurityPoliciesInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.servicenetworking.aio.ServiceNetworkingMgmtClient`'s + :attr:`security_policies_interface` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "accept", + ] + }, + ) + async def get( + self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any + ) -> _models.SecurityPolicy: + """Get a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) + + _request = build_security_policies_interface_get_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SecurityPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "content_type", + "accept", + ] + }, + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: Union[_models.SecurityPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_security_policies_interface_create_or_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: _models.SecurityPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityPolicy]: + """Create a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SecurityPolicy. The SecurityPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityPolicy]: + """Create a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SecurityPolicy. The SecurityPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityPolicy]: + """Create a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SecurityPolicy. The SecurityPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "content_type", + "accept", + ] + }, + ) + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: Union[_models.SecurityPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SecurityPolicy]: + """Create a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param resource: Resource create parameters. Is one of the following types: SecurityPolicy, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.servicenetworking.models.SecurityPolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns SecurityPolicy. The SecurityPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SecurityPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SecurityPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SecurityPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + properties: _models.SecurityPolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPolicy: + """Update a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPolicy: + """Update a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPolicy: + """Update a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "content_type", + "accept", + ] + }, + ) + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + properties: Union[_models.SecurityPolicyUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityPolicy: + """Update a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param properties: The resource properties to be updated. Is one of the following types: + SecurityPolicyUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdate or JSON or + IO[bytes] + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_security_policies_interface_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SecurityPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "accept", + ] + }, + ) + async def _delete_initial( + self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_security_policies_interface_delete_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "accept", + ] + }, + ) + async def begin_delete( + self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "accept", + ] + }, + ) + def list_by_traffic_controller( + self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SecurityPolicy"]: + """List SecurityPolicy resources by TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: An iterator like instance of SecurityPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SecurityPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_policies_interface_list_by_traffic_controller_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.SecurityPolicy], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class TrafficControllerInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.servicenetworking.aio.ServiceNetworkingMgmtClient`'s + :attr:`traffic_controller_interface` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any + ) -> _models.TrafficController: + """Get a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) + + _request = build_traffic_controller_interface_get_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.TrafficController, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: Union[_models.TrafficController, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_traffic_controller_interface_create_or_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: _models.TrafficController, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrafficController]: + """Create a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.servicenetworking.models.TrafficController + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TrafficController. The TrafficController is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrafficController]: + """Create a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TrafficController. The TrafficController is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrafficController]: + """Create a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TrafficController. The TrafficController is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: Union[_models.TrafficController, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TrafficController]: + """Create a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param resource: Resource create parameters. Is one of the following types: TrafficController, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.servicenetworking.models.TrafficController or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns TrafficController. The TrafficController is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TrafficController, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TrafficController].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TrafficController]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + properties: _models.TrafficControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TrafficController: + """Update a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TrafficController: + """Update a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TrafficController: + """Update a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + traffic_controller_name: str, + properties: Union[_models.TrafficControllerUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.TrafficController: + """Update a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param properties: The resource properties to be updated. Is one of the following types: + TrafficControllerUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdate or JSON or + IO[bytes] + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_traffic_controller_interface_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.TrafficController, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_traffic_controller_interface_delete_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.TrafficController"]: + """List TrafficController resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of TrafficController + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TrafficController]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_traffic_controller_interface_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.TrafficController], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.TrafficController"]: + """List TrafficController resources by subscription ID. + + :return: An iterator like instance of TrafficController + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TrafficController]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_traffic_controller_interface_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.TrafficController], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.servicenetworking.aio.ServiceNetworkingMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -121,7 +3224,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_security_policies_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_security_policies_interface_operations.py deleted file mode 100644 index 4d335b422d54..000000000000 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_security_policies_interface_operations.py +++ /dev/null @@ -1,683 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._security_policies_interface_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_traffic_controller_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SecurityPoliciesInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicenetworking.aio.ServiceNetworkingMgmtClient`'s - :attr:`security_policies_interface` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_traffic_controller( - self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SecurityPolicy"]: - """List SecurityPolicy resources by TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: An iterator like instance of either SecurityPolicy or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SecurityPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_traffic_controller_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SecurityPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any - ) -> _models.SecurityPolicy: - """Get a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :return: SecurityPolicy or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SecurityPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - resource: Union[_models.SecurityPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "SecurityPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - resource: _models.SecurityPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SecurityPolicy]: - """Create a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SecurityPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SecurityPolicy]: - """Create a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SecurityPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - resource: Union[_models.SecurityPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SecurityPolicy]: - """Create a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param resource: Resource create parameters. Is either a SecurityPolicy type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.servicenetworking.models.SecurityPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SecurityPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SecurityPolicy", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.SecurityPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SecurityPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - properties: _models.SecurityPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SecurityPolicy: - """Update a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SecurityPolicy or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SecurityPolicy: - """Update a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SecurityPolicy or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - properties: Union[_models.SecurityPolicyUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.SecurityPolicy: - """Update a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param properties: The resource properties to be updated. Is either a SecurityPolicyUpdate type - or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdate or IO[bytes] - :return: SecurityPolicy or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "SecurityPolicyUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SecurityPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_traffic_controller_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_traffic_controller_interface_operations.py deleted file mode 100644 index cb1e1e097504..000000000000 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_traffic_controller_interface_operations.py +++ /dev/null @@ -1,731 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._traffic_controller_interface_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class TrafficControllerInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicenetworking.aio.ServiceNetworkingMgmtClient`'s - :attr:`traffic_controller_interface` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.TrafficController"]: - """List TrafficController resources by subscription ID. - - :return: An iterator like instance of either TrafficController or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrafficControllerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TrafficControllerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.TrafficController"]: - """List TrafficController resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either TrafficController or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrafficControllerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TrafficControllerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any - ) -> _models.TrafficController: - """Get a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: TrafficController or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.TrafficController - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TrafficController", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - traffic_controller_name: str, - resource: Union[_models.TrafficController, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "TrafficController") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - resource: _models.TrafficController, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TrafficController]: - """Create a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.servicenetworking.models.TrafficController - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either TrafficController or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TrafficController]: - """Create a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either TrafficController or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - resource: Union[_models.TrafficController, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.TrafficController]: - """Create a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param resource: Resource create parameters. Is either a TrafficController type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.servicenetworking.models.TrafficController or IO[bytes] - :return: An instance of AsyncLROPoller that returns either TrafficController or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("TrafficController", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.TrafficController].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.TrafficController]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - properties: _models.TrafficControllerUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TrafficController: - """Update a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TrafficController or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.TrafficController - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TrafficController: - """Update a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TrafficController or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.TrafficController - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - traffic_controller_name: str, - properties: Union[_models.TrafficControllerUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.TrafficController: - """Update a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param properties: The resource properties to be updated. Is either a TrafficControllerUpdate - type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdate or IO[bytes] - :return: TrafficController or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.TrafficController - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "TrafficControllerUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TrafficController", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/__init__.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/__init__.py index 5ab20dad92aa..c33a93ce923e 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/__init__.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,40 +13,38 @@ from ._patch import * # pylint: disable=unused-wildcard-import -from ._models_py3 import ( # type: ignore +from ._models import ( # type: ignore Association, - AssociationListResult, + AssociationProperties, AssociationSubnet, - AssociationSubnetUpdate, AssociationUpdate, + AssociationUpdateProperties, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, Frontend, - FrontendListResult, + FrontendProperties, FrontendUpdate, Operation, OperationDisplay, - OperationListResult, Resource, ResourceId, SecurityPolicy, SecurityPolicyConfigurations, - SecurityPolicyConfigurationsUpdate, - SecurityPolicyListResult, + SecurityPolicyProperties, SecurityPolicyUpdate, + SecurityPolicyUpdateProperties, SystemData, TrackedResource, TrafficController, - TrafficControllerListResult, + TrafficControllerProperties, TrafficControllerUpdate, + TrafficControllerUpdateProperties, WafPolicy, - WafPolicyUpdate, WafSecurityPolicy, - WafSecurityPolicyUpdate, ) -from ._service_networking_mgmt_client_enums import ( # type: ignore +from ._enums import ( # type: ignore ActionType, AssociationType, CreatedByType, @@ -60,35 +58,33 @@ __all__ = [ "Association", - "AssociationListResult", + "AssociationProperties", "AssociationSubnet", - "AssociationSubnetUpdate", "AssociationUpdate", + "AssociationUpdateProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", "Frontend", - "FrontendListResult", + "FrontendProperties", "FrontendUpdate", "Operation", "OperationDisplay", - "OperationListResult", "Resource", "ResourceId", "SecurityPolicy", "SecurityPolicyConfigurations", - "SecurityPolicyConfigurationsUpdate", - "SecurityPolicyListResult", + "SecurityPolicyProperties", "SecurityPolicyUpdate", + "SecurityPolicyUpdateProperties", "SystemData", "TrackedResource", "TrafficController", - "TrafficControllerListResult", + "TrafficControllerProperties", "TrafficControllerUpdate", + "TrafficControllerUpdateProperties", "WafPolicy", - "WafPolicyUpdate", "WafSecurityPolicy", - "WafSecurityPolicyUpdate", "ActionType", "AssociationType", "CreatedByType", diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_service_networking_mgmt_client_enums.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_enums.py similarity index 74% rename from sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_service_networking_mgmt_client_enums.py rename to sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_enums.py index 109053c8ba82..d024b2fb3980 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_service_networking_mgmt_client_enums.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_enums.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -11,9 +11,12 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" + """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + only APIs. + """ INTERNAL = "Internal" + """Actions are for internal-only APIs.""" class AssociationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -24,12 +27,16 @@ class AssociationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" + """The kind of entity that created the resource.""" USER = "User" + """The entity was created by a user.""" APPLICATION = "Application" + """The entity was created by an application.""" MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" KEY = "Key" + """The entity was created by a key.""" class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -38,8 +45,11 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ USER = "user" + """Indicates the operation is initiated by a user.""" SYSTEM = "system" + """Indicates the operation is initiated by a system.""" USER_SYSTEM = "user,system" + """Indicates the operation is initiated by a user or system.""" class PolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models.py new file mode 100644 index 000000000000..2940c27a0fad --- /dev/null +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models.py @@ -0,0 +1,1048 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .. import _model_base +from .._model_base import rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class Resource(_model_base.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[Dict[str, str]] = rest_field() + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Association(TrackedResource): + """Association Subresource of Traffic Controller. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.servicenetworking.models.AssociationProperties + """ + + properties: Optional["_models.AssociationProperties"] = rest_field() + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.AssociationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AssociationProperties(_model_base.Model): + """Association Properties. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + + :ivar association_type: Association Type. Required. "subnets" + :vartype association_type: str or ~azure.mgmt.servicenetworking.models.AssociationType + :ivar subnet: Association Subnet. + :vartype subnet: ~azure.mgmt.servicenetworking.models.AssociationSubnet + :ivar provisioning_state: Provisioning State of Traffic Controller Association Resource. Known + values are: "Provisioning", "Updating", "Deleting", "Accepted", "Succeeded", "Failed", and + "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.servicenetworking.models.ProvisioningState + """ + + association_type: Union[str, "_models.AssociationType"] = rest_field(name="associationType") + """Association Type. Required. \"subnets\"""" + subnet: Optional["_models.AssociationSubnet"] = rest_field() + """Association Subnet.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning State of Traffic Controller Association Resource. Known values are: + \"Provisioning\", \"Updating\", \"Deleting\", \"Accepted\", \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + @overload + def __init__( + self, + *, + association_type: Union[str, "_models.AssociationType"], + subnet: Optional["_models.AssociationSubnet"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AssociationSubnet(_model_base.Model): + """Association Subnet. + + + :ivar id: Association ID. Required. + :vartype id: str + """ + + id: str = rest_field() + """Association ID. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AssociationUpdate(_model_base.Model): + """The type used for update operations of the Association. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.servicenetworking.models.AssociationUpdateProperties + """ + + tags: Optional[Dict[str, str]] = rest_field() + """Resource tags.""" + properties: Optional["_models.AssociationUpdateProperties"] = rest_field() + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.AssociationUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AssociationUpdateProperties(_model_base.Model): + """The updatable properties of the Association. + + :ivar association_type: Association Type. "subnets" + :vartype association_type: str or ~azure.mgmt.servicenetworking.models.AssociationType + :ivar subnet: Association Subnet. + :vartype subnet: ~azure.mgmt.servicenetworking.models.AssociationSubnet + """ + + association_type: Optional[Union[str, "_models.AssociationType"]] = rest_field(name="associationType") + """Association Type. \"subnets\"""" + subnet: Optional["_models.AssociationSubnet"] = rest_field() + """Association Subnet.""" + + @overload + def __init__( + self, + *, + association_type: Optional[Union[str, "_models.AssociationType"]] = None, + subnet: Optional["_models.AssociationSubnet"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorAdditionalInfo(_model_base.Model): + """The resource management error additional info. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_model_base.Model): + """The error detail. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.servicenetworking.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.servicenetworking.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_model_base.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.servicenetworking.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field() + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Frontend(TrackedResource): + """Frontend Sub Resource of Traffic Controller. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.servicenetworking.models.FrontendProperties + """ + + properties: Optional["_models.FrontendProperties"] = rest_field() + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.FrontendProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FrontendProperties(_model_base.Model): + """Frontend Properties. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar fqdn: The Fully Qualified Domain Name of the DNS record associated to a Traffic + Controller frontend. + :vartype fqdn: str + :ivar provisioning_state: Provisioning State of Traffic Controller Frontend Resource. Known + values are: "Provisioning", "Updating", "Deleting", "Accepted", "Succeeded", "Failed", and + "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.servicenetworking.models.ProvisioningState + """ + + fqdn: Optional[str] = rest_field(visibility=["read"]) + """The Fully Qualified Domain Name of the DNS record associated to a Traffic Controller frontend.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning State of Traffic Controller Frontend Resource. Known values are: \"Provisioning\", + \"Updating\", \"Deleting\", \"Accepted\", \"Succeeded\", \"Failed\", and \"Canceled\".""" + + +class FrontendUpdate(_model_base.Model): + """The type used for update operations of the Frontend. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: Optional[Dict[str, str]] = rest_field() + """Resource tags.""" + + @overload + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_model_base.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.servicenetworking.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.servicenetworking.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.servicenetworking.models.ActionType + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field() + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDisplay(_model_base.Model): + """Localized display information for and operation. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class ResourceId(_model_base.Model): + """Resource ID definition used by parent to reference child resources. + + + :ivar id: Resource ID of child resource. Required. + :vartype id: str + """ + + id: str = rest_field() + """Resource ID of child resource. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecurityPolicy(TrackedResource): + """SecurityPolicy Subresource of Traffic Controller. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyProperties + """ + + properties: Optional["_models.SecurityPolicyProperties"] = rest_field() + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.SecurityPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecurityPolicyConfigurations(_model_base.Model): + """SecurityPolicyConfigurations Subresource of Traffic Controller. + + :ivar waf_security_policy: Contains reference to a WAF-type security policy that is applied at + the Traffic Controller level. + :vartype waf_security_policy: ~azure.mgmt.servicenetworking.models.WafSecurityPolicy + """ + + waf_security_policy: Optional["_models.WafSecurityPolicy"] = rest_field(name="wafSecurityPolicy") + """Contains reference to a WAF-type security policy that is applied at the Traffic Controller + level.""" + + @overload + def __init__( + self, + *, + waf_security_policy: Optional["_models.WafSecurityPolicy"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecurityPolicyProperties(_model_base.Model): + """SecurityPolicy Properties. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar policy_type: Type of the Traffic Controller Security Policy. "waf" + :vartype policy_type: str or ~azure.mgmt.servicenetworking.models.PolicyType + :ivar waf_policy: Web Application Firewall Policy of the Traffic Controller Security Policy. + :vartype waf_policy: ~azure.mgmt.servicenetworking.models.WafPolicy + :ivar provisioning_state: Provisioning State of Traffic Controller SecurityPolicy Resource. + Known values are: "Provisioning", "Updating", "Deleting", "Accepted", "Succeeded", "Failed", + and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.servicenetworking.models.ProvisioningState + """ + + policy_type: Optional[Union[str, "_models.PolicyType"]] = rest_field(name="policyType", visibility=["read"]) + """Type of the Traffic Controller Security Policy. \"waf\"""" + waf_policy: Optional["_models.WafPolicy"] = rest_field(name="wafPolicy") + """Web Application Firewall Policy of the Traffic Controller Security Policy.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning State of Traffic Controller SecurityPolicy Resource. Known values are: + \"Provisioning\", \"Updating\", \"Deleting\", \"Accepted\", \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + @overload + def __init__( + self, + *, + waf_policy: Optional["_models.WafPolicy"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecurityPolicyUpdate(_model_base.Model): + """The type used for update operations of the SecurityPolicy. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdateProperties + """ + + tags: Optional[Dict[str, str]] = rest_field() + """Resource tags.""" + properties: Optional["_models.SecurityPolicyUpdateProperties"] = rest_field() + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.SecurityPolicyUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecurityPolicyUpdateProperties(_model_base.Model): + """The updatable properties of the SecurityPolicy. + + :ivar waf_policy: Web Application Firewall Policy of the Traffic Controller Security Policy. + :vartype waf_policy: ~azure.mgmt.servicenetworking.models.WafPolicy + """ + + waf_policy: Optional["_models.WafPolicy"] = rest_field(name="wafPolicy") + """Web Application Firewall Policy of the Traffic Controller Security Policy.""" + + @overload + def __init__( + self, + *, + waf_policy: Optional["_models.WafPolicy"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemData(_model_base.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.servicenetworking.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.servicenetworking.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy") + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType") + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field(name="lastModifiedBy") + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType") + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339") + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrafficController(TrackedResource): + """Concrete tracked resource types can be created by aliasing this type using a specific property + type. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.servicenetworking.models.TrafficControllerProperties + """ + + properties: Optional["_models.TrafficControllerProperties"] = rest_field() + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.TrafficControllerProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrafficControllerProperties(_model_base.Model): + """Traffic Controller Properties. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar configuration_endpoints: Configuration Endpoints. + :vartype configuration_endpoints: list[str] + :ivar frontends: Frontends References List. + :vartype frontends: list[~azure.mgmt.servicenetworking.models.ResourceId] + :ivar associations: Associations References List. + :vartype associations: list[~azure.mgmt.servicenetworking.models.ResourceId] + :ivar security_policies: Security Policies References List. + :vartype security_policies: list[~azure.mgmt.servicenetworking.models.ResourceId] + :ivar security_policy_configurations: Security Policy Configuration. + :vartype security_policy_configurations: + ~azure.mgmt.servicenetworking.models.SecurityPolicyConfigurations + :ivar provisioning_state: The status of the last operation. Known values are: "Provisioning", + "Updating", "Deleting", "Accepted", "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.servicenetworking.models.ProvisioningState + """ + + configuration_endpoints: Optional[List[str]] = rest_field(name="configurationEndpoints", visibility=["read"]) + """Configuration Endpoints.""" + frontends: Optional[List["_models.ResourceId"]] = rest_field(visibility=["read"]) + """Frontends References List.""" + associations: Optional[List["_models.ResourceId"]] = rest_field(visibility=["read"]) + """Associations References List.""" + security_policies: Optional[List["_models.ResourceId"]] = rest_field(name="securityPolicies", visibility=["read"]) + """Security Policies References List.""" + security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = rest_field( + name="securityPolicyConfigurations" + ) + """Security Policy Configuration.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Provisioning\", \"Updating\", + \"Deleting\", \"Accepted\", \"Succeeded\", \"Failed\", and \"Canceled\".""" + + @overload + def __init__( + self, + *, + security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrafficControllerUpdate(_model_base.Model): + """The type used for update operations of the TrafficController. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdateProperties + """ + + tags: Optional[Dict[str, str]] = rest_field() + """Resource tags.""" + properties: Optional["_models.TrafficControllerUpdateProperties"] = rest_field() + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.TrafficControllerUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrafficControllerUpdateProperties(_model_base.Model): + """The updatable properties of the TrafficController. + + :ivar security_policy_configurations: Security Policy Configuration. + :vartype security_policy_configurations: + ~azure.mgmt.servicenetworking.models.SecurityPolicyConfigurations + """ + + security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = rest_field( + name="securityPolicyConfigurations" + ) + """Security Policy Configuration.""" + + @overload + def __init__( + self, + *, + security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class WafPolicy(_model_base.Model): + """Web Application Firewall Policy. + + + :ivar id: Resource ID of the WAF. Required. + :vartype id: str + """ + + id: str = rest_field() + """Resource ID of the WAF. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class WafSecurityPolicy(_model_base.Model): + """Web Application Firewall Security Policy. + + + :ivar id: Resource ID of the Waf Security Policy. Required. + :vartype id: str + """ + + id: str = rest_field() + """Resource ID of the Waf Security Policy. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models_py3.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models_py3.py deleted file mode 100644 index a0d17e2ac9c9..000000000000 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models_py3.py +++ /dev/null @@ -1,1172 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union - -from .. import _serialization - -if TYPE_CHECKING: - from .. import models as _models - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class Association(TrackedResource): - """Association Subresource of Traffic Controller. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar association_type: Association Type. "subnets" - :vartype association_type: str or ~azure.mgmt.servicenetworking.models.AssociationType - :ivar subnet: Association Subnet. - :vartype subnet: ~azure.mgmt.servicenetworking.models.AssociationSubnet - :ivar provisioning_state: Provisioning State of Traffic Controller Association Resource. Known - values are: "Provisioning", "Updating", "Deleting", "Accepted", "Succeeded", "Failed", and - "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.servicenetworking.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "association_type": {"key": "properties.associationType", "type": "str"}, - "subnet": {"key": "properties.subnet", "type": "AssociationSubnet"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - association_type: Optional[Union[str, "_models.AssociationType"]] = None, - subnet: Optional["_models.AssociationSubnet"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword association_type: Association Type. "subnets" - :paramtype association_type: str or ~azure.mgmt.servicenetworking.models.AssociationType - :keyword subnet: Association Subnet. - :paramtype subnet: ~azure.mgmt.servicenetworking.models.AssociationSubnet - """ - super().__init__(tags=tags, location=location, **kwargs) - self.association_type = association_type - self.subnet = subnet - self.provisioning_state = None - - -class AssociationListResult(_serialization.Model): - """The response of a Association list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The Association items on this page. Required. - :vartype value: list[~azure.mgmt.servicenetworking.models.Association] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Association]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Association"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The Association items on this page. Required. - :paramtype value: list[~azure.mgmt.servicenetworking.models.Association] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class AssociationSubnet(_serialization.Model): - """Association Subnet. - - All required parameters must be populated in order to send to server. - - :ivar id: Association 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: Association ID. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class AssociationSubnetUpdate(_serialization.Model): - """Association Subnet. - - :ivar id: Association ID. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Association ID. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class AssociationUpdate(_serialization.Model): - """The type used for update operations of the Association. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar association_type: Association Type. "subnets" - :vartype association_type: str or ~azure.mgmt.servicenetworking.models.AssociationType - :ivar subnet: Association Subnet. - :vartype subnet: ~azure.mgmt.servicenetworking.models.AssociationSubnetUpdate - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "association_type": {"key": "properties.associationType", "type": "str"}, - "subnet": {"key": "properties.subnet", "type": "AssociationSubnetUpdate"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - association_type: Optional[Union[str, "_models.AssociationType"]] = None, - subnet: Optional["_models.AssociationSubnetUpdate"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword association_type: Association Type. "subnets" - :paramtype association_type: str or ~azure.mgmt.servicenetworking.models.AssociationType - :keyword subnet: Association Subnet. - :paramtype subnet: ~azure.mgmt.servicenetworking.models.AssociationSubnetUpdate - """ - super().__init__(**kwargs) - self.tags = tags - self.association_type = association_type - self.subnet = subnet - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.servicenetworking.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.servicenetworking.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.servicenetworking.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.servicenetworking.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class Frontend(TrackedResource): - """Frontend Sub Resource of Traffic Controller. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar fqdn: The Fully Qualified Domain Name of the DNS record associated to a Traffic - Controller frontend. - :vartype fqdn: str - :ivar provisioning_state: Provisioning State of Traffic Controller Frontend Resource. Known - values are: "Provisioning", "Updating", "Deleting", "Accepted", "Succeeded", "Failed", and - "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.servicenetworking.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "fqdn": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "fqdn": {"key": "properties.fqdn", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(tags=tags, location=location, **kwargs) - self.fqdn = None - self.provisioning_state = None - - -class FrontendListResult(_serialization.Model): - """The response of a Frontend list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The Frontend items on this page. Required. - :vartype value: list[~azure.mgmt.servicenetworking.models.Frontend] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Frontend]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Frontend"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The Frontend items on this page. Required. - :paramtype value: list[~azure.mgmt.servicenetworking.models.Frontend] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class FrontendUpdate(_serialization.Model): - """The type used for update operations of the Frontend. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class Operation(_serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.servicenetworking.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.servicenetworking.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.servicenetworking.models.ActionType - """ - - _validation = { - "name": {"readonly": True}, - "is_data_action": {"readonly": True}, - "origin": {"readonly": True}, - "action_type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "action_type": {"key": "actionType", "type": "str"}, - } - - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.servicenetworking.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(_serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - "provider": {"readonly": True}, - "resource": {"readonly": True}, - "operation": {"readonly": True}, - "description": {"readonly": True}, - } - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link - to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.servicenetworking.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class ResourceId(_serialization.Model): - """Resource ID definition used by parent to reference child resources. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID of child resource. 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: Resource ID of child resource. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class SecurityPolicy(TrackedResource): - """SecurityPolicy Subresource of Traffic Controller. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar policy_type: Type of the Traffic Controller Security Policy. "waf" - :vartype policy_type: str or ~azure.mgmt.servicenetworking.models.PolicyType - :ivar waf_policy: Web Application Firewall Policy of the Traffic Controller Security Policy. - :vartype waf_policy: ~azure.mgmt.servicenetworking.models.WafPolicy - :ivar provisioning_state: Provisioning State of Traffic Controller SecurityPolicy Resource. - Known values are: "Provisioning", "Updating", "Deleting", "Accepted", "Succeeded", "Failed", - and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.servicenetworking.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "policy_type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "policy_type": {"key": "properties.policyType", "type": "str"}, - "waf_policy": {"key": "properties.wafPolicy", "type": "WafPolicy"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - waf_policy: Optional["_models.WafPolicy"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword waf_policy: Web Application Firewall Policy of the Traffic Controller Security Policy. - :paramtype waf_policy: ~azure.mgmt.servicenetworking.models.WafPolicy - """ - super().__init__(tags=tags, location=location, **kwargs) - self.policy_type = None - self.waf_policy = waf_policy - self.provisioning_state = None - - -class SecurityPolicyConfigurations(_serialization.Model): - """SecurityPolicyConfigurations Subresource of Traffic Controller. - - :ivar waf_security_policy: Contains reference to a WAF-type security policy that is applied at - the Traffic Controller level. - :vartype waf_security_policy: ~azure.mgmt.servicenetworking.models.WafSecurityPolicy - """ - - _attribute_map = { - "waf_security_policy": {"key": "wafSecurityPolicy", "type": "WafSecurityPolicy"}, - } - - def __init__(self, *, waf_security_policy: Optional["_models.WafSecurityPolicy"] = None, **kwargs: Any) -> None: - """ - :keyword waf_security_policy: Contains reference to a WAF-type security policy that is applied - at the Traffic Controller level. - :paramtype waf_security_policy: ~azure.mgmt.servicenetworking.models.WafSecurityPolicy - """ - super().__init__(**kwargs) - self.waf_security_policy = waf_security_policy - - -class SecurityPolicyConfigurationsUpdate(_serialization.Model): - """SecurityPolicyConfigurations Subresource of Traffic Controller. - - :ivar waf_security_policy: Contains reference to a WAF-type security policy that is applied at - the Traffic Controller level. - :vartype waf_security_policy: ~azure.mgmt.servicenetworking.models.WafSecurityPolicyUpdate - """ - - _attribute_map = { - "waf_security_policy": {"key": "wafSecurityPolicy", "type": "WafSecurityPolicyUpdate"}, - } - - def __init__( - self, *, waf_security_policy: Optional["_models.WafSecurityPolicyUpdate"] = None, **kwargs: Any - ) -> None: - """ - :keyword waf_security_policy: Contains reference to a WAF-type security policy that is applied - at the Traffic Controller level. - :paramtype waf_security_policy: ~azure.mgmt.servicenetworking.models.WafSecurityPolicyUpdate - """ - super().__init__(**kwargs) - self.waf_security_policy = waf_security_policy - - -class SecurityPolicyListResult(_serialization.Model): - """The response of a SecurityPolicy list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The SecurityPolicy items on this page. Required. - :vartype value: list[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SecurityPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.SecurityPolicy"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The SecurityPolicy items on this page. Required. - :paramtype value: list[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SecurityPolicyUpdate(_serialization.Model): - """The type used for update operations of the SecurityPolicy. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar waf_policy: Web Application Firewall Policy of the Traffic Controller Security Policy. - :vartype waf_policy: ~azure.mgmt.servicenetworking.models.WafPolicyUpdate - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "waf_policy": {"key": "properties.wafPolicy", "type": "WafPolicyUpdate"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - waf_policy: Optional["_models.WafPolicyUpdate"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword waf_policy: Web Application Firewall Policy of the Traffic Controller Security Policy. - :paramtype waf_policy: ~azure.mgmt.servicenetworking.models.WafPolicyUpdate - """ - super().__init__(**kwargs) - self.tags = tags - self.waf_policy = waf_policy - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.servicenetworking.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.servicenetworking.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.servicenetworking.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or ~azure.mgmt.servicenetworking.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TrafficController(TrackedResource): - """Concrete tracked resource types can be created by aliasing this type using a specific property - type. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.servicenetworking.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar configuration_endpoints: Configuration Endpoints. - :vartype configuration_endpoints: list[str] - :ivar frontends: Frontends References List. - :vartype frontends: list[~azure.mgmt.servicenetworking.models.ResourceId] - :ivar associations: Associations References List. - :vartype associations: list[~azure.mgmt.servicenetworking.models.ResourceId] - :ivar security_policies: Security Policies References List. - :vartype security_policies: list[~azure.mgmt.servicenetworking.models.ResourceId] - :ivar security_policy_configurations: Security Policy Configuration. - :vartype security_policy_configurations: - ~azure.mgmt.servicenetworking.models.SecurityPolicyConfigurations - :ivar provisioning_state: The status of the last operation. Known values are: "Provisioning", - "Updating", "Deleting", "Accepted", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.servicenetworking.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "configuration_endpoints": {"readonly": True}, - "frontends": {"readonly": True}, - "associations": {"readonly": True}, - "security_policies": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "configuration_endpoints": {"key": "properties.configurationEndpoints", "type": "[str]"}, - "frontends": {"key": "properties.frontends", "type": "[ResourceId]"}, - "associations": {"key": "properties.associations", "type": "[ResourceId]"}, - "security_policies": {"key": "properties.securityPolicies", "type": "[ResourceId]"}, - "security_policy_configurations": { - "key": "properties.securityPolicyConfigurations", - "type": "SecurityPolicyConfigurations", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword security_policy_configurations: Security Policy Configuration. - :paramtype security_policy_configurations: - ~azure.mgmt.servicenetworking.models.SecurityPolicyConfigurations - """ - super().__init__(tags=tags, location=location, **kwargs) - self.configuration_endpoints = None - self.frontends = None - self.associations = None - self.security_policies = None - self.security_policy_configurations = security_policy_configurations - self.provisioning_state = None - - -class TrafficControllerListResult(_serialization.Model): - """The response of a TrafficController list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The TrafficController items on this page. Required. - :vartype value: list[~azure.mgmt.servicenetworking.models.TrafficController] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[TrafficController]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.TrafficController"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The TrafficController items on this page. Required. - :paramtype value: list[~azure.mgmt.servicenetworking.models.TrafficController] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class TrafficControllerUpdate(_serialization.Model): - """The type used for update operations of the TrafficController. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar security_policy_configurations: Security Policy Configuration. - :vartype security_policy_configurations: - ~azure.mgmt.servicenetworking.models.SecurityPolicyConfigurationsUpdate - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "security_policy_configurations": { - "key": "properties.securityPolicyConfigurations", - "type": "SecurityPolicyConfigurationsUpdate", - }, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - security_policy_configurations: Optional["_models.SecurityPolicyConfigurationsUpdate"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword security_policy_configurations: Security Policy Configuration. - :paramtype security_policy_configurations: - ~azure.mgmt.servicenetworking.models.SecurityPolicyConfigurationsUpdate - """ - super().__init__(**kwargs) - self.tags = tags - self.security_policy_configurations = security_policy_configurations - - -class WafPolicy(_serialization.Model): - """Web Application Firewall Policy. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID of the WAF. 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: Resource ID of the WAF. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class WafPolicyUpdate(_serialization.Model): - """Web Application Firewall Policy. - - :ivar id: Resource ID of the WAF. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Resource ID of the WAF. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class WafSecurityPolicy(_serialization.Model): - """Web Application Firewall Security Policy. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID of the Waf Security Policy. 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: Resource ID of the Waf Security Policy. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class WafSecurityPolicyUpdate(_serialization.Model): - """Web Application Firewall Security Policy. - - :ivar id: Resource ID of the Waf Security Policy. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Resource ID of the Waf Security Policy. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/__init__.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/__init__.py index d82c1a8087d3..38a4f6af8bbf 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/__init__.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,22 +12,22 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import AssociationsInterfaceOperations # type: ignore +from ._operations import FrontendsInterfaceOperations # type: ignore +from ._operations import SecurityPoliciesInterfaceOperations # type: ignore +from ._operations import TrafficControllerInterfaceOperations # type: ignore from ._operations import Operations # type: ignore -from ._traffic_controller_interface_operations import TrafficControllerInterfaceOperations # type: ignore -from ._associations_interface_operations import AssociationsInterfaceOperations # type: ignore -from ._frontends_interface_operations import FrontendsInterfaceOperations # type: ignore -from ._security_policies_interface_operations import SecurityPoliciesInterfaceOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "Operations", - "TrafficControllerInterfaceOperations", "AssociationsInterfaceOperations", "FrontendsInterfaceOperations", "SecurityPoliciesInterfaceOperations", + "TrafficControllerInterfaceOperations", + "Operations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_associations_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_associations_interface_operations.py deleted file mode 100644 index 13a7ab0da7f1..000000000000 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_associations_interface_operations.py +++ /dev/null @@ -1,885 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_traffic_controller_request( - resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, traffic_controller_name: str, association_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "associationName": _SERIALIZER.url( - "association_name", association_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, traffic_controller_name: str, association_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "associationName": _SERIALIZER.url( - "association_name", association_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, traffic_controller_name: str, association_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "associationName": _SERIALIZER.url( - "association_name", association_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, traffic_controller_name: str, association_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "associationName": _SERIALIZER.url( - "association_name", association_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class AssociationsInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient`'s - :attr:`associations_interface` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_traffic_controller( - self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any - ) -> Iterable["_models.Association"]: - """List Association resources by TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: An iterator like instance of either Association or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.Association] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AssociationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_traffic_controller_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AssociationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any - ) -> _models.Association: - """Get a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :return: Association or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Association - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Association] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Association", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - resource: Union[_models.Association, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "Association") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - resource: _models.Association, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Association]: - """Create a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.servicenetworking.models.Association - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Association or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Association] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Association]: - """Create a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Association or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Association] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - resource: Union[_models.Association, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Association]: - """Create a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param resource: Resource create parameters. Is either a Association type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.servicenetworking.models.Association or IO[bytes] - :return: An instance of LROPoller that returns either Association or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Association] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Association] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Association", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Association].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Association]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - properties: _models.AssociationUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Association: - """Update a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.servicenetworking.models.AssociationUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Association or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Association - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Association: - """Update a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Association or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Association - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - association_name: str, - properties: Union[_models.AssociationUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.Association: - """Update a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :param properties: The resource properties to be updated. Is either a AssociationUpdate type or - a IO[bytes] type. Required. - :type properties: ~azure.mgmt.servicenetworking.models.AssociationUpdate or IO[bytes] - :return: Association or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Association - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Association] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "AssociationUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Association", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param association_name: Name of Association. Required. - :type association_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - association_name=association_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_frontends_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_frontends_interface_operations.py deleted file mode 100644 index 0844010348fa..000000000000 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_frontends_interface_operations.py +++ /dev/null @@ -1,882 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_traffic_controller_request( - resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, traffic_controller_name: str, frontend_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "frontendName": _SERIALIZER.url( - "frontend_name", frontend_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, traffic_controller_name: str, frontend_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "frontendName": _SERIALIZER.url( - "frontend_name", frontend_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, traffic_controller_name: str, frontend_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "frontendName": _SERIALIZER.url( - "frontend_name", frontend_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, traffic_controller_name: str, frontend_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "frontendName": _SERIALIZER.url( - "frontend_name", frontend_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class FrontendsInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient`'s - :attr:`frontends_interface` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_traffic_controller( - self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any - ) -> Iterable["_models.Frontend"]: - """List Frontend resources by TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: An iterator like instance of either Frontend or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.Frontend] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.FrontendListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_traffic_controller_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FrontendListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any - ) -> _models.Frontend: - """Get a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :return: Frontend or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Frontend - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Frontend", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - resource: Union[_models.Frontend, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "Frontend") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - resource: _models.Frontend, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Frontend]: - """Create a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.servicenetworking.models.Frontend - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Frontend or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Frontend] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Frontend]: - """Create a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Frontend or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Frontend] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - resource: Union[_models.Frontend, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Frontend]: - """Create a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param resource: Resource create parameters. Is either a Frontend type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.servicenetworking.models.Frontend or IO[bytes] - :return: An instance of LROPoller that returns either Frontend or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Frontend] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Frontend", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Frontend].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Frontend]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - properties: _models.FrontendUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Frontend: - """Update a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.servicenetworking.models.FrontendUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Frontend or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Frontend - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Frontend: - """Update a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Frontend or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Frontend - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - frontend_name: str, - properties: Union[_models.FrontendUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.Frontend: - """Update a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :param properties: The resource properties to be updated. Is either a FrontendUpdate type or a - IO[bytes] type. Required. - :type properties: ~azure.mgmt.servicenetworking.models.FrontendUpdate or IO[bytes] - :return: Frontend or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.Frontend - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "FrontendUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Frontend", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Frontend. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param frontend_name: Frontends. Required. - :type frontend_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - frontend_name=frontend_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_operations.py index d339cb55e89b..0a29bfe45b93 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_operations.py @@ -1,36 +1,48 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase +import json import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ServiceNetworkingMgmtClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._serialization import Deserializer, Serializer +from .._validation import api_version_validation if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -38,7 +50,9 @@ _SERIALIZER.client_side_validation = False -def build_list_request(**kwargs: Any) -> HttpRequest: +def build_associations_interface_get_request( + resource_group_name: str, traffic_controller_name: str, association_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -46,15 +60,3691 @@ def build_list_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.ServiceNetworking/operations") + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "associationName": _SERIALIZER.url("association_name", association_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_associations_interface_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, association_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "associationName": _SERIALIZER.url("association_name", association_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_associations_interface_update_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, association_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "associationName": _SERIALIZER.url("association_name", association_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_associations_interface_delete_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, association_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "associationName": _SERIALIZER.url("association_name", association_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_associations_interface_list_by_traffic_controller_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_frontends_interface_get_request( + resource_group_name: str, traffic_controller_name: str, frontend_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "frontendName": _SERIALIZER.url("frontend_name", frontend_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_frontends_interface_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, frontend_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "frontendName": _SERIALIZER.url("frontend_name", frontend_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_frontends_interface_update_request( + resource_group_name: str, traffic_controller_name: str, frontend_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "frontendName": _SERIALIZER.url("frontend_name", frontend_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_frontends_interface_delete_request( + resource_group_name: str, traffic_controller_name: str, frontend_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "frontendName": _SERIALIZER.url("frontend_name", frontend_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_frontends_interface_list_by_traffic_controller_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_policies_interface_get_request( # pylint: disable=name-too-long + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "securityPolicyName": _SERIALIZER.url("security_policy_name", security_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_policies_interface_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "securityPolicyName": _SERIALIZER.url("security_policy_name", security_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_policies_interface_update_request( # pylint: disable=name-too-long + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "securityPolicyName": _SERIALIZER.url("security_policy_name", security_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_policies_interface_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + "securityPolicyName": _SERIALIZER.url("security_policy_name", security_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_policies_interface_list_by_traffic_controller_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_traffic_controller_interface_get_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_traffic_controller_interface_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_traffic_controller_interface_update_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_traffic_controller_interface_delete_request( # pylint: disable=name-too-long + resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "trafficControllerName": _SERIALIZER.url("traffic_controller_name", traffic_controller_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_traffic_controller_interface_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_traffic_controller_interface_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceNetworking/trafficControllers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_operations_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.ServiceNetworking/operations" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class AssociationsInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient`'s + :attr:`associations_interface` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any + ) -> _models.Association: + """Get a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Association] = kwargs.pop("cls", None) + + _request = build_associations_interface_get_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Association, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: Union[_models.Association, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_associations_interface_create_or_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: _models.Association, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Association]: + """Create a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.servicenetworking.models.Association + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Association. The Association is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Association] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Association]: + """Create a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Association. The Association is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Association] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Association]: + """Create a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Association. The Association is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Association] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + resource: Union[_models.Association, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Association]: + """Create a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param resource: Resource create parameters. Is one of the following types: Association, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.servicenetworking.models.Association or JSON or IO[bytes] + :return: An instance of LROPoller that returns Association. The Association is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Association] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Association] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Association, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Association].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Association]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + properties: _models.AssociationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Association: + """Update a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.servicenetworking.models.AssociationUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Association: + """Update a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Association: + """Update a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + association_name: str, + properties: Union[_models.AssociationUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Association: + """Update a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :param properties: The resource properties to be updated. Is one of the following types: + AssociationUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.servicenetworking.models.AssociationUpdate or JSON or IO[bytes] + :return: Association. The Association is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Association + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Association] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_associations_interface_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Association, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_associations_interface_delete_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, traffic_controller_name: str, association_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a Association. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param association_name: Name of Association. Required. + :type association_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + association_name=association_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_traffic_controller( + self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any + ) -> Iterable["_models.Association"]: + """List Association resources by TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: An iterator like instance of Association + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.Association] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Association]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_associations_interface_list_by_traffic_controller_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Association], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class FrontendsInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient`'s + :attr:`frontends_interface` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any + ) -> _models.Frontend: + """Get a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) + + _request = build_frontends_interface_get_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Frontend, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: Union[_models.Frontend, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_frontends_interface_create_or_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: _models.Frontend, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Frontend]: + """Create a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.servicenetworking.models.Frontend + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Frontend. The Frontend is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Frontend]: + """Create a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Frontend. The Frontend is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Frontend]: + """Create a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Frontend. The Frontend is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + resource: Union[_models.Frontend, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Frontend]: + """Create a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param resource: Resource create parameters. Is one of the following types: Frontend, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.servicenetworking.models.Frontend or JSON or IO[bytes] + :return: An instance of LROPoller that returns Frontend. The Frontend is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Frontend, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Frontend].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Frontend]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + properties: _models.FrontendUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Frontend: + """Update a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.servicenetworking.models.FrontendUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Frontend: + """Update a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Frontend: + """Update a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + frontend_name: str, + properties: Union[_models.FrontendUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Frontend: + """Update a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :param properties: The resource properties to be updated. Is one of the following types: + FrontendUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.servicenetworking.models.FrontendUpdate or JSON or IO[bytes] + :return: Frontend. The Frontend is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.Frontend + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Frontend] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_frontends_interface_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Frontend, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_frontends_interface_delete_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, traffic_controller_name: str, frontend_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a Frontend. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param frontend_name: Frontends. Required. + :type frontend_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + frontend_name=frontend_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_traffic_controller( + self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any + ) -> Iterable["_models.Frontend"]: + """List Frontend resources by TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: An iterator like instance of Frontend + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.Frontend] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Frontend]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_frontends_interface_list_by_traffic_controller_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Frontend], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SecurityPoliciesInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient`'s + :attr:`security_policies_interface` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "accept", + ] + }, + ) + def get( + self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any + ) -> _models.SecurityPolicy: + """Get a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) + + _request = build_security_policies_interface_get_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SecurityPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "content_type", + "accept", + ] + }, + ) + def _create_or_update_initial( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: Union[_models.SecurityPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_security_policies_interface_create_or_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: _models.SecurityPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecurityPolicy]: + """Create a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SecurityPolicy. The SecurityPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecurityPolicy]: + """Create a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SecurityPolicy. The SecurityPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecurityPolicy]: + """Create a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SecurityPolicy. The SecurityPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "content_type", + "accept", + ] + }, + ) + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + resource: Union[_models.SecurityPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SecurityPolicy]: + """Create a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param resource: Resource create parameters. Is one of the following types: SecurityPolicy, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.servicenetworking.models.SecurityPolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns SecurityPolicy. The SecurityPolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SecurityPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SecurityPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SecurityPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + properties: _models.SecurityPolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPolicy: + """Update a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPolicy: + """Update a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SecurityPolicy: + """Update a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "content_type", + "accept", + ] + }, + ) + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + security_policy_name: str, + properties: Union[_models.SecurityPolicyUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SecurityPolicy: + """Update a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :param properties: The resource properties to be updated. Is one of the following types: + SecurityPolicyUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdate or JSON or + IO[bytes] + :return: SecurityPolicy. The SecurityPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_security_policies_interface_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SecurityPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "accept", + ] + }, + ) + def _delete_initial( + self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_security_policies_interface_delete_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "security_policy_name", + "accept", + ] + }, + ) + def begin_delete( + self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a SecurityPolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param security_policy_name: SecurityPolicy. Required. + :type security_policy_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + security_policy_name=security_policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-05-01-preview", + params_added_on={ + "2024-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "traffic_controller_name", + "accept", + ] + }, + ) + def list_by_traffic_controller( + self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any + ) -> Iterable["_models.SecurityPolicy"]: + """List SecurityPolicy resources by TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: An iterator like instance of SecurityPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SecurityPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_policies_interface_list_by_traffic_controller_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.SecurityPolicy], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class TrafficControllerInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient`'s + :attr:`traffic_controller_interface` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any) -> _models.TrafficController: + """Get a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) + + _request = build_traffic_controller_interface_get_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.TrafficController, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: Union[_models.TrafficController, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_traffic_controller_interface_create_or_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: _models.TrafficController, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrafficController]: + """Create a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.servicenetworking.models.TrafficController + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TrafficController. The TrafficController is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrafficController]: + """Create a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TrafficController. The TrafficController is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrafficController]: + """Create a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TrafficController. The TrafficController is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + traffic_controller_name: str, + resource: Union[_models.TrafficController, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TrafficController]: + """Create a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param resource: Resource create parameters. Is one of the following types: TrafficController, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.servicenetworking.models.TrafficController or JSON or IO[bytes] + :return: An instance of LROPoller that returns TrafficController. The TrafficController is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TrafficController, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TrafficController].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TrafficController]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + properties: _models.TrafficControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TrafficController: + """Update a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TrafficController: + """Update a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TrafficController: + """Update a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + traffic_controller_name: str, + properties: Union[_models.TrafficControllerUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.TrafficController: + """Update a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :param properties: The resource properties to be updated. Is one of the following types: + TrafficControllerUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdate or JSON or + IO[bytes] + :return: TrafficController. The TrafficController is compatible with MutableMapping + :rtype: ~azure.mgmt.servicenetworking.models.TrafficController + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_traffic_controller_interface_update_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.TrafficController, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial(self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_traffic_controller_interface_delete_request( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a TrafficController. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param traffic_controller_name: traffic controller name for path. Required. + :type traffic_controller_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + traffic_controller_name=traffic_controller_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.TrafficController"]: + """List TrafficController resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of TrafficController + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TrafficController]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_traffic_controller_interface_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.TrafficController], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.TrafficController"]: + """List TrafficController resources by subscription ID. + + :return: An iterator like instance of TrafficController + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.TrafficController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TrafficController]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_traffic_controller_interface_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.TrafficController], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) class Operations: @@ -67,28 +3757,27 @@ class Operations: :attr:`operations` attribute. """ - models = _models - def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceNetworkingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: """List the operations for the provider. - :return: An iterator like instance of either Operation or the result of cls(response) + :return: An iterator like instance of Operation :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -101,12 +3790,17 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_operations_list_request( + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -121,16 +3815,21 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -143,7 +3842,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_security_policies_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_security_policies_interface_operations.py deleted file mode 100644 index 1f3222cf9956..000000000000 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_security_policies_interface_operations.py +++ /dev/null @@ -1,913 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_traffic_controller_request( - resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "securityPolicyName": _SERIALIZER.url( - "security_policy_name", - security_policy_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "securityPolicyName": _SERIALIZER.url( - "security_policy_name", - security_policy_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "securityPolicyName": _SERIALIZER.url( - "security_policy_name", - security_policy_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - "securityPolicyName": _SERIALIZER.url( - "security_policy_name", - security_policy_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class SecurityPoliciesInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient`'s - :attr:`security_policies_interface` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_traffic_controller( - self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any - ) -> Iterable["_models.SecurityPolicy"]: - """List SecurityPolicy resources by TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: An iterator like instance of either SecurityPolicy or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SecurityPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_traffic_controller_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SecurityPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any - ) -> _models.SecurityPolicy: - """Get a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :return: SecurityPolicy or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SecurityPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - resource: Union[_models.SecurityPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "SecurityPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - resource: _models.SecurityPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SecurityPolicy]: - """Create a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SecurityPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SecurityPolicy]: - """Create a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SecurityPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - resource: Union[_models.SecurityPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SecurityPolicy]: - """Create a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param resource: Resource create parameters. Is either a SecurityPolicy type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.servicenetworking.models.SecurityPolicy or IO[bytes] - :return: An instance of LROPoller that returns either SecurityPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.SecurityPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SecurityPolicy", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SecurityPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SecurityPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - properties: _models.SecurityPolicyUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SecurityPolicy: - """Update a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SecurityPolicy or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SecurityPolicy: - """Update a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SecurityPolicy or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - security_policy_name: str, - properties: Union[_models.SecurityPolicyUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.SecurityPolicy: - """Update a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :param properties: The resource properties to be updated. Is either a SecurityPolicyUpdate type - or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdate or IO[bytes] - :return: SecurityPolicy or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.SecurityPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SecurityPolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "SecurityPolicyUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SecurityPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, traffic_controller_name: str, security_policy_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a SecurityPolicy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param security_policy_name: SecurityPolicy. Required. - :type security_policy_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - security_policy_name=security_policy_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_traffic_controller_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_traffic_controller_interface_operations.py deleted file mode 100644 index 159817120a75..000000000000 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_traffic_controller_interface_operations.py +++ /dev/null @@ -1,926 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceNetworking/trafficControllers" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, traffic_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "trafficControllerName": _SERIALIZER.url( - "traffic_controller_name", - traffic_controller_name, - "str", - pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class TrafficControllerInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient`'s - :attr:`traffic_controller_interface` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.TrafficController"]: - """List TrafficController resources by subscription ID. - - :return: An iterator like instance of either TrafficController or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrafficControllerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TrafficControllerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.TrafficController"]: - """List TrafficController resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either TrafficController or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrafficControllerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TrafficControllerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any) -> _models.TrafficController: - """Get a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: TrafficController or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.TrafficController - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TrafficController", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - traffic_controller_name: str, - resource: Union[_models.TrafficController, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "TrafficController") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - resource: _models.TrafficController, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TrafficController]: - """Create a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.servicenetworking.models.TrafficController - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either TrafficController or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TrafficController]: - """Create a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either TrafficController or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - traffic_controller_name: str, - resource: Union[_models.TrafficController, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.TrafficController]: - """Create a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param resource: Resource create parameters. Is either a TrafficController type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.servicenetworking.models.TrafficController or IO[bytes] - :return: An instance of LROPoller that returns either TrafficController or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicenetworking.models.TrafficController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("TrafficController", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.TrafficController].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.TrafficController]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - properties: _models.TrafficControllerUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TrafficController: - """Update a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TrafficController or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.TrafficController - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TrafficController: - """Update a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TrafficController or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.TrafficController - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - traffic_controller_name: str, - properties: Union[_models.TrafficControllerUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.TrafficController: - """Update a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :param properties: The resource properties to be updated. Is either a TrafficControllerUpdate - type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdate or IO[bytes] - :return: TrafficController or the result of cls(response) - :rtype: ~azure.mgmt.servicenetworking.models.TrafficController - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TrafficController] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "TrafficControllerUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TrafficController", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial(self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, traffic_controller_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a TrafficController. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param traffic_controller_name: traffic controller name for path. Required. - :type traffic_controller_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - traffic_controller_name=traffic_controller_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_delete.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_delete.py index 4bb3049654b7..90a0b30b5b83 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_delete.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_delete.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) client.associations_interface.begin_delete( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationDelete.json +# x-ms-original-file: 2025-01-01/AssociationDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_get.py index 0bd38cf1924a..8dba22a36cef 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_get.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.associations_interface.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationGet.json +# x-ms-original-file: 2025-01-01/AssociationGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_patch.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_patch.py index a9fa4f4d5598..1cf5fa486e08 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_patch.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_patch.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.associations_interface.update( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationPatch.json +# x-ms-original-file: 2025-01-01/AssociationPatch.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_put.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_put.py index 180408109023..2bbb5049f047 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_put.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_put.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.associations_interface.begin_create_or_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationPut.json +# x-ms-original-file: 2025-01-01/AssociationPut.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/associations_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/associations_get.py index b5edd9086360..60dc4f9f3a12 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/associations_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/associations_get.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.associations_interface.list_by_traffic_controller( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationsGet.json +# x-ms-original-file: 2025-01-01/AssociationsGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_delete.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_delete.py index 538a8882233a..981f4ed24cc9 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_delete.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_delete.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) client.frontends_interface.begin_delete( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendDelete.json +# x-ms-original-file: 2025-01-01/FrontendDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_get.py index 2c4d569514ac..30ac693aaf8d 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_get.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.frontends_interface.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendGet.json +# x-ms-original-file: 2025-01-01/FrontendGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_put.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_put.py index 47e76d551e58..5265f4bfc612 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_put.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_put.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.frontends_interface.begin_create_or_update( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendPut.json +# x-ms-original-file: 2025-01-01/FrontendPut.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontends_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontends_get.py index 62248c57ddfe..a3550099baf3 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontends_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontends_get.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.frontends_interface.list_by_traffic_controller( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendsGet.json +# x-ms-original-file: 2025-01-01/FrontendsGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/operations_list.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/operations_list.py index 1354f730e973..5c29ba292e68 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/operations_list.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/operations_list.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/OperationsList.json +# x-ms-original-file: 2025-01-01/OperationsList.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policies_get_list.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policies_get_list.py index 080931a2c0b9..c19a8861e9c0 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policies_get_list.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policies_get_list.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.security_policies_interface.list_by_traffic_controller( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPoliciesGetList.json +# x-ms-original-file: 2025-01-01/SecurityPoliciesGetList.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_delete.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_delete.py index d09c92000e96..de792a814bfa 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_delete.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_delete.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) client.security_policies_interface.begin_delete( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyDelete.json +# x-ms-original-file: 2025-01-01/SecurityPolicyDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_get.py index 5da89dd067af..cbb8719eed79 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_get.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.security_policies_interface.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyGet.json +# x-ms-original-file: 2025-01-01/SecurityPolicyGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_patch.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_patch.py index c3d98566d871..8cd224c5e59d 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_patch.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_patch.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.security_policies_interface.update( @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyPatch.json +# x-ms-original-file: 2025-01-01/SecurityPolicyPatch.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_put.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_put.py index 661bad06b8f0..789d7cd1e75b 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_put.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_put.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.security_policies_interface.begin_create_or_update( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyPut.json +# x-ms-original-file: 2025-01-01/SecurityPolicyPut.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_delete.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_delete.py index 11a6c4669f04..950779c6202e 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_delete.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_delete.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) client.traffic_controller_interface.begin_delete( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerDelete.json +# x-ms-original-file: 2025-01-01/TrafficControllerDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_get.py index 23dc67c3b8ae..e2c97b91a48e 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_get.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.traffic_controller_interface.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerGet.json +# x-ms-original-file: 2025-01-01/TrafficControllerGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_patch.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_patch.py index 5969096d795d..2773208731d2 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_patch.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_patch.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.traffic_controller_interface.update( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerPatch.json +# x-ms-original-file: 2025-01-01/TrafficControllerPatch.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_put.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_put.py index 32ba164053ad..2ad3e045d54e 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_put.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_put.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.traffic_controller_interface.begin_create_or_update( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerPut.json +# x-ms-original-file: 2025-01-01/TrafficControllerPut.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get.py index 3bf62428a9a5..e6d838ff98cf 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.traffic_controller_interface.list_by_resource_group( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllersGet.json +# x-ms-original-file: 2025-01-01/TrafficControllersGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get_list.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get_list.py index d2c8cb26ec1d..9d9d1231a46f 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get_list.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get_list.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = ServiceNetworkingMgmtClient( credential=DefaultAzureCredential(), - subscription_id="subid", + subscription_id="SUBSCRIPTION_ID", ) response = client.traffic_controller_interface.list_by_subscription() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllersGetList.json +# x-ms-original-file: 2025-01-01/TrafficControllersGetList.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/conftest.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/conftest.py index 584f9add7703..716238fbe575 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/conftest.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/conftest.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_associations_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_associations_interface_operations.py index b059fd83e7bf..9ad9ca1ad071 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_associations_interface_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_associations_interface_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestServiceNetworkingMgmtAssociationsInterfaceOperations(AzureMgmtRecorded def setup_method(self, method): self.client = self.create_mgmt_client(ServiceNetworkingMgmtClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_associations_interface_list_by_traffic_controller(self, resource_group): - response = self.client.associations_interface.list_by_traffic_controller( - resource_group_name=resource_group.name, - traffic_controller_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_associations_interface_get(self, resource_group): @@ -37,7 +25,6 @@ def test_associations_interface_get(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", association_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,11 +39,9 @@ def test_associations_interface_begin_create_or_update(self, resource_group): association_name="str", resource={ "location": "str", - "associationType": "str", "id": "str", "name": "str", - "provisioningState": "str", - "subnet": {"id": "str"}, + "properties": {"associationType": "str", "provisioningState": "str", "subnet": {"id": "str"}}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -68,7 +53,6 @@ def test_associations_interface_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -81,8 +65,7 @@ def test_associations_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", association_name="str", - properties={"associationType": "str", "subnet": {"id": "str"}, "tags": {"str": "str"}}, - api_version="2025-01-01", + properties={"properties": {"associationType": "str", "subnet": {"id": "str"}}, "tags": {"str": "str"}}, ) # please add some check logic here by yourself @@ -95,8 +78,18 @@ def test_associations_interface_begin_delete(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", association_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_associations_interface_list_by_traffic_controller(self, resource_group): + response = self.client.associations_interface.list_by_traffic_controller( + resource_group_name=resource_group.name, + traffic_controller_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_associations_interface_operations_async.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_associations_interface_operations_async.py index b6b3e9de0349..ac2620f33da4 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_associations_interface_operations_async.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_associations_interface_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestServiceNetworkingMgmtAssociationsInterfaceOperationsAsync(AzureMgmtRec def setup_method(self, method): self.client = self.create_mgmt_client(ServiceNetworkingMgmtClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_associations_interface_list_by_traffic_controller(self, resource_group): - response = self.client.associations_interface.list_by_traffic_controller( - resource_group_name=resource_group.name, - traffic_controller_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_associations_interface_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_associations_interface_get(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", association_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,11 +41,9 @@ async def test_associations_interface_begin_create_or_update(self, resource_grou association_name="str", resource={ "location": "str", - "associationType": "str", "id": "str", "name": "str", - "provisioningState": "str", - "subnet": {"id": "str"}, + "properties": {"associationType": "str", "provisioningState": "str", "subnet": {"id": "str"}}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -70,7 +55,6 @@ async def test_associations_interface_begin_create_or_update(self, resource_grou "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -84,8 +68,7 @@ async def test_associations_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", association_name="str", - properties={"associationType": "str", "subnet": {"id": "str"}, "tags": {"str": "str"}}, - api_version="2025-01-01", + properties={"properties": {"associationType": "str", "subnet": {"id": "str"}}, "tags": {"str": "str"}}, ) # please add some check logic here by yourself @@ -99,9 +82,19 @@ async def test_associations_interface_begin_delete(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", association_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_associations_interface_list_by_traffic_controller(self, resource_group): + response = self.client.associations_interface.list_by_traffic_controller( + resource_group_name=resource_group.name, + traffic_controller_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations.py index 9aa379d7c253..6a322e010bac 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestServiceNetworkingMgmtFrontendsInterfaceOperations(AzureMgmtRecordedTes def setup_method(self, method): self.client = self.create_mgmt_client(ServiceNetworkingMgmtClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_frontends_interface_list_by_traffic_controller(self, resource_group): - response = self.client.frontends_interface.list_by_traffic_controller( - resource_group_name=resource_group.name, - traffic_controller_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_frontends_interface_get(self, resource_group): @@ -37,7 +25,6 @@ def test_frontends_interface_get(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", frontend_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,10 +39,9 @@ def test_frontends_interface_begin_create_or_update(self, resource_group): frontend_name="str", resource={ "location": "str", - "fqdn": "str", "id": "str", "name": "str", - "provisioningState": "str", + "properties": {"fqdn": "str", "provisioningState": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -67,7 +53,6 @@ def test_frontends_interface_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -81,7 +66,6 @@ def test_frontends_interface_update(self, resource_group): traffic_controller_name="str", frontend_name="str", properties={"tags": {"str": "str"}}, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -94,8 +78,18 @@ def test_frontends_interface_begin_delete(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", frontend_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_frontends_interface_list_by_traffic_controller(self, resource_group): + response = self.client.frontends_interface.list_by_traffic_controller( + resource_group_name=resource_group.name, + traffic_controller_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations_async.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations_async.py index d7d5d65c4112..a6501be8bb9e 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations_async.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestServiceNetworkingMgmtFrontendsInterfaceOperationsAsync(AzureMgmtRecord def setup_method(self, method): self.client = self.create_mgmt_client(ServiceNetworkingMgmtClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_frontends_interface_list_by_traffic_controller(self, resource_group): - response = self.client.frontends_interface.list_by_traffic_controller( - resource_group_name=resource_group.name, - traffic_controller_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_frontends_interface_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_frontends_interface_get(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", frontend_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,10 +41,9 @@ async def test_frontends_interface_begin_create_or_update(self, resource_group): frontend_name="str", resource={ "location": "str", - "fqdn": "str", "id": "str", "name": "str", - "provisioningState": "str", + "properties": {"fqdn": "str", "provisioningState": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -69,7 +55,6 @@ async def test_frontends_interface_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -84,7 +69,6 @@ async def test_frontends_interface_update(self, resource_group): traffic_controller_name="str", frontend_name="str", properties={"tags": {"str": "str"}}, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -98,9 +82,19 @@ async def test_frontends_interface_begin_delete(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", frontend_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_frontends_interface_list_by_traffic_controller(self, resource_group): + response = self.client.frontends_interface.list_by_traffic_controller( + resource_group_name=resource_group.name, + traffic_controller_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_operations.py index 07f0d4cfb15e..d19728f80601 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,9 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2025-01-01", - ) + response = self.client.operations.list() result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_operations_async.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_operations_async.py index bac4e395cf4f..51cebd9bd4c6 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_operations_async.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -22,9 +22,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2025-01-01", - ) + response = self.client.operations.list() result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations.py index c37b5b213b5c..5cfcff1fef2b 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestServiceNetworkingMgmtSecurityPoliciesInterfaceOperations(AzureMgmtReco def setup_method(self, method): self.client = self.create_mgmt_client(ServiceNetworkingMgmtClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_security_policies_interface_list_by_traffic_controller(self, resource_group): - response = self.client.security_policies_interface.list_by_traffic_controller( - resource_group_name=resource_group.name, - traffic_controller_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_security_policies_interface_get(self, resource_group): @@ -37,7 +25,6 @@ def test_security_policies_interface_get(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", security_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,8 +41,7 @@ def test_security_policies_interface_begin_create_or_update(self, resource_group "location": "str", "id": "str", "name": "str", - "policyType": "str", - "provisioningState": "str", + "properties": {"policyType": "str", "provisioningState": "str", "wafPolicy": {"id": "str"}}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -66,9 +52,7 @@ def test_security_policies_interface_begin_create_or_update(self, resource_group }, "tags": {"str": "str"}, "type": "str", - "wafPolicy": {"id": "str"}, }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -81,8 +65,7 @@ def test_security_policies_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", security_policy_name="str", - properties={"tags": {"str": "str"}, "wafPolicy": {"id": "str"}}, - api_version="2025-01-01", + properties={"properties": {"wafPolicy": {"id": "str"}}, "tags": {"str": "str"}}, ) # please add some check logic here by yourself @@ -95,8 +78,18 @@ def test_security_policies_interface_begin_delete(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", security_policy_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_security_policies_interface_list_by_traffic_controller(self, resource_group): + response = self.client.security_policies_interface.list_by_traffic_controller( + resource_group_name=resource_group.name, + traffic_controller_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations_async.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations_async.py index e17f55a4aac3..2d81d8331a1f 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations_async.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestServiceNetworkingMgmtSecurityPoliciesInterfaceOperationsAsync(AzureMgm def setup_method(self, method): self.client = self.create_mgmt_client(ServiceNetworkingMgmtClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_security_policies_interface_list_by_traffic_controller(self, resource_group): - response = self.client.security_policies_interface.list_by_traffic_controller( - resource_group_name=resource_group.name, - traffic_controller_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_security_policies_interface_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_security_policies_interface_get(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", security_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,8 +43,7 @@ async def test_security_policies_interface_begin_create_or_update(self, resource "location": "str", "id": "str", "name": "str", - "policyType": "str", - "provisioningState": "str", + "properties": {"policyType": "str", "provisioningState": "str", "wafPolicy": {"id": "str"}}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -68,9 +54,7 @@ async def test_security_policies_interface_begin_create_or_update(self, resource }, "tags": {"str": "str"}, "type": "str", - "wafPolicy": {"id": "str"}, }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -84,8 +68,7 @@ async def test_security_policies_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", security_policy_name="str", - properties={"tags": {"str": "str"}, "wafPolicy": {"id": "str"}}, - api_version="2025-01-01", + properties={"properties": {"wafPolicy": {"id": "str"}}, "tags": {"str": "str"}}, ) # please add some check logic here by yourself @@ -99,9 +82,19 @@ async def test_security_policies_interface_begin_delete(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", security_policy_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_security_policies_interface_list_by_traffic_controller(self, resource_group): + response = self.client.security_policies_interface.list_by_traffic_controller( + resource_group_name=resource_group.name, + traffic_controller_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations.py index e11697ad0b94..aa8da8b06b0f 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,34 +18,12 @@ class TestServiceNetworkingMgmtTrafficControllerInterfaceOperations(AzureMgmtRec def setup_method(self, method): self.client = self.create_mgmt_client(ServiceNetworkingMgmtClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_traffic_controller_interface_list_by_subscription(self, resource_group): - response = self.client.traffic_controller_interface.list_by_subscription( - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_traffic_controller_interface_list_by_resource_group(self, resource_group): - response = self.client.traffic_controller_interface.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_traffic_controller_interface_get(self, resource_group): response = self.client.traffic_controller_interface.get( resource_group_name=resource_group.name, traffic_controller_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,14 +37,16 @@ def test_traffic_controller_interface_begin_create_or_update(self, resource_grou traffic_controller_name="str", resource={ "location": "str", - "associations": [{"id": "str"}], - "configurationEndpoints": ["str"], - "frontends": [{"id": "str"}], "id": "str", "name": "str", - "provisioningState": "str", - "securityPolicies": [{"id": "str"}], - "securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}, + "properties": { + "associations": [{"id": "str"}], + "configurationEndpoints": ["str"], + "frontends": [{"id": "str"}], + "provisioningState": "str", + "securityPolicies": [{"id": "str"}], + "securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -78,7 +58,6 @@ def test_traffic_controller_interface_begin_create_or_update(self, resource_grou "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -90,8 +69,10 @@ def test_traffic_controller_interface_update(self, resource_group): response = self.client.traffic_controller_interface.update( resource_group_name=resource_group.name, traffic_controller_name="str", - properties={"securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}, "tags": {"str": "str"}}, - api_version="2025-01-01", + properties={ + "properties": {"securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}}, + "tags": {"str": "str"}, + }, ) # please add some check logic here by yourself @@ -103,8 +84,25 @@ def test_traffic_controller_interface_begin_delete(self, resource_group): response = self.client.traffic_controller_interface.begin_delete( resource_group_name=resource_group.name, traffic_controller_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_traffic_controller_interface_list_by_resource_group(self, resource_group): + response = self.client.traffic_controller_interface.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_traffic_controller_interface_list_by_subscription(self, resource_group): + response = self.client.traffic_controller_interface.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations_async.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations_async.py index 08f4c3cc6bb6..b7dc2b3b0f77 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations_async.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,34 +19,12 @@ class TestServiceNetworkingMgmtTrafficControllerInterfaceOperationsAsync(AzureMg def setup_method(self, method): self.client = self.create_mgmt_client(ServiceNetworkingMgmtClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_traffic_controller_interface_list_by_subscription(self, resource_group): - response = self.client.traffic_controller_interface.list_by_subscription( - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_traffic_controller_interface_list_by_resource_group(self, resource_group): - response = self.client.traffic_controller_interface.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_traffic_controller_interface_get(self, resource_group): response = await self.client.traffic_controller_interface.get( resource_group_name=resource_group.name, traffic_controller_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,14 +39,16 @@ async def test_traffic_controller_interface_begin_create_or_update(self, resourc traffic_controller_name="str", resource={ "location": "str", - "associations": [{"id": "str"}], - "configurationEndpoints": ["str"], - "frontends": [{"id": "str"}], "id": "str", "name": "str", - "provisioningState": "str", - "securityPolicies": [{"id": "str"}], - "securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}, + "properties": { + "associations": [{"id": "str"}], + "configurationEndpoints": ["str"], + "frontends": [{"id": "str"}], + "provisioningState": "str", + "securityPolicies": [{"id": "str"}], + "securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -80,7 +60,6 @@ async def test_traffic_controller_interface_begin_create_or_update(self, resourc "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -93,8 +72,10 @@ async def test_traffic_controller_interface_update(self, resource_group): response = await self.client.traffic_controller_interface.update( resource_group_name=resource_group.name, traffic_controller_name="str", - properties={"securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}, "tags": {"str": "str"}}, - api_version="2025-01-01", + properties={ + "properties": {"securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}}, + "tags": {"str": "str"}, + }, ) # please add some check logic here by yourself @@ -107,9 +88,26 @@ async def test_traffic_controller_interface_begin_delete(self, resource_group): await self.client.traffic_controller_interface.begin_delete( resource_group_name=resource_group.name, traffic_controller_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_traffic_controller_interface_list_by_resource_group(self, resource_group): + response = self.client.traffic_controller_interface.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_traffic_controller_interface_list_by_subscription(self, resource_group): + response = self.client.traffic_controller_interface.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/tsp-location.yaml b/sdk/servicenetworking/azure-mgmt-servicenetworking/tsp-location.yaml new file mode 100644 index 000000000000..62ee3451498f --- /dev/null +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/servicenetworking/ServiceNetworking.Management +commit: ae6e92d62421bfafa2b695d742f3820d5de204eb +repo: Azure/azure-rest-api-specs +additionalDirectories: From 4b7bd466245f8132f91b330d2a9f5cb29da26e63 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 22 Jan 2025 09:20:45 -0800 Subject: [PATCH 10/29] Fix urls (#39259) --- sdk/maps/azure-maps-geolocation/README.md | 22 +++++----- .../azure-maps-geolocation/samples/README.md | 6 +-- .../sample_authentication_async.py | 2 +- .../samples/sample_authentication.py | 2 +- sdk/maps/azure-maps-render/README.md | 22 +++++----- .../maps/render/aio/operations/_operations.py | 34 +++++++------- .../maps/render/operations/_operations.py | 34 +++++++------- sdk/maps/azure-maps-render/samples/README.md | 6 +-- .../sample_authentication_async.py | 2 +- .../samples/sample_authentication.py | 2 +- sdk/maps/azure-maps-route/README.md | 22 +++++----- .../maps/route/aio/operations/_operations.py | 44 +++++++++---------- .../azure/maps/route/models/_enums.py | 2 +- .../azure/maps/route/models/_models.py | 6 +-- .../maps/route/operations/_operations.py | 44 +++++++++---------- sdk/maps/azure-maps-route/samples/README.md | 6 +-- .../sample_authentication_async.py | 2 +- .../samples/sample_authentication.py | 2 +- sdk/maps/azure-maps-search/README.md | 22 +++++----- .../maps/search/aio/operations/_operations.py | 12 ++--- .../maps/search/operations/_operations.py | 12 ++--- sdk/maps/azure-maps-search/samples/README.md | 6 +-- sdk/maps/azure-maps-timezone/README.md | 22 +++++----- .../azure/maps/timezone/_patch.py | 2 +- .../azure/maps/timezone/aio/_patch.py | 2 +- .../timezone/aio/operations/_operations.py | 4 +- .../maps/timezone/operations/_operations.py | 4 +- .../azure-maps-timezone/samples/README.md | 6 +-- sdk/maps/azure-maps-weather/README.md | 20 ++++----- .../weather/aio/operations/_operations.py | 26 +++++------ .../maps/weather/operations/_operations.py | 26 +++++------ sdk/maps/azure-maps-weather/samples/README.md | 6 +-- 32 files changed, 215 insertions(+), 215 deletions(-) diff --git a/sdk/maps/azure-maps-geolocation/README.md b/sdk/maps/azure-maps-geolocation/README.md index 1b68db5093cb..8f1034f950a3 100644 --- a/sdk/maps/azure-maps-geolocation/README.md +++ b/sdk/maps/azure-maps-geolocation/README.md @@ -1,9 +1,9 @@ # Azure Maps Geolocation Package client library for Python This package contains a Python SDK for Azure Maps Services for Geolocation. -Read more about Azure Maps Services [here](https://docs.microsoft.com/azure/azure-maps/) +Read more about Azure Maps Services [here](https://learn.microsoft.com/azure/azure-maps/) -[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-geolocation) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/geolocation) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-geolocation) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/geolocation) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## _Disclaimer_ @@ -14,10 +14,10 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites - Python 3.8 or later is required to use this package. -- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys). +- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys). - A deployed Maps Services resource. You can create the resource via [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. -If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://docs.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://docs.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. +If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://learn.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://learn.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. ```bash az maps account create --resource-group --account-name --sku @@ -75,7 +75,7 @@ from azure.mgmt.maps import AzureMapsManagementClient Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal + https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ @@ -242,7 +242,7 @@ Further detail please refer to [Samples Introduction](https://github.com/Azure/a ### Additional documentation -For more extensive documentation on Azure Maps Geolocation, see the [Azure Maps Geolocation documentation](https://docs.microsoft.com/rest/api/maps/geolocation) on docs.microsoft.com. +For more extensive documentation on Azure Maps Geolocation, see the [Azure Maps Geolocation documentation](https://learn.microsoft.com/rest/api/maps/geolocation) on learn.microsoft.com. ## Contributing @@ -256,11 +256,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/identity/azure-identity [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure-key-credential]: https://aka.ms/azsdk/python/core/azurekeycredential [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[register_microsoft_entra_id_app]: https://docs.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 -[maps_authentication_microsoft_entra_id]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication +[register_microsoft_entra_id_app]: https://learn.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 +[maps_authentication_microsoft_entra_id]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication [create_new_application_registration]: https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/AspNetWebAppQuickstartPage/sourceType/docs -[manage_microsoft_entra_id_auth_page]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication -[how_to_manage_authentication]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details +[manage_microsoft_entra_id_auth_page]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication +[how_to_manage_authentication]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details diff --git a/sdk/maps/azure-maps-geolocation/samples/README.md b/sdk/maps/azure-maps-geolocation/samples/README.md index bebbf5b1abd1..cb932954ffe2 100644 --- a/sdk/maps/azure-maps-geolocation/samples/README.md +++ b/sdk/maps/azure-maps-geolocation/samples/README.md @@ -11,7 +11,7 @@ products: These code samples show common scenario operations with the Azure Maps Geolocation client library. -Authenticate the client with a Azure Maps Geolocation [API Key Credential](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys): +Authenticate the client with a Azure Maps Geolocation [API Key Credential](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys): [samples authentication](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/maps/azure-maps-geolocation/samples/sample_authentication.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/maps/azure-maps-geolocation/samples/async_samples/sample_authentication_async.py)) @@ -44,9 +44,9 @@ Then for common Azure Maps Geolocation operations: ## Next steps -Check out the [API reference documentation](https://docs.microsoft.com/rest/api/maps/geolocation) +Check out the [API reference documentation](https://learn.microsoft.com/rest/api/maps/geolocation) to learn more about what you can do with the Azure Maps Geolocation client library. [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure diff --git a/sdk/maps/azure-maps-geolocation/samples/async_samples/sample_authentication_async.py b/sdk/maps/azure-maps-geolocation/samples/async_samples/sample_authentication_async.py index 84f80f62cb69..5af9755df560 100644 --- a/sdk/maps/azure-maps-geolocation/samples/async_samples/sample_authentication_async.py +++ b/sdk/maps/azure-maps-geolocation/samples/async_samples/sample_authentication_async.py @@ -11,7 +11,7 @@ DESCRIPTION: This sample demonstrates how to authenticate with the Azure Maps Geolocation service with an Subscription key. See more details about authentication here: - https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys + https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys USAGE: python sample_authentication_async.py Set the environment variables with your own values before running the sample: diff --git a/sdk/maps/azure-maps-geolocation/samples/sample_authentication.py b/sdk/maps/azure-maps-geolocation/samples/sample_authentication.py index ec5888960591..e5a03d5c2812 100644 --- a/sdk/maps/azure-maps-geolocation/samples/sample_authentication.py +++ b/sdk/maps/azure-maps-geolocation/samples/sample_authentication.py @@ -11,7 +11,7 @@ DESCRIPTION: This sample demonstrates how to authenticate with the Azure Maps Geolocation service with an Subscription key. See more details about authentication here: - https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys + https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys USAGE: python sample_authentication.py Set the environment variables with your own values before running the sample: diff --git a/sdk/maps/azure-maps-render/README.md b/sdk/maps/azure-maps-render/README.md index f79aa47758eb..097f6dd0c8bf 100644 --- a/sdk/maps/azure-maps-render/README.md +++ b/sdk/maps/azure-maps-render/README.md @@ -1,9 +1,9 @@ # Azure Maps Render Package client library for Python This package contains a Python SDK for Azure Maps Services for Render. -Read more about Azure Maps Services [here](https://docs.microsoft.com/azure/azure-maps/) +Read more about Azure Maps Services [here](https://learn.microsoft.com/azure/azure-maps/) -[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-render) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/render) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-render) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/render) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## _Disclaimer_ @@ -14,10 +14,10 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites - Python 3.8 or later is required to use this package. -- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys). +- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys). - A deployed Maps Services resource. You can create the resource via [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. -If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://docs.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://docs.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. +If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://learn.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://learn.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. ```bash az maps account create --resource-group --account-name --sku @@ -75,7 +75,7 @@ from azure.mgmt.maps import AzureMapsManagementClient Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal + https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ @@ -324,7 +324,7 @@ Further detail please refer to [Samples Introduction](https://github.com/Azure/a ### Additional documentation -For more extensive documentation on Azure Maps Render, see the [Azure Maps Render documentation](https://docs.microsoft.com/rest/api/maps/render) on docs.microsoft.com. +For more extensive documentation on Azure Maps Render, see the [Azure Maps Render documentation](https://learn.microsoft.com/rest/api/maps/render) on learn.microsoft.com. ## Contributing @@ -338,11 +338,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/identity/azure-identity [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure-key-credential]: https://aka.ms/azsdk/python/core/azurekeycredential [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[register_microsoft_entra_id_app]: https://docs.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 -[maps_authentication_microsoft_entra_id]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication +[register_microsoft_entra_id_app]: https://learn.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 +[maps_authentication_microsoft_entra_id]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication [create_new_application_registration]: https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/AspNetWebAppQuickstartPage/sourceType/docs -[manage_microsoft_entra_id_auth_page]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication -[how_to_manage_authentication]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details +[manage_microsoft_entra_id_auth_page]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication +[how_to_manage_authentication]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details diff --git a/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/_operations.py b/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/_operations.py index 83fbf01ce633..7d4c58589774 100644 --- a/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/_operations.py +++ b/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/_operations.py @@ -88,7 +88,7 @@ async def get_map_tile( uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using `Azure Maps Creator `_ are generated through the `Tileset Create API - `_. The ready-to-use tilesets + `_. The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. Known values are: "microsoft.base", "microsoft.base.labels", "microsoft.base.hybrid", "microsoft.terra.main", "microsoft.base.road", "microsoft.base.darkgrey", "microsoft.base.labels.road", @@ -103,21 +103,21 @@ async def get_map_tile( :keyword z: Zoom level for the desired tile. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype z: int :keyword x: X coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype x: int :keyword y: Y coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype y: int :keyword time_stamp: The desired date and time of the requested tile. This parameter must be @@ -143,7 +143,7 @@ async def get_map_tile( available for a specific field, default language is used. Please refer to `Supported Languages - `_ for details. Default value + `_ for details. Default value is None. :paramtype language: str :keyword localized_map_view: The View parameter (also called the "user region" parameter) @@ -228,7 +228,7 @@ async def get_map_tileset(self, *, tileset_id: str, **kwargs: Any) -> JSON: uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using `Azure Maps Creator `_ are generated through the `Tileset Create API - `_. The ready-to-use tilesets + `_. The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. Known values are: "microsoft.base", "microsoft.base.labels", "microsoft.base.hybrid", "microsoft.terra.main", "microsoft.base.road", "microsoft.base.darkgrey", "microsoft.base.labels.road", @@ -330,7 +330,7 @@ async def get_map_attribution(self, *, tileset_id: str, zoom: int, bounds: List[ uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using `Azure Maps Creator `_ are generated through the `Tileset Create API - `_. The ready-to-use tilesets + `_. The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. Known values are: "microsoft.base", "microsoft.base.labels", "microsoft.base.hybrid", "microsoft.terra.main", "microsoft.base.road", "microsoft.base.darkgrey", "microsoft.base.labels.road", @@ -424,21 +424,21 @@ async def get_map_state_tile( :keyword z: Zoom level for the desired tile. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype z: int :keyword x: X coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype x: int :keyword y: Y coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype y: int :keyword stateset_id: The stateset id. Required. @@ -721,7 +721,7 @@ async def get_map_static_image( :keyword tileset_id: Map style to be returned. Possible values are microsoft.base.road, microsoft.base.darkgrey, and microsoft.imagery. Default value is set to be microsoft.base.road. For more information, see `Render TilesetId - `_. + `_. Known values are: "microsoft.base", "microsoft.base.labels", "microsoft.base.hybrid", "microsoft.terra.main", "microsoft.base.road", "microsoft.base.darkgrey", "microsoft.base.labels.road", "microsoft.base.labels.darkgrey", "microsoft.base.hybrid.road", @@ -736,14 +736,14 @@ async def get_map_static_image( result. Possible values are microsoft.traffic.relative.main and none. Default value is none, indicating no traffic flow returned. If traffic related tilesetId is provided, will return map image with corresponding traffic layer. For more information, see `Render TilesetId - `_. + `_. Known values are: "microsoft.traffic.relative.main" and "none". Default value is None. :paramtype traffic_layer: str :keyword zoom: Desired zoom level of the map. Support zoom value range from 0-20 (inclusive) for tilesetId being microsoft.base.road or microsoft.base.darkgrey. Support zoom value range from 0-19 (inclusive) for tilesetId being microsoft.imagery. For more information, see `Zoom Levels and Tile Grid - `__. Default + `__. Default value is None. :paramtype zoom: int :keyword center: Coordinates of the center point in double. Format: 'lon,lat'. Longitude range: @@ -774,7 +774,7 @@ async def get_map_static_image( available for a specific field, default language is used. Please refer to `Supported Languages - `_ for details. Default value + `_ for details. Default value is None. :paramtype language: str :keyword localized_map_view: The View parameter (also called the "user region" parameter) @@ -1257,21 +1257,21 @@ async def get_copyright_for_tile( :keyword z: Zoom level for the desired tile. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype z: int :keyword x: X coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype x: int :keyword y: Y coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype y: int :keyword include_text: Yes/no value to exclude textual data from response. Only images and diff --git a/sdk/maps/azure-maps-render/azure/maps/render/operations/_operations.py b/sdk/maps/azure-maps-render/azure/maps/render/operations/_operations.py index 72c90a8405f8..765decc5d0c8 100644 --- a/sdk/maps/azure-maps-render/azure/maps/render/operations/_operations.py +++ b/sdk/maps/azure-maps-render/azure/maps/render/operations/_operations.py @@ -402,7 +402,7 @@ def get_map_tile( uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using `Azure Maps Creator `_ are generated through the `Tileset Create API - `_. The ready-to-use tilesets + `_. The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. Known values are: "microsoft.base", "microsoft.base.labels", "microsoft.base.hybrid", "microsoft.terra.main", "microsoft.base.road", "microsoft.base.darkgrey", "microsoft.base.labels.road", @@ -417,21 +417,21 @@ def get_map_tile( :keyword z: Zoom level for the desired tile. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype z: int :keyword x: X coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype x: int :keyword y: Y coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype y: int :keyword time_stamp: The desired date and time of the requested tile. This parameter must be @@ -457,7 +457,7 @@ def get_map_tile( available for a specific field, default language is used. Please refer to `Supported Languages - `_ for details. Default value + `_ for details. Default value is None. :paramtype language: str :keyword localized_map_view: The View parameter (also called the "user region" parameter) @@ -542,7 +542,7 @@ def get_map_tileset(self, *, tileset_id: str, **kwargs: Any) -> JSON: uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using `Azure Maps Creator `_ are generated through the `Tileset Create API - `_. The ready-to-use tilesets + `_. The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. Known values are: "microsoft.base", "microsoft.base.labels", "microsoft.base.hybrid", "microsoft.terra.main", "microsoft.base.road", "microsoft.base.darkgrey", "microsoft.base.labels.road", @@ -644,7 +644,7 @@ def get_map_attribution(self, *, tileset_id: str, zoom: int, bounds: List[float] uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using `Azure Maps Creator `_ are generated through the `Tileset Create API - `_. The ready-to-use tilesets + `_. The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. Known values are: "microsoft.base", "microsoft.base.labels", "microsoft.base.hybrid", "microsoft.terra.main", "microsoft.base.road", "microsoft.base.darkgrey", "microsoft.base.labels.road", @@ -736,21 +736,21 @@ def get_map_state_tile(self, *, z: int, x: int, y: int, stateset_id: str, **kwar :keyword z: Zoom level for the desired tile. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype z: int :keyword x: X coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype x: int :keyword y: Y coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype y: int :keyword stateset_id: The stateset id. Required. @@ -1034,7 +1034,7 @@ def get_map_static_image( :keyword tileset_id: Map style to be returned. Possible values are microsoft.base.road, microsoft.base.darkgrey, and microsoft.imagery. Default value is set to be microsoft.base.road. For more information, see `Render TilesetId - `_. + `_. Known values are: "microsoft.base", "microsoft.base.labels", "microsoft.base.hybrid", "microsoft.terra.main", "microsoft.base.road", "microsoft.base.darkgrey", "microsoft.base.labels.road", "microsoft.base.labels.darkgrey", "microsoft.base.hybrid.road", @@ -1049,14 +1049,14 @@ def get_map_static_image( result. Possible values are microsoft.traffic.relative.main and none. Default value is none, indicating no traffic flow returned. If traffic related tilesetId is provided, will return map image with corresponding traffic layer. For more information, see `Render TilesetId - `_. + `_. Known values are: "microsoft.traffic.relative.main" and "none". Default value is None. :paramtype traffic_layer: str :keyword zoom: Desired zoom level of the map. Support zoom value range from 0-20 (inclusive) for tilesetId being microsoft.base.road or microsoft.base.darkgrey. Support zoom value range from 0-19 (inclusive) for tilesetId being microsoft.imagery. For more information, see `Zoom Levels and Tile Grid - `__. Default + `__. Default value is None. :paramtype zoom: int :keyword center: Coordinates of the center point in double. Format: 'lon,lat'. Longitude range: @@ -1087,7 +1087,7 @@ def get_map_static_image( available for a specific field, default language is used. Please refer to `Supported Languages - `_ for details. Default value + `_ for details. Default value is None. :paramtype language: str :keyword localized_map_view: The View parameter (also called the "user region" parameter) @@ -1572,21 +1572,21 @@ def get_copyright_for_tile( :keyword z: Zoom level for the desired tile. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype z: int :keyword x: X coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype x: int :keyword y: Y coordinate of the tile on zoom grid. Value must be in the range [0, 2:code:``zoom`` -1]. Please see `Zoom Levels and Tile Grid - `__ for + `__ for details. Required. :paramtype y: int :keyword include_text: Yes/no value to exclude textual data from response. Only images and diff --git a/sdk/maps/azure-maps-render/samples/README.md b/sdk/maps/azure-maps-render/samples/README.md index 69520a16abeb..8917ef5b8b3d 100644 --- a/sdk/maps/azure-maps-render/samples/README.md +++ b/sdk/maps/azure-maps-render/samples/README.md @@ -11,7 +11,7 @@ products: These code samples show common scenario operations with the Azure Maps Render client library. -Authenticate the client with a Azure Maps Render [API Key Credential](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys): +Authenticate the client with a Azure Maps Render [API Key Credential](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys): [samples authentication](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/maps/azure-maps-render/samples/sample_authentication.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/maps/azure-maps-render/samples/async_samples/sample_authentication_async.py)) @@ -58,9 +58,9 @@ Then for common Azure Maps Render operations: ## Next steps -Check out the [API reference documentation](https://docs.microsoft.com/rest/api/maps/render) +Check out the [API reference documentation](https://learn.microsoft.com/rest/api/maps/render) to learn more about what you can do with the Azure Maps Render client library. [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure diff --git a/sdk/maps/azure-maps-render/samples/async_samples/sample_authentication_async.py b/sdk/maps/azure-maps-render/samples/async_samples/sample_authentication_async.py index a4a7f0979fe4..22a77cd0d0f5 100644 --- a/sdk/maps/azure-maps-render/samples/async_samples/sample_authentication_async.py +++ b/sdk/maps/azure-maps-render/samples/async_samples/sample_authentication_async.py @@ -11,7 +11,7 @@ DESCRIPTION: This sample demonstrates how to authenticate with the Azure Maps Render service with an Subscription key. See more details about authentication here: - https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys + https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys USAGE: python sample_authentication_async.py Set the environment variables with your own values before running the sample: diff --git a/sdk/maps/azure-maps-render/samples/sample_authentication.py b/sdk/maps/azure-maps-render/samples/sample_authentication.py index add4c0f287ba..4b06d91789bd 100644 --- a/sdk/maps/azure-maps-render/samples/sample_authentication.py +++ b/sdk/maps/azure-maps-render/samples/sample_authentication.py @@ -11,7 +11,7 @@ DESCRIPTION: This sample demonstrates how to authenticate with the Azure Maps Render service with an Subscription key. See more details about authentication here: - https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys + https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys USAGE: python sample_authentication.py Set the environment variables with your own values before running the sample: diff --git a/sdk/maps/azure-maps-route/README.md b/sdk/maps/azure-maps-route/README.md index e82520893799..cadd42e1cd17 100644 --- a/sdk/maps/azure-maps-route/README.md +++ b/sdk/maps/azure-maps-route/README.md @@ -1,9 +1,9 @@ # Azure Maps Route Package client library for Python This package contains a Python SDK for Azure Maps Services for Route. -Read more about Azure Maps Services [here](https://docs.microsoft.com/azure/azure-maps/) +Read more about Azure Maps Services [here](https://learn.microsoft.com/azure/azure-maps/) -[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-route) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/route) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-route) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/route) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## _Disclaimer_ @@ -14,10 +14,10 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites - Python 3.8 or later is required to use this package. -- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys). +- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys). - A deployed Maps Services resource. You can create the resource via [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. -If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://docs.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://docs.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. +If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://learn.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://learn.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. ```bash az maps account create --resource-group --account-name --sku @@ -75,7 +75,7 @@ from azure.mgmt.maps import AzureMapsManagementClient Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal + https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ @@ -278,7 +278,7 @@ Further detail please refer to [Samples Introduction](https://github.com/Azure/a ### Additional documentation -For more extensive documentation on Azure Maps Route, see the [Azure Maps Route documentation](https://docs.microsoft.com/rest/api/maps/route) on docs.microsoft.com. +For more extensive documentation on Azure Maps Route, see the [Azure Maps Route documentation](https://learn.microsoft.com/rest/api/maps/route) on learn.microsoft.com. ## Contributing @@ -292,11 +292,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/identity/azure-identity [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure-key-credential]: https://aka.ms/azsdk/python/core/azurekeycredential [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[register_microsoft_entra_id_app]: https://docs.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 -[maps_authentication_microsoft_entra_id]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication +[register_microsoft_entra_id_app]: https://learn.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 +[maps_authentication_microsoft_entra_id]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication [create_new_application_registration]: https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/AspNetWebAppQuickstartPage/sourceType/docs -[manage_microsoft_entra_id_auth_page]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication -[how_to_manage_authentication]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details +[manage_microsoft_entra_id_auth_page]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication +[how_to_manage_authentication]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details diff --git a/sdk/maps/azure-maps-route/azure/maps/route/aio/operations/_operations.py b/sdk/maps/azure-maps-route/azure/maps/route/aio/operations/_operations.py index c38d4fde43b8..a04946db36cc 100644 --- a/sdk/maps/azure-maps-route/azure/maps/route/aio/operations/_operations.py +++ b/sdk/maps/azure-maps-route/azure/maps/route/aio/operations/_operations.py @@ -2019,7 +2019,7 @@ async def get_route_directions( Routing service provides a set of parameters for a detailed description of vehicle-specific Consumption Model. Please check `Consumption Model - `_ for detailed explanation of + `_ for detailed explanation of the concepts and parameters involved. :param format: Desired format of the response. Value can be either *json* or *xml*. Known @@ -2088,7 +2088,7 @@ async def get_route_directions( if that is not available, they are returned in an available language that is close to it. Allowed values are (a subset of) the IETF language tags. The currently supported languages are listed in the `Supported languages section - `_. + `_. Default value: en-GB. Default value is None. :paramtype language: str @@ -2525,7 +2525,7 @@ async def get_route_directions_with_additional_parameters( # pylint: disable=na Routing service provides a set of parameters for a detailed description of a vehicle-specific Consumption Model. Please check `Consumption Model - `_ for detailed explanation of + `_ for detailed explanation of the concepts and parameters involved. :param route_direction_parameters: Used for reconstructing a route and for calculating zero or @@ -2976,7 +2976,7 @@ async def get_route_directions_with_additional_parameters( # pylint: disable=na Routing service provides a set of parameters for a detailed description of a vehicle-specific Consumption Model. Please check `Consumption Model - `_ for detailed explanation of + `_ for detailed explanation of the concepts and parameters involved. :param route_direction_parameters: Used for reconstructing a route and for calculating zero or @@ -3427,7 +3427,7 @@ async def get_route_directions_with_additional_parameters( # pylint: disable=na Routing service provides a set of parameters for a detailed description of a vehicle-specific Consumption Model. Please check `Consumption Model - `_ for detailed explanation of + `_ for detailed explanation of the concepts and parameters involved. :param route_direction_parameters: Used for reconstructing a route and for calculating zero or @@ -3955,7 +3955,7 @@ async def get_route_range( the result of the origin point. The returned polygon can be used for further processing such as `Search Inside Geometry - `_ to search for + `_ to search for POIs within the provided Isochrone. :param format: Desired format of the response. Value can be either *json* or *xml*. Known @@ -4396,7 +4396,7 @@ async def begin_request_route_directions_batch( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -4469,7 +4469,7 @@ async def begin_request_route_directions_batch( A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, path, api-version and subscription-key. It can accept any of the supported *route directions* `URI parameters - `_. The + `_. The string values in the *route directions* query must be properly escaped (e.g. " character should be escaped with ) and it should also be properly URL-encoded. @@ -4517,7 +4517,7 @@ async def begin_request_route_directions_batch( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -4626,7 +4626,7 @@ async def begin_request_route_directions_batch( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -4699,7 +4699,7 @@ async def begin_request_route_directions_batch( A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, path, api-version and subscription-key. It can accept any of the supported *route directions* `URI parameters - `_. The + `_. The string values in the *route directions* query must be properly escaped (e.g. " character should be escaped with ) and it should also be properly URL-encoded. @@ -4747,7 +4747,7 @@ async def begin_request_route_directions_batch( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -4854,7 +4854,7 @@ async def begin_request_route_directions_batch( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -4927,7 +4927,7 @@ async def begin_request_route_directions_batch( A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, path, api-version and subscription-key. It can accept any of the supported *route directions* `URI parameters - `_. The + `_. The string values in the *route directions* query must be properly escaped (e.g. " character should be escaped with ) and it should also be properly URL-encoded. @@ -4975,7 +4975,7 @@ async def begin_request_route_directions_batch( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -5209,7 +5209,7 @@ async def begin_get_route_directions_batch( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -5349,7 +5349,7 @@ async def request_route_directions_batch_sync( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -5383,7 +5383,7 @@ async def request_route_directions_batch_sync( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -5492,7 +5492,7 @@ async def request_route_directions_batch_sync( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -5526,7 +5526,7 @@ async def request_route_directions_batch_sync( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -5633,7 +5633,7 @@ async def request_route_directions_batch_sync( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -5667,7 +5667,7 @@ async def request_route_directions_batch_sync( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in diff --git a/sdk/maps/azure-maps-route/azure/maps/route/models/_enums.py b/sdk/maps/azure-maps-route/azure/maps/route/models/_enums.py index b593003b0131..27ce58d7764d 100644 --- a/sdk/maps/azure-maps-route/azure/maps/route/models/_enums.py +++ b/sdk/maps/azure-maps-route/azure/maps/route/models/_enums.py @@ -35,7 +35,7 @@ class ComputeTravelTime(str, Enum, metaclass=CaseInsensitiveEnumMeta): class DelayMagnitude(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The magnitude of delay caused by the incident. These values correspond to the values of the response field ty of the `Get Traffic Incident Detail API - `_. + `_. """ UNKNOWN = "0" diff --git a/sdk/maps/azure-maps-route/azure/maps/route/models/_models.py b/sdk/maps/azure-maps-route/azure/maps/route/models/_models.py index 00d9baf67265..634780470c6c 100644 --- a/sdk/maps/azure-maps-route/azure/maps/route/models/_models.py +++ b/sdk/maps/azure-maps-route/azure/maps/route/models/_models.py @@ -1078,7 +1078,7 @@ class RouteDirectionParameters(_serialization.Model): * The reference route may contain traffic incidents of type _ROAD\\ *CLOSURE*\\ , which are ignored for the calculation of the reference route's travel time and traffic delay. Please refer to `Supporting Points - `_ # pylint: disable=line-too-long + `_ # pylint: disable=line-too-long for details. :vartype supporting_points: ~azure.maps.route.models.GeoJsonGeometryCollection :ivar avoid_vignette: This is a list of 3-character, ISO 3166-1, alpha-3 country codes of @@ -1133,7 +1133,7 @@ def __init__( * The reference route may contain traffic incidents of type _ROAD\\ *CLOSURE*\\ , which are ignored for the calculation of the reference route's travel time and traffic delay. Please refer to `Supporting Points - `_ # pylint: disable=line-too-long + `_ # pylint: disable=line-too-long for details. :paramtype supporting_points: ~azure.maps.route.models.GeoJsonGeometryCollection :keyword avoid_vignette: This is a list of 3-character, ISO 3166-1, alpha-3 country codes of @@ -2011,7 +2011,7 @@ class RouteSection(_serialization.Model): :vartype delay_in_seconds: int :ivar delay_magnitude: The magnitude of delay caused by the incident. These values correspond to the values of the response field ty of the `Get Traffic Incident Detail API - `_. Known values + `_. Known values are: "0", "1", "2", "3", and "4". :vartype delay_magnitude: str or ~azure.maps.route.models.DelayMagnitude :ivar tec: Details of the traffic event, using definitions in the `TPEG2-TEC diff --git a/sdk/maps/azure-maps-route/azure/maps/route/operations/_operations.py b/sdk/maps/azure-maps-route/azure/maps/route/operations/_operations.py index d23d85be99bb..4b732c4cee27 100644 --- a/sdk/maps/azure-maps-route/azure/maps/route/operations/_operations.py +++ b/sdk/maps/azure-maps-route/azure/maps/route/operations/_operations.py @@ -2817,7 +2817,7 @@ def get_route_directions( Routing service provides a set of parameters for a detailed description of vehicle-specific Consumption Model. Please check `Consumption Model - `_ for detailed explanation of + `_ for detailed explanation of the concepts and parameters involved. :param format: Desired format of the response. Value can be either *json* or *xml*. Known @@ -2886,7 +2886,7 @@ def get_route_directions( if that is not available, they are returned in an available language that is close to it. Allowed values are (a subset of) the IETF language tags. The currently supported languages are listed in the `Supported languages section - `_. + `_. Default value: en-GB. Default value is None. :paramtype language: str @@ -3323,7 +3323,7 @@ def get_route_directions_with_additional_parameters( # pylint: disable=name-too Routing service provides a set of parameters for a detailed description of a vehicle-specific Consumption Model. Please check `Consumption Model - `_ for detailed explanation of + `_ for detailed explanation of the concepts and parameters involved. :param route_direction_parameters: Used for reconstructing a route and for calculating zero or @@ -3771,7 +3771,7 @@ def get_route_directions_with_additional_parameters( # pylint: disable=name-too Routing service provides a set of parameters for a detailed description of a vehicle-specific Consumption Model. Please check `Consumption Model - `_ for detailed explanation of + `_ for detailed explanation of the concepts and parameters involved. :param route_direction_parameters: Used for reconstructing a route and for calculating zero or @@ -4218,7 +4218,7 @@ def get_route_directions_with_additional_parameters( # pylint: disable=name-too Routing service provides a set of parameters for a detailed description of a vehicle-specific Consumption Model. Please check `Consumption Model - `_ for detailed explanation of + `_ for detailed explanation of the concepts and parameters involved. :param route_direction_parameters: Used for reconstructing a route and for calculating zero or @@ -4743,7 +4743,7 @@ def get_route_range( the result of the origin point. The returned polygon can be used for further processing such as `Search Inside Geometry - `_ to search for + `_ to search for POIs within the provided Isochrone. :param format: Desired format of the response. Value can be either *json* or *xml*. Known @@ -5185,7 +5185,7 @@ def begin_request_route_directions_batch( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -5258,7 +5258,7 @@ def begin_request_route_directions_batch( A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, path, api-version and subscription-key. It can accept any of the supported *route directions* `URI parameters - `_. The + `_. The string values in the *route directions* query must be properly escaped (e.g. " character should be escaped with ) and it should also be properly URL-encoded. @@ -5306,7 +5306,7 @@ def begin_request_route_directions_batch( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -5415,7 +5415,7 @@ def begin_request_route_directions_batch( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -5488,7 +5488,7 @@ def begin_request_route_directions_batch( A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, path, api-version and subscription-key. It can accept any of the supported *route directions* `URI parameters - `_. The + `_. The string values in the *route directions* query must be properly escaped (e.g. " character should be escaped with ) and it should also be properly URL-encoded. @@ -5536,7 +5536,7 @@ def begin_request_route_directions_batch( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -5643,7 +5643,7 @@ def begin_request_route_directions_batch( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -5716,7 +5716,7 @@ def begin_request_route_directions_batch( A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, path, api-version and subscription-key. It can accept any of the supported *route directions* `URI parameters - `_. The + `_. The string values in the *route directions* query must be properly escaped (e.g. " character should be escaped with ) and it should also be properly URL-encoded. @@ -5764,7 +5764,7 @@ def begin_request_route_directions_batch( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -5997,7 +5997,7 @@ def begin_get_route_directions_batch( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -6136,7 +6136,7 @@ def request_route_directions_batch_sync( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -6170,7 +6170,7 @@ def request_route_directions_batch_sync( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -6279,7 +6279,7 @@ def request_route_directions_batch_sync( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -6313,7 +6313,7 @@ def request_route_directions_batch_sync( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in @@ -6420,7 +6420,7 @@ def request_route_directions_batch_sync( **Applies to**\\ : see pricing `tiers `_. The Route Directions Batch API sends batches of queries to `Route Directions API - `_ using just a single API + `_ using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to **700** queries and sync API up to **100** queries. @@ -6454,7 +6454,7 @@ def request_route_directions_batch_sync( * `\\ ``RouteDirections`` - `_ - If the + `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in diff --git a/sdk/maps/azure-maps-route/samples/README.md b/sdk/maps/azure-maps-route/samples/README.md index 15d7e7772c12..8f6441df46da 100644 --- a/sdk/maps/azure-maps-route/samples/README.md +++ b/sdk/maps/azure-maps-route/samples/README.md @@ -11,7 +11,7 @@ products: These code samples show common scenario operations with the Azure Maps Route client library. -Authenticate the client with a Azure Maps Route [API Key Credential](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys): +Authenticate the client with a Azure Maps Route [API Key Credential](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys): [samples authentication](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/maps/azure-maps-route/samples/sample_authentication.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/maps/azure-maps-route/samples/async_samples/sample_authentication_async.py)) @@ -53,9 +53,9 @@ Then for common Azure Maps Route operations: ## Next steps -Check out the [API reference documentation](https://docs.microsoft.com/rest/api/maps/route) +Check out the [API reference documentation](https://learn.microsoft.com/rest/api/maps/route) to learn more about what you can do with the Azure Maps Route client library. [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure diff --git a/sdk/maps/azure-maps-route/samples/async_samples/sample_authentication_async.py b/sdk/maps/azure-maps-route/samples/async_samples/sample_authentication_async.py index ea728b2c1d15..5cdb2fb47b9a 100644 --- a/sdk/maps/azure-maps-route/samples/async_samples/sample_authentication_async.py +++ b/sdk/maps/azure-maps-route/samples/async_samples/sample_authentication_async.py @@ -11,7 +11,7 @@ DESCRIPTION: This sample demonstrates how to authenticate with the Azure Maps Route service with an Subscription key. See more details about authentication here: - https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys + https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys USAGE: python sample_authentication_async.py Set the environment variables with your own values before running the sample: diff --git a/sdk/maps/azure-maps-route/samples/sample_authentication.py b/sdk/maps/azure-maps-route/samples/sample_authentication.py index dc17b43da3ba..f2ab1d7e9c00 100644 --- a/sdk/maps/azure-maps-route/samples/sample_authentication.py +++ b/sdk/maps/azure-maps-route/samples/sample_authentication.py @@ -11,7 +11,7 @@ DESCRIPTION: This sample demonstrates how to authenticate with the Azure Maps Route service with an Subscription key. See more details about authentication here: - https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys + https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys USAGE: python sample_authentication.py Set the environment variables with your own values before running the sample: diff --git a/sdk/maps/azure-maps-search/README.md b/sdk/maps/azure-maps-search/README.md index a6c196b9db9d..6442fa8ec4ed 100644 --- a/sdk/maps/azure-maps-search/README.md +++ b/sdk/maps/azure-maps-search/README.md @@ -1,9 +1,9 @@ # Azure Maps Search Package client library for Python This package contains a Python SDK for Azure Maps Services for Search. -Read more about Azure Maps Services [here](https://docs.microsoft.com/azure/azure-maps/) +Read more about Azure Maps Services [here](https://learn.microsoft.com/azure/azure-maps/) -[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-search) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/search) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-search) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/search) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## _Disclaimer_ @@ -14,10 +14,10 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites - Python 3.8 or later is required to use this package. -- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys). +- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys). - A deployed Maps Services resource. You can create the resource via [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. -If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://docs.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://docs.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. +If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://learn.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://learn.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. ```bash az maps account create --resource-group --account-name --sku @@ -75,7 +75,7 @@ from azure.mgmt.maps import AzureMapsManagementClient Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal + https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ @@ -439,7 +439,7 @@ Further detail please refer to [Samples Introduction](https://github.com/Azure/a ### Additional documentation -For more extensive documentation on Azure Maps Search, see the [Azure Maps Search documentation](https://docs.microsoft.com/rest/api/maps/search) on docs.microsoft.com. +For more extensive documentation on Azure Maps Search, see the [Azure Maps Search documentation](https://learn.microsoft.com/rest/api/maps/search) on learn.microsoft.com. ## Contributing @@ -453,11 +453,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/identity/azure-identity [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure-key-credential]: https://aka.ms/azsdk/python/core/azurekeycredential [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[register_microsoft_entra_id_app]: https://docs.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 -[maps_authentication_microsoft_entra_id]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication +[register_microsoft_entra_id_app]: https://learn.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 +[maps_authentication_microsoft_entra_id]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication [create_new_application_registration]: https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/AspNetWebAppQuickstartPage/sourceType/docs -[manage_microsoft_entra_id_auth_page]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication -[how_to_manage_authentication]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details +[manage_microsoft_entra_id_auth_page]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication +[how_to_manage_authentication]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details diff --git a/sdk/maps/azure-maps-search/azure/maps/search/aio/operations/_operations.py b/sdk/maps/azure-maps-search/azure/maps/search/aio/operations/_operations.py index 0c9342562fde..f9e810619ae7 100644 --- a/sdk/maps/azure-maps-search/azure/maps/search/aio/operations/_operations.py +++ b/sdk/maps/azure-maps-search/azure/maps/search/aio/operations/_operations.py @@ -251,7 +251,7 @@ async def get_geocoding_batch(self, body: JSON, *, content_type: str = "applicat results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -308,7 +308,7 @@ async def get_geocoding_batch( results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -363,7 +363,7 @@ async def get_geocoding_batch(self, body: Union[JSON, IO[bytes]], **kwargs: Any) results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -667,7 +667,7 @@ async def get_reverse_geocoding_batch( results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -726,7 +726,7 @@ async def get_reverse_geocoding_batch( results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -783,7 +783,7 @@ async def get_reverse_geocoding_batch(self, body: Union[JSON, IO[bytes]], **kwar results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. diff --git a/sdk/maps/azure-maps-search/azure/maps/search/operations/_operations.py b/sdk/maps/azure-maps-search/azure/maps/search/operations/_operations.py index 336d1825430b..b952e8592ab2 100644 --- a/sdk/maps/azure-maps-search/azure/maps/search/operations/_operations.py +++ b/sdk/maps/azure-maps-search/azure/maps/search/operations/_operations.py @@ -443,7 +443,7 @@ def get_geocoding_batch(self, body: JSON, *, content_type: str = "application/js results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -498,7 +498,7 @@ def get_geocoding_batch(self, body: IO[bytes], *, content_type: str = "applicati results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -553,7 +553,7 @@ def get_geocoding_batch(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JS results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -855,7 +855,7 @@ def get_reverse_geocoding_batch(self, body: JSON, *, content_type: str = "applic results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -914,7 +914,7 @@ def get_reverse_geocoding_batch( results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. @@ -971,7 +971,7 @@ def get_reverse_geocoding_batch(self, body: Union[JSON, IO[bytes]], **kwargs: An results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - * `GeocodingResponse `_ - If the query completed successfully. + * `GeocodingResponse `_ - If the query completed successfully. * ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in this case. diff --git a/sdk/maps/azure-maps-search/samples/README.md b/sdk/maps/azure-maps-search/samples/README.md index e61d68668964..a1fd889607ee 100644 --- a/sdk/maps/azure-maps-search/samples/README.md +++ b/sdk/maps/azure-maps-search/samples/README.md @@ -11,7 +11,7 @@ products: These code samples show common scenario operations with the Azure Maps Search client library. -Authenticate the client with a Azure Maps Search [API Key Credential](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys): +Authenticate the client with a Azure Maps Search [API Key Credential](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys): Then for common Azure Maps Search operations: @@ -51,9 +51,9 @@ Then for common Azure Maps Search operations: ## Next steps -Check out the [API reference documentation](https://docs.microsoft.com/rest/api/maps/search) +Check out the [API reference documentation](https://learn.microsoft.com/rest/api/maps/search) to learn more about what you can do with the Azure Maps Search client library. [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure diff --git a/sdk/maps/azure-maps-timezone/README.md b/sdk/maps/azure-maps-timezone/README.md index 60839afe48e7..e99234b730fe 100644 --- a/sdk/maps/azure-maps-timezone/README.md +++ b/sdk/maps/azure-maps-timezone/README.md @@ -1,9 +1,9 @@ # Azure Maps Timezone Package client library for Python This package contains a Python SDK for Azure Maps Services for Timezone. -Read more about Azure Maps Services [here](https://docs.microsoft.com/azure/azure-maps/) +Read more about Azure Maps Services [here](https://learn.microsoft.com/azure/azure-maps/) -[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-timezone) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/timezone) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-timezone) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/timezone) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## _Disclaimer_ @@ -14,10 +14,10 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites - Python 3.8 or later is required to use this package. -- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys). +- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys). - A deployed Maps Services resource. You can create the resource via [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. -If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://docs.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://docs.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. +If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://learn.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://learn.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. ```bash az maps account create --resource-group --account-name --sku @@ -78,7 +78,7 @@ from azure.mgmt.maps import AzureMapsManagementClient Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal + https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ @@ -407,7 +407,7 @@ Further detail please refer to [Samples Introduction](https://github.com/Azure/a ### Additional documentation -For more extensive documentation on Azure Maps Timezone, see the [Azure Maps Timezone documentation](https://docs.microsoft.com/rest/api/maps/timezone) on docs.microsoft.com. +For more extensive documentation on Azure Maps Timezone, see the [Azure Maps Timezone documentation](https://learn.microsoft.com/rest/api/maps/timezone) on learn.microsoft.com. ## Contributing @@ -421,11 +421,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/identity/azure-identity [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure-key-credential]: https://aka.ms/azsdk/python/core/azurekeycredential [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[register_ms_entra_id_app]: https://docs.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 -[maps_authentication_ms_entra_id]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication +[register_ms_entra_id_app]: https://learn.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 +[maps_authentication_ms_entra_id]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication [create_new_application_registration]: https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/AspNetWebAppQuickstartPage/sourceType/docs -[manage_ms_entra_id_auth_page]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication -[how_to_manage_authentication]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details +[manage_ms_entra_id_auth_page]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication +[how_to_manage_authentication]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details diff --git a/sdk/maps/azure-maps-timezone/azure/maps/timezone/_patch.py b/sdk/maps/azure-maps-timezone/azure/maps/timezone/_patch.py index f74acf5de16c..81c15f488e1f 100644 --- a/sdk/maps/azure-maps-timezone/azure/maps/timezone/_patch.py +++ b/sdk/maps/azure-maps-timezone/azure/maps/timezone/_patch.py @@ -96,7 +96,7 @@ def get_timezone( :paramtype coordinates: list[float] :keyword accept_language: Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in "EN". Please refer to - `Supported Languages `_ for + `Supported Languages `_ for details. Default value is None. :paramtype accept_language: str :keyword options: Options available for types of information diff --git a/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/_patch.py b/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/_patch.py index 1dcd8e004918..408ff679a13d 100644 --- a/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/_patch.py +++ b/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/_patch.py @@ -96,7 +96,7 @@ async def get_timezone( :paramtype coordinates: list[float] :keyword accept_language: Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in "EN". Please refer to - `Supported Languages `_ for + `Supported Languages `_ for details. Default value is None. :paramtype accept_language: str :keyword options: Options available for types of information diff --git a/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/operations/_operations.py b/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/operations/_operations.py index ccaa6f1d3e28..68d3ab5b01ce 100644 --- a/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/operations/_operations.py +++ b/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/operations/_operations.py @@ -83,7 +83,7 @@ async def get_timezone_by_id( :paramtype timezone_id: str :keyword accept_language: Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in "EN". Please refer to - `Supported Languages `_ for + `Supported Languages `_ for details. Default value is None. :paramtype accept_language: str :keyword options: Alternatively, use alias "o". Options available for types of information @@ -238,7 +238,7 @@ async def get_timezone_by_coordinates( :paramtype coordinates: list[float] :keyword accept_language: Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in "EN". Please refer to - `Supported Languages `_ for + `Supported Languages `_ for details. Default value is None. :paramtype accept_language: str :keyword options: Alternatively, use alias "o". Options available for types of information diff --git a/sdk/maps/azure-maps-timezone/azure/maps/timezone/operations/_operations.py b/sdk/maps/azure-maps-timezone/azure/maps/timezone/operations/_operations.py index 569b71cddcd0..90b37affa2e8 100644 --- a/sdk/maps/azure-maps-timezone/azure/maps/timezone/operations/_operations.py +++ b/sdk/maps/azure-maps-timezone/azure/maps/timezone/operations/_operations.py @@ -296,7 +296,7 @@ def get_timezone_by_id( :paramtype timezone_id: str :keyword accept_language: Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in "EN". Please refer to - `Supported Languages `_ for + `Supported Languages `_ for details. Default value is None. :paramtype accept_language: str :keyword options: Alternatively, use alias "o". Options available for types of information @@ -451,7 +451,7 @@ def get_timezone_by_coordinates( :paramtype coordinates: list[float] :keyword accept_language: Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in "EN". Please refer to - `Supported Languages `_ for + `Supported Languages `_ for details. Default value is None. :paramtype accept_language: str :keyword options: Alternatively, use alias "o". Options available for types of information diff --git a/sdk/maps/azure-maps-timezone/samples/README.md b/sdk/maps/azure-maps-timezone/samples/README.md index 670695d27161..85d5f4b6ce95 100644 --- a/sdk/maps/azure-maps-timezone/samples/README.md +++ b/sdk/maps/azure-maps-timezone/samples/README.md @@ -11,7 +11,7 @@ products: These code samples show common scenario operations with the Azure Maps Timezone client library. -Authenticate the client with Azure Maps Timezone [API Key Credential](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys): +Authenticate the client with Azure Maps Timezone [API Key Credential](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys): Then for common Azure Maps Timezone operations: @@ -53,9 +53,9 @@ Then for common Azure Maps Timezone operations: ## Next steps -Check out the [API reference documentation](https://docs.microsoft.com/rest/api/maps/timezone) +Check out the [API reference documentation](https://learn.microsoft.com/rest/api/maps/timezone) to learn more about what you can do with the Azure Maps Timezone client library. [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure diff --git a/sdk/maps/azure-maps-weather/README.md b/sdk/maps/azure-maps-weather/README.md index 628e15dea3aa..48cf24f83a49 100644 --- a/sdk/maps/azure-maps-weather/README.md +++ b/sdk/maps/azure-maps-weather/README.md @@ -1,9 +1,9 @@ # Azure Maps Weather Package client library for Python This package contains a Python SDK for Azure Maps Services for Weather. -Read more about Azure Maps Services [here](https://docs.microsoft.com/azure/azure-maps/) +Read more about Azure Maps Services [here](https://learn.microsoft.com/azure/azure-maps/) -[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-weather) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/weather) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/maps/azure-maps-weather) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/weather) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## _Disclaimer_ @@ -14,10 +14,10 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites - Python 3.8 or later is required to use this package. -- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys). +- An [Azure subscription][azure_subscription] and an [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys). - A deployed Maps Services resource. You can create the resource via [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. -If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://docs.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://docs.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. +If you use Azure CLI, replace `` and `` of your choice, and select a proper [pricing tier](https://learn.microsoft.com/azure/azure-maps/choose-pricing-tier) based on your needs via the `` parameter. Please refer to [this page](https://learn.microsoft.com/cli/azure/maps/account?view=azure-cli-latest#az_maps_account_create) for more details. ```bash az maps account create --resource-group --account-name --sku @@ -746,7 +746,7 @@ Further detail please refer to [Samples Introduction](https://github.com/Azure/a ### Additional documentation -For more extensive documentation on Azure Maps Weather, see the [Azure Maps Weather documentation](https://docs.microsoft.com/rest/api/maps/weather) on docs.microsoft.com. +For more extensive documentation on Azure Maps Weather, see the [Azure Maps Weather documentation](https://learn.microsoft.com/rest/api/maps/weather) on learn.microsoft.com. ## Contributing @@ -760,11 +760,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/identity/azure-identity [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure-key-credential]: https://aka.ms/azsdk/python/core/azurekeycredential [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[register_ms_entra_id_app]: https://docs.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 -[maps_authentication_ms_entra_id]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication +[register_ms_entra_id_app]: https://learn.microsoft.com/powershell/module/Az.Resources/New-AzADApplication?view=azps-8.0.0 +[maps_authentication_ms_entra_id]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication [create_new_application_registration]: https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/AspNetWebAppQuickstartPage/sourceType/docs -[manage_ms_entra_id_auth_page]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication -[how_to_manage_authentication]: https://docs.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details +[manage_ms_entra_id_auth_page]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication +[how_to_manage_authentication]: https://learn.microsoft.com/azure/azure-maps/how-to-manage-authentication#view-authentication-details diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_operations.py b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_operations.py index 6056451517a6..a46924f529ca 100644 --- a/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_operations.py +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_operations.py @@ -124,7 +124,7 @@ async def get_hourly_forecast( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -318,7 +318,7 @@ async def get_minute_forecast( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -465,7 +465,7 @@ async def get_quarter_day_forecast( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -676,7 +676,7 @@ async def get_current_conditions( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -961,7 +961,7 @@ async def get_daily_forecast( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -1245,7 +1245,7 @@ async def get_weather_along_route( every five minutes. The service supplements Azure Maps `Route Service - `__ that allows you to first request a route + `__ that allows you to first request a route between an origin and a destination and use that as an input for Weather Along Route endpoint. In addition, the service supports scenarios to generate weather notifications for waypoints @@ -1255,7 +1255,7 @@ async def get_weather_along_route( notification before the driver reaches that waypoint. The trigger for when to display the notification for a waypoint could be based, for example, - on a `geofence `__\\ , or + on a `geofence `__\\ , or selectable distance to the waypoint. The API covers all regions of the planet except latitudes above Greenland and Antarctica. @@ -1292,7 +1292,7 @@ async def get_weather_along_route( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -1467,7 +1467,7 @@ async def get_severe_weather_alerts( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword details: Return full details for the severe weather alerts. Available values are @@ -1603,7 +1603,7 @@ async def get_daily_indices( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword duration: Specifies for how many days the daily indices are returned. By default, the @@ -2225,7 +2225,7 @@ async def get_current_air_quality( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword include_pollutant_details: Boolean value that returns detailed information about each @@ -2347,7 +2347,7 @@ async def get_air_quality_daily_forecasts( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword duration: Specifies for how many days from now we would like to know about the air @@ -2459,7 +2459,7 @@ async def get_air_quality_hourly_forecasts( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword duration: Specifies for how many hours from now we would like to know about the air diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_operations.py b/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_operations.py index 7c9413863048..151909186843 100644 --- a/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_operations.py +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_operations.py @@ -839,7 +839,7 @@ def get_hourly_forecast( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -1033,7 +1033,7 @@ def get_minute_forecast( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -1180,7 +1180,7 @@ def get_quarter_day_forecast( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -1391,7 +1391,7 @@ def get_current_conditions( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -1676,7 +1676,7 @@ def get_daily_forecast( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -1960,7 +1960,7 @@ def get_weather_along_route( every five minutes. The service supplements Azure Maps `Route Service - `__ that allows you to first request a route + `__ that allows you to first request a route between an origin and a destination and use that as an input for Weather Along Route endpoint. In addition, the service supports scenarios to generate weather notifications for waypoints @@ -1970,7 +1970,7 @@ def get_weather_along_route( notification before the driver reaches that waypoint. The trigger for when to display the notification for a waypoint could be based, for example, - on a `geofence `__\\ , or + on a `geofence `__\\ , or selectable distance to the waypoint. The API covers all regions of the planet except latitudes above Greenland and Antarctica. @@ -2007,7 +2007,7 @@ def get_weather_along_route( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :return: JSON object @@ -2182,7 +2182,7 @@ def get_severe_weather_alerts( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword details: Return full details for the severe weather alerts. Available values are @@ -2318,7 +2318,7 @@ def get_daily_indices( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword duration: Specifies for how many days the daily indices are returned. By default, the @@ -2940,7 +2940,7 @@ def get_current_air_quality( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword include_pollutant_details: Boolean value that returns detailed information about each @@ -3062,7 +3062,7 @@ def get_air_quality_daily_forecasts( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword duration: Specifies for how many days from now we would like to know about the air @@ -3174,7 +3174,7 @@ def get_air_quality_hourly_forecasts( available for a specific field, default language is used. Please refer to `Supported Languages - `__ for details. Default value + `__ for details. Default value is None. :paramtype language: str :keyword duration: Specifies for how many hours from now we would like to know about the air diff --git a/sdk/maps/azure-maps-weather/samples/README.md b/sdk/maps/azure-maps-weather/samples/README.md index 0afb095a56e9..95dabc64f2c0 100644 --- a/sdk/maps/azure-maps-weather/samples/README.md +++ b/sdk/maps/azure-maps-weather/samples/README.md @@ -11,7 +11,7 @@ products: These code samples show common scenario operations with the Azure Maps Weather client library. -Authenticate the client with Azure Maps Weather [API Key Credential](https://docs.microsoft.com/azure/azure-maps/how-to-manage-account-keys): +Authenticate the client with Azure Maps Weather [API Key Credential](https://learn.microsoft.com/azure/azure-maps/how-to-manage-account-keys): Then for common Azure Maps Weather operations: @@ -76,9 +76,9 @@ Then for common Azure Maps Weather operations: ## Next steps -Check out the [API reference documentation](https://docs.microsoft.com/rest/api/maps/weather) +Check out the [API reference documentation](https://learn.microsoft.com/rest/api/maps/weather) to learn more about what you can do with the Azure Maps Weather client library. [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure From 1363c0ddd75d0560688da5eb4ea83bf982e3537f Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 22 Jan 2025 09:20:55 -0800 Subject: [PATCH 11/29] Fix urls (#39251) --- .../azure-containerregistry/README.md | 22 +++++++++---------- .../TROUBLESHOOTING.md | 8 +++---- .../azure-containerregistry/samples/README.md | 6 ++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sdk/containerregistry/azure-containerregistry/README.md b/sdk/containerregistry/azure-containerregistry/README.md index e70242a5cde1..c59453a640bf 100644 --- a/sdk/containerregistry/azure-containerregistry/README.md +++ b/sdk/containerregistry/azure-containerregistry/README.md @@ -57,7 +57,7 @@ client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience=au A **registry** stores Docker images and [OCI Artifacts](https://opencontainers.org/). An image or artifact consists of a **manifest** and **layers**. An image's manifest describes the layers that make up the image, and is uniquely identified by its **digest**. An image can also be "tagged" to give it a human-readable alias. An image or artifact can have zero or more **tags** associated with it, and each tag uniquely identifies the image. A collection of images that share the same name but have different tags, is referred to as a **repository**. -For more information please see [Container Registry Concepts](https://docs.microsoft.com/azure/container-registry/container-registry-concepts). +For more information please see [Container Registry Concepts](https://learn.microsoft.com/azure/container-registry/container-registry-concepts). ## Examples @@ -296,7 +296,7 @@ describes available configurations for retries, logging, transport protocols, an - Go further with azure.containerregistry and our [samples][samples]. - Watch a [demo or deep dive video](https://azure.microsoft.com/resources/videos/index/?service=container-registry). -- Read more about the [Azure Container Registry service](https://docs.microsoft.com/azure/container-registry/container-registry-intro). +- Read more about the [Azure Container Registry service](https://learn.microsoft.com/azure/container-registry/container-registry-intro). ## Contributing @@ -316,15 +316,15 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/containerregistry/azure-containerregistry [package]: https://pypi.org/project/azure-containerregistry/ [docs]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-containerregistry/1.0.0b1/index.html -[rest_docs]: https://docs.microsoft.com/rest/api/containerregistry/ -[product_docs]: https://docs.microsoft.com/azure/container-registry +[rest_docs]: https://learn.microsoft.com/rest/api/containerregistry/ +[product_docs]: https://learn.microsoft.com/azure/container-registry [pip_link]: https://pypi.org -[container_registry_docs]: https://docs.microsoft.com/azure/container-registry/container-registry-intro -[container_registry_create_ps]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-powershell -[container_registry_create_cli]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-azure-cli -[container_registry_create_portal]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-portal -[container_registry_concepts]: https://docs.microsoft.com/azure/container-registry/container-registry-concepts -[azure_cli]: https://docs.microsoft.com/cli/azure +[container_registry_docs]: https://learn.microsoft.com/azure/container-registry/container-registry-intro +[container_registry_create_ps]: https://learn.microsoft.com/azure/container-registry/container-registry-get-started-powershell +[container_registry_create_cli]: https://learn.microsoft.com/azure/container-registry/container-registry-get-started-azure-cli +[container_registry_create_portal]: https://learn.microsoft.com/azure/container-registry/container-registry-get-started-portal +[container_registry_concepts]: https://learn.microsoft.com/azure/container-registry/container-registry-concepts +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ [identity]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/README.md [samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/containerregistry/azure-containerregistry/samples @@ -335,5 +335,5 @@ additional questions or comments. [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs [azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions [python_logging]: https://docs.python.org/3/library/logging.html -[sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/azure-sdk-logging +[sdk_logging_docs]: https://learn.microsoft.com/azure/developer/python/azure-sdk-logging [troubleshooting guide]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/TROUBLESHOOTING.md diff --git a/sdk/containerregistry/azure-containerregistry/TROUBLESHOOTING.md b/sdk/containerregistry/azure-containerregistry/TROUBLESHOOTING.md index e99ab49128fc..f064f732973c 100644 --- a/sdk/containerregistry/azure-containerregistry/TROUBLESHOOTING.md +++ b/sdk/containerregistry/azure-containerregistry/TROUBLESHOOTING.md @@ -72,11 +72,11 @@ s/acr/firewall to grant access."}]} [azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions [python_logging]: https://docs.python.org/3/library/logging.html -[sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/azure-sdk-logging +[sdk_logging_docs]: https://learn.microsoft.com/azure/developer/python/azure-sdk-logging [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs -[anonymous pull access]: https://docs.microsoft.com/azure/container-registry/anonymous-pull-access -[troubleshoot registry login]: https://docs.microsoft.com/azure/container-registry/container-registry-troubleshoot-login +[anonymous pull access]: https://learn.microsoft.com/azure/container-registry/anonymous-pull-access +[troubleshoot registry login]: https://learn.microsoft.com/azure/container-registry/container-registry-troubleshoot-login [defaultazurecredential]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/README.md#authenticate-with-defaultazurecredential [enable client logging]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/TROUBLESHOOTING.md#enable-client-logging [troubleshooting guide]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/TROUBLESHOOTING.md -[troubleshoot network issues with registry]: https://docs.microsoft.com/azure/container-registry/container-registry-troubleshoot-access +[troubleshoot network issues with registry]: https://learn.microsoft.com/azure/container-registry/container-registry-troubleshoot-access diff --git a/sdk/containerregistry/azure-containerregistry/samples/README.md b/sdk/containerregistry/azure-containerregistry/samples/README.md index 01fd1c70421e..5f8502ce13f7 100644 --- a/sdk/containerregistry/azure-containerregistry/samples/README.md +++ b/sdk/containerregistry/azure-containerregistry/samples/README.md @@ -10,7 +10,7 @@ urlFragment: containerregistry-samples # Samples for Azure Container Registry -These code samples show common scenario operations with the Azure Container Registry client library. The code samples assume an environment variable `CONTAINERREGISTRY_ENDPOINT` is set, which includes the name of the login server and the `https://` prefix. For more information on using AAD with Azure Container Registry, please see the service's [Authentication Overview](https://docs.microsoft.com/azure/container-registry/container-registry-authentication). +These code samples show common scenario operations with the Azure Container Registry client library. The code samples assume an environment variable `CONTAINERREGISTRY_ENDPOINT` is set, which includes the name of the login server and the `https://` prefix. For more information on using AAD with Azure Container Registry, please see the service's [Authentication Overview](https://learn.microsoft.com/azure/container-registry/container-registry-authentication). |**File Name**|**Description**| @@ -49,8 +49,8 @@ Check out the [API reference documentation][rest_docs] to learn more about what [azure_sub]: https://azure.microsoft.com/free/ -[rest_docs]: https://docs.microsoft.com/rest/api/containerregistry/ -[container_registry_docs]: https://docs.microsoft.com/azure/container-registry/container-registry-intro +[rest_docs]: https://learn.microsoft.com/rest/api/containerregistry/ +[container_registry_docs]: https://learn.microsoft.com/azure/container-registry/container-registry-intro [hello_world]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/samples/sample_hello_world.py [hello_world_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/samples/sample_hello_world_async.py [delete_tags]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/samples/sample_delete_tags.py From 00fcdab2b2b4ddc98c85c29abfe85e6d47e3f81b Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 22 Jan 2025 09:23:48 -0800 Subject: [PATCH 12/29] fix url (#39255) --- sdk/face/azure-ai-vision-face/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/face/azure-ai-vision-face/README.md b/sdk/face/azure-ai-vision-face/README.md index 40a476f4f6b7..4e745dc8d312 100644 --- a/sdk/face/azure-ai-vision-face/README.md +++ b/sdk/face/azure-ai-vision-face/README.md @@ -486,9 +486,9 @@ additional questions or comments. [how_to_migrate_resource_to_custom_subdomain]: https://learn.microsoft.com/azure/ai-services/cognitive-services-custom-subdomains#how-does-this-impact-existing-resources [azure_sdk_python_azure_key_credential]: https://aka.ms/azsdk/python/core/azurekeycredential [azure_sdk_python_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity -[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[custom_subdomain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [azure_sdk_python_default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal [face_verification]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity#verification [face_identification]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity#identification @@ -502,11 +502,11 @@ additional questions or comments. [python_azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions [face_errors]: https://aka.ms/face-error-codes-and-messages [python_logging]: https://docs.python.org/3/library/logging.html -[sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/sdk/azure-sdk-logging +[sdk_logging_docs]: https://learn.microsoft.com/azure/developer/python/sdk/azure-sdk-logging [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[authenticate_with_token]: https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential From bfff293e173062c689a7a2d1831ca2df7c76b794 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 22 Jan 2025 09:24:25 -0800 Subject: [PATCH 13/29] Fix urls (#39248) --- sdk/communication/CONTRIBUTING.md | 6 ++--- .../README.md | 6 ++--- .../_generated/models/_models.py | 8 +++---- .../communication/callautomation/_models.py | 8 +++---- .../azure-communication-chat/README.md | 6 ++--- .../azure-communication-email/README.md | 8 +++---- .../azure-communication-identity/CHANGELOG.md | 2 +- .../azure-communication-identity/README.md | 4 ++-- .../azure-communication-jobrouter/README.md | 22 +++++++++---------- .../azure-communication-messages/README.md | 4 ++-- ...ication_messages_with_token_credentials.py | 6 ++--- .../CHANGELOG.md | 2 +- .../README.md | 2 +- .../azure-communication-rooms/README.md | 6 ++--- .../azure-communication-sms/README.md | 10 ++++----- 15 files changed, 50 insertions(+), 50 deletions(-) diff --git a/sdk/communication/CONTRIBUTING.md b/sdk/communication/CONTRIBUTING.md index f397962d33b1..c197f60709c2 100644 --- a/sdk/communication/CONTRIBUTING.md +++ b/sdk/communication/CONTRIBUTING.md @@ -43,13 +43,13 @@ If you ran the tests in LIVE mode, you may have noticed that the files inside th The most probable thing is that the managed identity tests will fail at first. This is because we haven't set up any managed identity credentials for the DefaultAzureCredential object inside the tests to reference to. There are multiple ways of creating a managed identity credential. -One of the easiest ways is to install the [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli) and run the `az login` command. If you are listed as a contributor of the resource you are testing against, this should be enough for the DefaultAzureCredential object to get the corresponding Azure Active Directory credentials you need. +One of the easiest ways is to install the [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) and run the `az login` command. If you are listed as a contributor of the resource you are testing against, this should be enough for the DefaultAzureCredential object to get the corresponding Azure Active Directory credentials you need. Another way to authenticate is to set up 3 environment variables called `AZURE_CLIENT_ID`, `AZURE_TENANT_ID` and `AZURE_CLIENT_SECRET` and set their values to the ones from a registered Azure Active Directory application that is linked to the resource you are testing against. -If you are testing against a personal resource, you can check the [Managed Identity Quickstart Guide for ACS](https://docs.microsoft.com/azure/communication-services/quickstarts/managed-identity-from-cli) for an easy ramp-up process. +If you are testing against a personal resource, you can check the [Managed Identity Quickstart Guide for ACS](https://learn.microsoft.com/azure/communication-services/quickstarts/managed-identity-from-cli) for an easy ramp-up process. -For a more in-depth look on how to authenticate using managed identity, refer to the [Azure Identity client library for Python](https://docs.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python) documentation. This document also has more ways for you to authenticate using the DefaultAzureCredential object besides the ones we discussed in this contributing file. +For a more in-depth look on how to authenticate using managed identity, refer to the [Azure Identity client library for Python](https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python) documentation. This document also has more ways for you to authenticate using the DefaultAzureCredential object besides the ones we discussed in this contributing file. ### Running the New-TestResources and Remove-TestResources Scripts diff --git a/sdk/communication/azure-communication-callautomation/README.md b/sdk/communication/azure-communication-callautomation/README.md index 651a74be72ab..88fe3cfd79e7 100644 --- a/sdk/communication/azure-communication-callautomation/README.md +++ b/sdk/communication/azure-communication-callautomation/README.md @@ -108,11 +108,11 @@ additional questions or comments. [overview]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-automation -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview -[azure_cli]: https://docs.microsoft.com/cli/azure +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com -[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[azure_powershell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice [build_doc]: https://aka.ms/AzureSDKBundling [incomingcall]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/incoming-call-notification [build1]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/callflows-for-customer-interactions?pivots=programming-language-csha diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py index 754acca99848..374f80d1fc0e 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py @@ -6238,14 +6238,14 @@ class TextSource(_serialization.Model): :vartype text: str :ivar source_locale: Source language locale to be played Refer to available locales here: :code:``. :vartype source_locale: str :ivar voice_kind: Voice kind type. Known values are: "male" and "female". :vartype voice_kind: str or ~azure.communication.callautomation.models.VoiceKind :ivar voice_name: Voice name to be played Refer to available Text-to-speech voices here: :code:``. :vartype voice_name: str :ivar custom_voice_endpoint_id: Endpoint where the custom voice was deployed. @@ -6279,14 +6279,14 @@ def __init__( :paramtype text: str :keyword source_locale: Source language locale to be played Refer to available locales here: :code:``. :paramtype source_locale: str :keyword voice_kind: Voice kind type. Known values are: "male" and "female". :paramtype voice_kind: str or ~azure.communication.callautomation.models.VoiceKind :keyword voice_name: Voice name to be played Refer to available Text-to-speech voices here: :code:``. :paramtype voice_name: str :keyword custom_voice_endpoint_id: Endpoint where the custom voice was deployed. diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py index fb11625fb680..995159e55993 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py @@ -259,12 +259,12 @@ class TextSource: :keyword text: Text for the cognitive service to be played. Required. :paramtype text: str :keyword source_locale: Source language locale to be played. Refer to available locales here: - https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support?tabs=stt-tts + https://learn.microsoft.com/azure/cognitive-services/speech-service/language-support?tabs=stt-tts :paramtype source_locale: str :keyword voice_kind: Voice kind type. Known values are: "male" and "female". :paramtype voice_kind: str or ~azure.communication.callautomation.VoiceKind :keyword voice_name: Voice name to be played. Refer to available Text-to-speech voices here: - https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support?tabs=stt-tts + https://learn.microsoft.com/azure/cognitive-services/speech-service/language-support?tabs=stt-tts :paramtype voice_name: str :keyword play_source_cache_id: Cached source id of the play media, if it exists. :paramtype play_source_cache_id: str @@ -276,12 +276,12 @@ class TextSource: """Text for the cognitive service to be played.""" source_locale: Optional[str] """Source language locale to be played. Refer to available locales here: - https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support?tabs=stt-tts""" + https://learn.microsoft.com/azure/cognitive-services/speech-service/language-support?tabs=stt-tts""" voice_kind: Optional[Union[str, "VoiceKind"]] """Voice kind type. Known values are: "male" and "female".""" voice_name: Optional[str] """Voice name to be played. Refer to available Text-to-speech voices here: - https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support?tabs=stt-tts""" + https://learn.microsoft.com/azure/cognitive-services/speech-service/language-support?tabs=stt-tts""" play_source_cache_id: Optional[str] """Cached source id of the play media, if it exists.""" custom_voice_endpoint_id: Optional[str] diff --git a/sdk/communication/azure-communication-chat/README.md b/sdk/communication/azure-communication-chat/README.md index 8d94f22ac6dd..7ba733f4dd14 100644 --- a/sdk/communication/azure-communication-chat/README.md +++ b/sdk/communication/azure-communication-chat/README.md @@ -1,13 +1,13 @@ # Azure Communication Chat Package client library for Python This package contains a Python SDK for Azure Communication Services for Chat. -Read more about Azure Communication Services [here](https://docs.microsoft.com/azure/communication-services/overview) +Read more about Azure Communication Services [here](https://learn.microsoft.com/azure/communication-services/overview) [Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-chat) | [Package (Pypi)](https://pypi.org/project/azure-communication-chat/) | [Package (Conda)](https://anaconda.org/microsoft/azure-communication/) | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-communication-chat/1.0.0b5/index.html) -| [Product documentation](https://docs.microsoft.com/azure/communication-services/) +| [Product documentation](https://learn.microsoft.com/azure/communication-services/) ## _Disclaimer_ @@ -18,7 +18,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ## Prerequisites - Python 3.7 or later is required to use this package. -- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. +- A deployed Communication Services resource. You can use the [Azure Portal](https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. ## Install the package diff --git a/sdk/communication/azure-communication-email/README.md b/sdk/communication/azure-communication-email/README.md index 3ea6efb439ae..1a77cfdd704e 100644 --- a/sdk/communication/azure-communication-email/README.md +++ b/sdk/communication/azure-communication-email/README.md @@ -232,11 +232,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp [email_resource_docs]: https://aka.ms/acsemail/createemailresource -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net [package]: https://www.nuget.org/packages/Azure.Communication.Common/ [product_docs]: https://aka.ms/acsemail/overview [nextsteps]: https://aka.ms/acsemail/overview diff --git a/sdk/communication/azure-communication-identity/CHANGELOG.md b/sdk/communication/azure-communication-identity/CHANGELOG.md index ea2adeed9a4f..1a81e7c9eebd 100644 --- a/sdk/communication/azure-communication-identity/CHANGELOG.md +++ b/sdk/communication/azure-communication-identity/CHANGELOG.md @@ -110,4 +110,4 @@ [read_me]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-identity/README.md -[documentation]: https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-python +[documentation]: https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-python diff --git a/sdk/communication/azure-communication-identity/README.md b/sdk/communication/azure-communication-identity/README.md index 207786c5ad86..534e3ed57c01 100644 --- a/sdk/communication/azure-communication-identity/README.md +++ b/sdk/communication/azure-communication-identity/README.md @@ -6,7 +6,7 @@ Azure Communication Identity client package is intended to be used to setup the | [Package (Pypi)](https://pypi.org/project/azure-communication-identity/) | [Package (Conda)](https://anaconda.org/microsoft/azure-communication/) | [API reference documentation](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-identity) -| [Product documentation](https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-python) +| [Product documentation](https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-python) ## _Disclaimer_ @@ -16,7 +16,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ## Prerequisites - Python 3.8 or later is required to use this package. - You must have an [Azure subscription](https://azure.microsoft.com/free/) -- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. +- A deployed Communication Services resource. You can use the [Azure Portal](https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. ## Install the package Install the Azure Communication Identity client library for Python with [pip](https://pypi.org/project/pip/): diff --git a/sdk/communication/azure-communication-jobrouter/README.md b/sdk/communication/azure-communication-jobrouter/README.md index 4b0b28ca6617..879dce1ae147 100644 --- a/sdk/communication/azure-communication-jobrouter/README.md +++ b/sdk/communication/azure-communication-jobrouter/README.md @@ -337,20 +337,20 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net -[nextsteps]:https://docs.microsoft.com/azure/communication-services/concepts/router/concepts +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[nextsteps]:https://learn.microsoft.com/azure/communication-services/concepts/router/concepts [source]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-jobrouter -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview -[classification_concepts]: https://docs.microsoft.com/azure/communication-services/concepts/router/classification-concepts -[subscribe_events]: https://docs.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events -[offer_issued_event_schema]: https://docs.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events#microsoftcommunicationrouterworkerofferissued +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview +[classification_concepts]: https://learn.microsoft.com/azure/communication-services/concepts/router/classification-concepts +[subscribe_events]: https://learn.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events +[offer_issued_event_schema]: https://learn.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events#microsoftcommunicationrouterworkerofferissued [deserialize_event_grid_event_data]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/eventgrid/azure-eventgrid#consume-from-servicebus -[event_grid_event_handlers]: https://docs.microsoft.com/azure/event-grid/event-handlers -[webhook_event_grid_event_delivery]: https://docs.microsoft.com/azure/event-grid/webhook-event-delivery +[event_grid_event_handlers]: https://learn.microsoft.com/azure/event-grid/event-handlers +[webhook_event_grid_event_delivery]: https://learn.microsoft.com/azure/event-grid/webhook-event-delivery [pypi]: https://pypi.org [pip]: https://pypi.org/project/pip/ diff --git a/sdk/communication/azure-communication-messages/README.md b/sdk/communication/azure-communication-messages/README.md index 6f4db6da72cd..b7e103d73662 100644 --- a/sdk/communication/azure-communication-messages/README.md +++ b/sdk/communication/azure-communication-messages/README.md @@ -91,7 +91,7 @@ additional questions or comments. [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[authenticate_with_token]: https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential @@ -99,6 +99,6 @@ additional questions or comments. [azure_sub]: https://azure.microsoft.com [source]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-messages -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview [pypi]: https://pypi.org [nextsteps]: https://learn.microsoft.com/azure/communication-services/concepts/advanced-messaging/whatsapp/whatsapp-overview diff --git a/sdk/communication/azure-communication-messages/samples/send_text_notification_messages_with_token_credentials.py b/sdk/communication/azure-communication-messages/samples/send_text_notification_messages_with_token_credentials.py index 4f61bec2136e..55d28e259269 100644 --- a/sdk/communication/azure-communication-messages/samples/send_text_notification_messages_with_token_credentials.py +++ b/sdk/communication/azure-communication-messages/samples/send_text_notification_messages_with_token_credentials.py @@ -12,7 +12,7 @@ DESCRIPTION: This sample demonstrates sending an Whatsapp message from business phone number to a single user. The NotificationMessageClient is authenticated using Bearer TokenCredentials with azureidentity. - More information here: https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python + More information here: https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python USAGE: python send_text_notification_messages_with_token_credentials.py @@ -21,8 +21,8 @@ 2) RECIPIENT_PHONE_NUMBER - a phone number with Whatsapp capabilities. Use list for recipient phone number. 3) WHATSAPP_CHANNEL_ID - Channel created in Azure portal for Advanced Messaging. 4) Follow defining environment variables for DefaultAzureCredentials as give here: - https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#environment-variables - https://learn.microsoft.com/en-us/entra/identity-platform/howto-create-service-principal-portal + https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python#environment-variables + https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal Variable name Value AZURE_CLIENT_ID ID of a Microsoft Entra application AZURE_TENANT_ID ID of the application's Microsoft Entra tenant diff --git a/sdk/communication/azure-communication-phonenumbers/CHANGELOG.md b/sdk/communication/azure-communication-phonenumbers/CHANGELOG.md index e9fb8c515aa9..e8974edf1222 100644 --- a/sdk/communication/azure-communication-phonenumbers/CHANGELOG.md +++ b/sdk/communication/azure-communication-phonenumbers/CHANGELOG.md @@ -92,4 +92,4 @@ [read_me]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-phonenumbers/README.md -[documentation]: https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-python +[documentation]: https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-python diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index 14e26027fb95..237da9ee1f09 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -10,7 +10,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ## Prerequisites - Python 3.7 or later is required to use this package. - You must have an [Azure subscription](https://azure.microsoft.com/free/) -- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. +- A deployed Communication Services resource. You can use the [Azure Portal](https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. ## Install the package Install the Azure Communication Phone Numbers client library for Python with [pip](https://pypi.org/project/pip/): diff --git a/sdk/communication/azure-communication-rooms/README.md b/sdk/communication/azure-communication-rooms/README.md index f591d39d6558..03a6568977d9 100644 --- a/sdk/communication/azure-communication-rooms/README.md +++ b/sdk/communication/azure-communication-rooms/README.md @@ -1,6 +1,6 @@ # Azure Communication Rooms client library for Python This package contains a Python SDK for Azure Communication Services for Rooms. -Read more about Azure Communication Services [here](https://docs.microsoft.com/azure/communication-services/overview) +Read more about Azure Communication Services [here](https://learn.microsoft.com/azure/communication-services/overview) ## _Disclaimer_ @@ -24,7 +24,7 @@ python -m pip install azure-communication-rooms - Python 3.7 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. -- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. +- A deployed Communication Services resource. You can use the [Azure Portal](https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. ### Client Initialization @@ -201,7 +201,7 @@ additional questions or comments. [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[authenticate_with_token]: https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential diff --git a/sdk/communication/azure-communication-sms/README.md b/sdk/communication/azure-communication-sms/README.md index 579a3cf7169b..6ebb1771d9c1 100644 --- a/sdk/communication/azure-communication-sms/README.md +++ b/sdk/communication/azure-communication-sms/README.md @@ -1,13 +1,13 @@ # Azure Communication SMS Package client library for Python This package contains a Python SDK for Azure Communication Services for SMS. -Read more about Azure Communication Services [here](https://docs.microsoft.com/azure/communication-services/overview) +Read more about Azure Communication Services [here](https://learn.microsoft.com/azure/communication-services/overview) [Source code](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-sms) | [Package (Pypi)](https://pypi.org/project/azure-communication-sms/) | [Package (Conda)](https://anaconda.org/microsoft/azure-communication/) | [API reference documentation](https://learn.microsoft.com/python/api/overview/azure/communication-sms-readme?view=azure-python) -| [Product documentation](https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-python) +| [Product documentation](https://learn.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-python) ## _Disclaimer_ @@ -18,7 +18,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites - Python 3.7 or later is required to use this package. -- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. +- A deployed Communication Services resource. You can use the [Azure Portal](https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. - You must have a phone number configured that is associated with an Azure subscription ### Install the package @@ -151,5 +151,5 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft. [azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md -[handle_sms_events]: https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/handle-sms-events -[next_steps]:https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-python +[handle_sms_events]: https://learn.microsoft.com/azure/communication-services/quickstarts/telephony-sms/handle-sms-events +[next_steps]:https://learn.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-python From 7db455194f961a6fe71f500524ce347af96a21ef Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 22 Jan 2025 09:25:23 -0800 Subject: [PATCH 14/29] Fix urls (#39246) --- sdk/cosmos/azure-cosmos/CHANGELOG.md | 10 ++-- sdk/cosmos/azure-cosmos/README.md | 46 +++++++++---------- .../azure/cosmos/aio/_database.py | 4 +- .../azure-cosmos/azure/cosmos/database.py | 4 +- .../azure/cosmos/partition_key.py | 2 +- sdk/cosmos/azure-cosmos/doc/setup.md | 2 +- sdk/cosmos/azure-cosmos/samples/README.md | 2 +- .../samples/access_cosmos_with_aad.py | 2 +- .../samples/access_cosmos_with_aad_async.py | 2 +- .../access_cosmos_with_resource_token.py | 2 +- ...access_cosmos_with_resource_token_async.py | 2 +- .../samples/change_feed_management.py | 2 +- .../samples/change_feed_management_async.py | 2 +- .../samples/client_user_configs.py | 2 +- .../samples/client_user_configs_async.py | 2 +- .../samples/container_management.py | 2 +- .../samples/container_management_async.py | 2 +- .../samples/database_management.py | 2 +- .../samples/database_management_async.py | 2 +- .../samples/document_management.py | 2 +- .../samples/document_management_async.py | 2 +- .../samples/session_token_management.py | 2 +- .../samples/session_token_management_async.py | 2 +- 23 files changed, 51 insertions(+), 51 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 95288ddfb29a..e1224bf0f0fe 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -190,8 +190,8 @@ For more on the `CosmosHttpLoggingPolicy` see our [README](https://github.com/Az ### 4.3.1b1 (2022-09-19) #### Features Added -- GA release of integrated cache functionality. For more information on integrated cache please see [Azure Cosmos DB integrated cache](https://docs.microsoft.com/azure/cosmos-db/integrated-cache). -- Added ability to replace analytical ttl on containers. For more information on analytical ttl please see [Azure Cosmos DB analytical store](https://docs.microsoft.com/azure/cosmos-db/analytical-store-introduction). +- GA release of integrated cache functionality. For more information on integrated cache please see [Azure Cosmos DB integrated cache](https://learn.microsoft.com/azure/cosmos-db/integrated-cache). +- Added ability to replace analytical ttl on containers. For more information on analytical ttl please see [Azure Cosmos DB analytical store](https://learn.microsoft.com/azure/cosmos-db/analytical-store-introduction). - Added `CosmosHttpLoggingPolicy` to replace `HttpLoggingPolicy` for logging HTTP sessions. - Added the ability to create containers and databases with autoscale properties for the sync and async clients. - Added the ability to update autoscale throughput properties. @@ -234,13 +234,13 @@ Method call will now require an 'id' field to be present in the document body. > their clients. > Default consistency level for the sync and async clients is no longer "Session" and will instead be set to the consistency level of the user's cosmos account setting on initialization if not passed during client initialization. -> Please see [Consistency Levels in Azure Cosmos DB](https://docs.microsoft.com/azure/cosmos-db/consistency-levels) +> Please see [Consistency Levels in Azure Cosmos DB](https://learn.microsoft.com/azure/cosmos-db/consistency-levels) > for more details on consistency levels, or the README section on this change [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cosmos/azure-cosmos#note-on-client-consistency-levels). #### Features Added - Added new **provisional** `max_integrated_cache_staleness_in_ms` parameter to read item and query items APIs in order to make use of the **preview** CosmosDB integrated cache functionality [See PR #22946](https://github.com/Azure/azure-sdk-for-python/pull/22946). - Please see [Azure Cosmos DB integrated cache](https://docs.microsoft.com/azure/cosmos-db/integrated-cache) for more details. + Please see [Azure Cosmos DB integrated cache](https://learn.microsoft.com/azure/cosmos-db/integrated-cache) for more details. - Added support for split-proof queries for the async client. ### Bugs fixed @@ -248,7 +248,7 @@ Method call will now require an 'id' field to be present in the document body. consistency level of the user's cosmos account setting on initialization if not passed during client initialization. This change will impact client application in terms of RUs and latency. Users relying on default `Session` consistency will need to pass it explicitly if their account consistency is different than `Session`. - Please see [Consistency Levels in Azure Cosmos DB](https://docs.microsoft.com/azure/cosmos-db/consistency-levels) for more details. + Please see [Consistency Levels in Azure Cosmos DB](https://learn.microsoft.com/azure/cosmos-db/consistency-levels) for more details. - Fixed invalid request body being sent when passing in `serverScript` body parameter to replace operations for trigger, sproc and udf resources. - Moved `is_system_key` logic in async client. - Fixed TypeErrors not being thrown when passing in invalid connection retry policies to the client. diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index c10759a31077..a0b9a76b895f 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -19,7 +19,7 @@ Use the Azure Cosmos DB SQL API SDK for Python to manage databases and the JSON | [Product documentation][cosmos_docs] | [Samples][cosmos_samples] -> This SDK is used for the [SQL API](https://docs.microsoft.com/azure/cosmos-db/sql-query-getting-started). For all other APIs, please check the [Azure Cosmos DB documentation](https://docs.microsoft.com/azure/cosmos-db/introduction) to evaluate the best SDK for your project. +> This SDK is used for the [SQL API](https://learn.microsoft.com/azure/cosmos-db/sql-query-getting-started). For all other APIs, please check the [Azure Cosmos DB documentation](https://learn.microsoft.com/azure/cosmos-db/introduction) to evaluate the best SDK for your project. ## Getting started @@ -107,7 +107,7 @@ aad_credentials = DefaultAzureCredential() client = CosmosClient(url, aad_credentials) ``` Always ensure that the managed identity you use for AAD authentication has `readMetadata` permissions.
-More information on how to set up AAD authentication: [Set up RBAC for AAD authentication](https://docs.microsoft.com/azure/cosmos-db/how-to-setup-rbac)
+More information on how to set up AAD authentication: [Set up RBAC for AAD authentication](https://learn.microsoft.com/azure/cosmos-db/how-to-setup-rbac)
More information on allowed operations for AAD authenticated clients: [RBAC Permission Model](https://aka.ms/cosmos-native-rbac) ## Key concepts @@ -171,7 +171,7 @@ Streamable queries like `SELECT * FROM WHERE` *do* support continuation tokens. ### Control Plane Limitations Workaround -Typically, you can use [Azure Portal](https://portal.azure.com/), [Azure Cosmos DB Resource Provider REST API](https://docs.microsoft.com/rest/api/cosmos-db-resource-provider), [Azure CLI](https://docs.microsoft.com/cli/azure/azure-cli-reference-for-cosmos-db) or [PowerShell](https://docs.microsoft.com/azure/cosmos-db/manage-with-powershell) for the control plane unsupported limitations. +Typically, you can use [Azure Portal](https://portal.azure.com/), [Azure Cosmos DB Resource Provider REST API](https://learn.microsoft.com/rest/api/cosmos-db-resource-provider), [Azure CLI](https://learn.microsoft.com/cli/azure/azure-cli-reference-for-cosmos-db) or [PowerShell](https://learn.microsoft.com/azure/cosmos-db/manage-with-powershell) for the control plane unsupported limitations. ### Using The Async Client as a Workaround to Bulk While the SDK supports transactional batch, support for bulk requests is not yet implemented in the Python SDK. You can use the async client along with this [concurrency sample][cosmos_concurrency_sample] we have developed as a reference for a possible workaround. @@ -182,7 +182,7 @@ While the SDK supports transactional batch, support for bulk requests is not yet ## Boolean Data Type -While the Python language [uses](https://docs.python.org/3/library/stdtypes.html?highlight=boolean#truth-value-testing) "True" and "False" for boolean types, Cosmos DB [accepts](https://docs.microsoft.com/azure/cosmos-db/sql-query-is-bool) "true" and "false" only. In other words, the Python language uses Boolean values with the first uppercase letter and all other lowercase letters, while Cosmos DB and its SQL language use only lowercase letters for those same Boolean values. How to deal with this challenge? +While the Python language [uses](https://docs.python.org/3/library/stdtypes.html?highlight=boolean#truth-value-testing) "True" and "False" for boolean types, Cosmos DB [accepts](https://learn.microsoft.com/azure/cosmos-db/sql-query-is-bool) "true" and "false" only. In other words, the Python language uses Boolean values with the first uppercase letter and all other lowercase letters, while Cosmos DB and its SQL language use only lowercase letters for those same Boolean values. How to deal with this challenge? * Your JSON documents created with Python must use "True" and "False", to pass the language validation. The SDK will convert it to "true" and "false" for you. Meaning that "true" and "false" is what will be stored in Cosmos DB. * If you retrieve those documents with the Cosmos DB Portal's Data Explorer, you will see "true" and "false". @@ -190,9 +190,9 @@ While the Python language [uses](https://docs.python.org/3/library/stdtypes.html ## SQL Queries x FROM Clause Subitems -This SDK uses the [query_items](https://docs.microsoft.com/python/api/azure-cosmos/azure.cosmos.containerproxy?preserve-view=true&view=azure-python#query-items-query--parameters-none--partition-key-none--enable-cross-partition-query-none--max-item-count-none--enable-scan-in-query-none--populate-query-metrics-none----kwargs-) method to submit SQL queries to Azure Cosmos DB. +This SDK uses the [query_items](https://learn.microsoft.com/python/api/azure-cosmos/azure.cosmos.containerproxy?preserve-view=true&view=azure-python#query-items-query--parameters-none--partition-key-none--enable-cross-partition-query-none--max-item-count-none--enable-scan-in-query-none--populate-query-metrics-none----kwargs-) method to submit SQL queries to Azure Cosmos DB. -Cosmos DB SQL language allows you to [get subitems by using the FROM clause](https://docs.microsoft.com/azure/cosmos-db/sql-query-from#get-subitems-by-using-the-from-clause), to reduce the source to a smaller subset. As an example, you can use `select * from Families.children` instead of `select * from Families`. But please note that: +Cosmos DB SQL language allows you to [get subitems by using the FROM clause](https://learn.microsoft.com/azure/cosmos-db/sql-query-from#get-subitems-by-using-the-from-clause), to reduce the source to a smaller subset. As an example, you can use `select * from Families.children` instead of `select * from Families`. But please note that: * For SQL queries using the `query_items` method, this SDK demands that you specify the `partition_key` or use the `enable_cross_partition_query` flag. * If you are getting subitems and specifying the `partition_key`, please make sure that your partition key is included in the subitems, which is not true for most of the cases. @@ -260,7 +260,7 @@ except exceptions.CosmosHttpResponseError: ### Create an analytical store enabled container -This example creates a container with [Analytical Store](https://docs.microsoft.com/azure/cosmos-db/analytical-store-introduction) enabled, for reporting, BI, AI, and Advanced Analytics with [Azure Synapse Link](https://docs.microsoft.com/azure/cosmos-db/synapse-link). +This example creates a container with [Analytical Store](https://learn.microsoft.com/azure/cosmos-db/analytical-store-introduction) enabled, for reporting, BI, AI, and Advanced Analytics with [Azure Synapse Link](https://learn.microsoft.com/azure/cosmos-db/synapse-link). The options for analytical_storage_ttl are: @@ -988,29 +988,29 @@ be used with our SDK. This works the same way regardless of the Cosmos client yo ## Next steps -For more extensive documentation on the Cosmos DB service, see the [Azure Cosmos DB documentation][cosmos_docs] on docs.microsoft.com. +For more extensive documentation on the Cosmos DB service, see the [Azure Cosmos DB documentation][cosmos_docs] on learn.microsoft.com. -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_portal]: https://portal.azure.com [azure_sub]: https://azure.microsoft.com/free/ -[cloud_shell]: https://docs.microsoft.com/azure/cloud-shell/overview -[cosmos_account_create]: https://docs.microsoft.com/azure/cosmos-db/how-to-manage-database-account -[cosmos_account]: https://docs.microsoft.com/azure/cosmos-db/account-overview -[cosmos_container]: https://docs.microsoft.com/azure/cosmos-db/databases-containers-items#azure-cosmos-containers -[cosmos_database]: https://docs.microsoft.com/azure/cosmos-db/databases-containers-items#azure-cosmos-databases -[cosmos_docs]: https://docs.microsoft.com/azure/cosmos-db/ +[cloud_shell]: https://learn.microsoft.com/azure/cloud-shell/overview +[cosmos_account_create]: https://learn.microsoft.com/azure/cosmos-db/how-to-manage-database-account +[cosmos_account]: https://learn.microsoft.com/azure/cosmos-db/account-overview +[cosmos_container]: https://learn.microsoft.com/azure/cosmos-db/databases-containers-items#azure-cosmos-containers +[cosmos_database]: https://learn.microsoft.com/azure/cosmos-db/databases-containers-items#azure-cosmos-databases +[cosmos_docs]: https://learn.microsoft.com/azure/cosmos-db/ [cosmos_samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cosmos/azure-cosmos/samples [cosmos_pypi]: https://pypi.org/project/azure-cosmos/ -[cosmos_http_status_codes]: https://docs.microsoft.com/rest/api/cosmos-db/http-status-codes-for-cosmosdb -[cosmos_item]: https://docs.microsoft.com/azure/cosmos-db/databases-containers-items#azure-cosmos-items +[cosmos_http_status_codes]: https://learn.microsoft.com/rest/api/cosmos-db/http-status-codes-for-cosmosdb +[cosmos_item]: https://learn.microsoft.com/azure/cosmos-db/databases-containers-items#azure-cosmos-items [cosmos_models]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cosmos/azure-cosmos/azure/cosmos/_models.py -[cosmos_request_units]: https://docs.microsoft.com/azure/cosmos-db/request-units -[cosmos_resources]: https://docs.microsoft.com/azure/cosmos-db/databases-containers-items -[cosmos_sql_queries]: https://docs.microsoft.com/azure/cosmos-db/how-to-sql-query -[cosmos_ttl]: https://docs.microsoft.com/azure/cosmos-db/time-to-live -[cosmos_integrated_cache]: https://docs.microsoft.com/azure/cosmos-db/integrated-cache -[cosmos_configure_integrated_cache]: https://docs.microsoft.com/azure/cosmos-db/how-to-configure-integrated-cache +[cosmos_request_units]: https://learn.microsoft.com/azure/cosmos-db/request-units +[cosmos_resources]: https://learn.microsoft.com/azure/cosmos-db/databases-containers-items +[cosmos_sql_queries]: https://learn.microsoft.com/azure/cosmos-db/how-to-sql-query +[cosmos_ttl]: https://learn.microsoft.com/azure/cosmos-db/time-to-live +[cosmos_integrated_cache]: https://learn.microsoft.com/azure/cosmos-db/integrated-cache +[cosmos_configure_integrated_cache]: https://learn.microsoft.com/azure/cosmos-db/how-to-configure-integrated-cache [python]: https://www.python.org/downloads/ [ref_container_delete_item]: https://aka.ms/azsdk-python-cosmos-ref-delete-item [ref_container_query_items]: https://aka.ms/azsdk-python-cosmos-ref-query-items diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py index 49253b223f88..f73e1ad17570 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py @@ -199,7 +199,7 @@ async def create_container( :paramtype match_condition: ~azure.core.MatchConditions :keyword List[Dict[str, str]] computed_properties: **provisional** Sets The computed properties for this container in the Azure Cosmos DB Service. For more Information on how to use computed properties visit - `here: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/computed-properties?tabs=dotnet` + `here: https://learn.microsoft.com/azure/cosmos-db/nosql/query/computed-properties?tabs=dotnet` :keyword response_hook: A callable invoked with the response metadata. :paramtype response_hook: Callable[[Dict[str, str], Dict[str, Any]], None] :keyword int analytical_storage_ttl: Analytical store time to live (TTL) for items in the container. A value of @@ -324,7 +324,7 @@ async def create_container_if_not_exists( :paramtype match_condition: ~azure.core.MatchConditions :keyword List[Dict[str, str]] computed_properties: **provisional** Sets The computed properties for this container in the Azure Cosmos DB Service. For more Information on how to use computed properties visit - `here: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/computed-properties?tabs=dotnet` + `here: https://learn.microsoft.com/azure/cosmos-db/nosql/query/computed-properties?tabs=dotnet` :keyword response_hook: A callable invoked with the response metadata. :paramtype response_hook: Callable[[Dict[str, str], Dict[str, Any]], None] :keyword int analytical_storage_ttl: Analytical store time to live (TTL) for items in the container. A value of diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/database.py b/sdk/cosmos/azure-cosmos/azure/cosmos/database.py index f7e5a7f9d715..e8b921fd8ed8 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/database.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/database.py @@ -201,7 +201,7 @@ def create_container( # pylint:disable=docstring-missing-param note that analytical storage can only be enabled on Synapse Link enabled accounts. :keyword List[Dict[str, str]] computed_properties: **provisional** Sets The computed properties for this container in the Azure Cosmos DB Service. For more Information on how to use computed properties visit - `here: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/computed-properties?tabs=dotnet` + `here: https://learn.microsoft.com/azure/cosmos-db/nosql/query/computed-properties?tabs=dotnet` :keyword Dict[str, Any] vector_embedding_policy: **provisional** The vector embedding policy for the container. Each vector embedding possesses a predetermined number of dimensions, is associated with an underlying data type, and is generated for a particular distance function. @@ -327,7 +327,7 @@ def create_container_if_not_exists( # pylint:disable=docstring-missing-param note that analytical storage can only be enabled on Synapse Link enabled accounts. :keyword List[Dict[str, str]] computed_properties: **provisional** Sets The computed properties for this container in the Azure Cosmos DB Service. For more Information on how to use computed properties visit - `here: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/computed-properties?tabs=dotnet` + `here: https://learn.microsoft.com/azure/cosmos-db/nosql/query/computed-properties?tabs=dotnet` :keyword Dict[str, Any] vector_embedding_policy: The vector embedding policy for the container. Each vector embedding possesses a predetermined number of dimensions, is associated with an underlying data type, and is generated for a particular distance function. diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/partition_key.py b/sdk/cosmos/azure-cosmos/azure/cosmos/partition_key.py index f77b44dfa306..07274b2387e4 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/partition_key.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/partition_key.py @@ -93,7 +93,7 @@ class _Infinity: class PartitionKey(dict): """Key used to partition a container into logical partitions. - See https://docs.microsoft.com/azure/cosmos-db/partitioning-overview#choose-partitionkey + See https://learn.microsoft.com/azure/cosmos-db/partitioning-overview#choose-partitionkey for information on how to choose partition keys. :ivar str path: The path of the partition key diff --git a/sdk/cosmos/azure-cosmos/doc/setup.md b/sdk/cosmos/azure-cosmos/doc/setup.md index c9d94f0cf11e..69fcf405e005 100644 --- a/sdk/cosmos/azure-cosmos/doc/setup.md +++ b/sdk/cosmos/azure-cosmos/doc/setup.md @@ -133,7 +133,7 @@ The unit tests can be run by right-clicking a specific test file or specific tes [cosmos_db_sdk_repo]: https://github.com/Azure/azure-sdk-for-python [azure_sub]: https://azure.microsoft.com/free/ -[cosmos_account]: https://docs.microsoft.com/azure/cosmos-db/account-overview +[cosmos_account]: https://learn.microsoft.com/azure/cosmos-db/account-overview [python]: https://www.python.org/downloads/ [pycharm]: https://www.jetbrains.com/pycharm/ [cosmos_db_emulator]: https://learn.microsoft.com/azure/cosmos-db/emulator diff --git a/sdk/cosmos/azure-cosmos/samples/README.md b/sdk/cosmos/azure-cosmos/samples/README.md index 724db36b84cf..113e7d1f08e4 100644 --- a/sdk/cosmos/azure-cosmos/samples/README.md +++ b/sdk/cosmos/azure-cosmos/samples/README.md @@ -52,7 +52,7 @@ The following are code samples that show common scenario operations with the Azu ## Prerequisites * Python 3.8+ * You must have an [Azure subscription](https://azure.microsoft.com/free/) and an -[Azure Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account) to run these samples. +[Azure Cosmos DB account](https://learn.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account) to run these samples. ## Setup diff --git a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_aad.py b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_aad.py index 4d18cbc61554..ebe1535876c4 100644 --- a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_aad.py +++ b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_aad.py @@ -13,7 +13,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://docs.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account +# https://learn.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account # # 2. Microsoft Azure Cosmos # pip install azure-cosmos>=4.3.0b4 diff --git a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_aad_async.py b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_aad_async.py index 792c85f47395..564137a062e2 100644 --- a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_aad_async.py +++ b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_aad_async.py @@ -14,7 +14,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://docs.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account +# https://learn.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account # # 2. Microsoft Azure Cosmos # pip install azure-cosmos>=4.3.0b4 diff --git a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token.py b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token.py index 744e2fad8628..bf253eacc26d 100644 --- a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token.py +++ b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token.py @@ -17,7 +17,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://docs.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account +# https://learn.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account # # 2. Microsoft Azure Cosmos # pip install azure-cosmos>=4.0.0 diff --git a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token_async.py b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token_async.py index 13e90d840c19..2c7c38c3319b 100644 --- a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token_async.py +++ b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token_async.py @@ -17,7 +17,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://docs.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account +# https://learn.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account # # 2. Microsoft Azure Cosmos # pip install azure-cosmos>=4.0.0 diff --git a/sdk/cosmos/azure-cosmos/samples/change_feed_management.py b/sdk/cosmos/azure-cosmos/samples/change_feed_management.py index e790fe636be6..7aa464e2e10f 100644 --- a/sdk/cosmos/azure-cosmos/samples/change_feed_management.py +++ b/sdk/cosmos/azure-cosmos/samples/change_feed_management.py @@ -17,7 +17,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https:#azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https:#azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/change_feed_management_async.py b/sdk/cosmos/azure-cosmos/samples/change_feed_management_async.py index c8191d3e55f6..3e69bce81b08 100644 --- a/sdk/cosmos/azure-cosmos/samples/change_feed_management_async.py +++ b/sdk/cosmos/azure-cosmos/samples/change_feed_management_async.py @@ -18,7 +18,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https:#azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https:#azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/client_user_configs.py b/sdk/cosmos/azure-cosmos/samples/client_user_configs.py index 54d2f240c6b5..a7e27e985cac 100644 --- a/sdk/cosmos/azure-cosmos/samples/client_user_configs.py +++ b/sdk/cosmos/azure-cosmos/samples/client_user_configs.py @@ -8,7 +8,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https://azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/client_user_configs_async.py b/sdk/cosmos/azure-cosmos/samples/client_user_configs_async.py index 01a22ee9d875..b801f8e81a38 100644 --- a/sdk/cosmos/azure-cosmos/samples/client_user_configs_async.py +++ b/sdk/cosmos/azure-cosmos/samples/client_user_configs_async.py @@ -9,7 +9,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https://azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/container_management.py b/sdk/cosmos/azure-cosmos/samples/container_management.py index c43c28faf08c..30defb45e90b 100644 --- a/sdk/cosmos/azure-cosmos/samples/container_management.py +++ b/sdk/cosmos/azure-cosmos/samples/container_management.py @@ -14,7 +14,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https://azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/container_management_async.py b/sdk/cosmos/azure-cosmos/samples/container_management_async.py index f730b0a50cb3..784b65c1f3c1 100644 --- a/sdk/cosmos/azure-cosmos/samples/container_management_async.py +++ b/sdk/cosmos/azure-cosmos/samples/container_management_async.py @@ -15,7 +15,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https://azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/database_management.py b/sdk/cosmos/azure-cosmos/samples/database_management.py index 4c7b1097a722..626d891d2448 100644 --- a/sdk/cosmos/azure-cosmos/samples/database_management.py +++ b/sdk/cosmos/azure-cosmos/samples/database_management.py @@ -13,7 +13,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://docs.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account +# https://learn.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/database_management_async.py b/sdk/cosmos/azure-cosmos/samples/database_management_async.py index ea2adede90ac..8ef7ff062695 100644 --- a/sdk/cosmos/azure-cosmos/samples/database_management_async.py +++ b/sdk/cosmos/azure-cosmos/samples/database_management_async.py @@ -14,7 +14,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://docs.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account +# https://learn.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/document_management.py b/sdk/cosmos/azure-cosmos/samples/document_management.py index aa019ffbea8f..845d07cbbdc7 100644 --- a/sdk/cosmos/azure-cosmos/samples/document_management.py +++ b/sdk/cosmos/azure-cosmos/samples/document_management.py @@ -15,7 +15,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https:#azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https:#azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/document_management_async.py b/sdk/cosmos/azure-cosmos/samples/document_management_async.py index 9f98ca7f47e2..4b07be0f4f34 100644 --- a/sdk/cosmos/azure-cosmos/samples/document_management_async.py +++ b/sdk/cosmos/azure-cosmos/samples/document_management_async.py @@ -16,7 +16,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https:#azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https:#azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/session_token_management.py b/sdk/cosmos/azure-cosmos/samples/session_token_management.py index e21521a7e505..2dc212b58215 100644 --- a/sdk/cosmos/azure-cosmos/samples/session_token_management.py +++ b/sdk/cosmos/azure-cosmos/samples/session_token_management.py @@ -20,7 +20,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https://azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ diff --git a/sdk/cosmos/azure-cosmos/samples/session_token_management_async.py b/sdk/cosmos/azure-cosmos/samples/session_token_management_async.py index 76f570b9488b..e940e218c5cf 100644 --- a/sdk/cosmos/azure-cosmos/samples/session_token_management_async.py +++ b/sdk/cosmos/azure-cosmos/samples/session_token_management_async.py @@ -21,7 +21,7 @@ # Prerequisites - # # 1. An Azure Cosmos account - -# https://azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ +# https://azure.microsoft.com/documentation/articles/documentdb-create-account/ # # 2. Microsoft Azure Cosmos PyPi package - # https://pypi.python.org/pypi/azure-cosmos/ From a5860cc9a721405353a8077c2ba6dd9a197e2875 Mon Sep 17 00:00:00 2001 From: MilesHolland <108901744+MilesHolland@users.noreply.github.com> Date: Wed, 22 Jan 2025 13:06:06 -0500 Subject: [PATCH 15/29] Content safety evals aggregate max from conversations (#39083) * add convo agg type, and have harm evals use max * analysis * correct enum name in docs * refactor checked enum into function field * cl and analysis * change enum name and update CL * change function names to private, allow agg type retrieval * PR comments * test serialization * CL * CI adjustment * try again * perf * skip perf * remove skip --- .../azure-ai-evaluation/CHANGELOG.md | 5 + .../azure/ai/evaluation/__init__.py | 2 + .../azure/ai/evaluation/_constants.py | 18 +++ .../_evaluators/_common/_base_eval.py | 63 +++++++++- .../_evaluators/_common/_base_rai_svc_eval.py | 8 +- .../_common/_conversation_aggregators.py | 49 ++++++++ .../_content_safety/_hate_unfairness.py | 2 + .../_evaluators/_content_safety/_self_harm.py | 2 + .../_evaluators/_content_safety/_sexual.py | 2 + .../_evaluators/_content_safety/_violence.py | 2 + .../evaluate_test_data_conversation.jsonl | 2 + .../tests/unittests/test_evaluate.py | 115 +++++++++++++++++- .../unittests/test_evaluate_performance.py | 3 +- .../test_evaluators/test_inputs_evaluators.py | 42 +++++++ 14 files changed, 309 insertions(+), 6 deletions(-) create mode 100644 sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_conversation_aggregators.py create mode 100644 sdk/evaluation/azure-ai-evaluation/tests/unittests/data/evaluate_test_data_conversation.jsonl diff --git a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md index d8f338846f88..d1fd368e980e 100644 --- a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md +++ b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md @@ -12,10 +12,15 @@ - Removed `[remote]` extra. This is no longer needed when tracking results in Azure AI Studio. - Fixed `AttributeError: 'NoneType' object has no attribute 'get'` while running simulator with 1000+ results - Fixed the non adversarial simulator to run in task-free mode +- Content safety evaluators (violence, self harm, sexual, hate/unfairness) return the maximum result as the + main score when aggregating per-turn evaluations from a conversation into an overall + evaluation score. Other conversation-capable evaluators still default to a mean for aggregation. ### Other Changes - Changed minimum required python version to use this package from 3.8 to 3.9 - Stop dependency on the local promptflow service. No promptflow service will automatically start when running evaluation. +- Evaluators internally allow for custom aggregation. However, this causes serialization failures if evaluated while the + environment variable `AI_EVALS_BATCH_USE_ASYNC` is set to false. ## 1.1.0 (2024-12-12) diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/__init__.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/__init__.py index c21a97a9531a..71bf744c7b80 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/__init__.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/__init__.py @@ -42,6 +42,7 @@ Message, OpenAIModelConfiguration, ) +from ._constants import AggregationType __all__ = [ "evaluate", @@ -79,4 +80,5 @@ "SexualMultimodalEvaluator", "ViolenceMultimodalEvaluator", "ProtectedMaterialMultimodalEvaluator", + "AggregationType", ] diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_constants.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_constants.py index 253a7efa2182..0a783838e586 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_constants.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_constants.py @@ -1,7 +1,9 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +import enum from typing import Literal +from azure.ai.evaluation._common._experimental import experimental class EvaluationMetrics: @@ -57,6 +59,22 @@ class EvaluationRunProperties: EVALUATION_SDK = "_azureml.evaluation_sdk_name" +@experimental +class AggregationType(enum.Enum): + """Defines how numeric evaluation results should be aggregated + to produce a single value. Used by individual evaluators to combine per-turn results for + a conversation-based input. In general, wherever this enum is used, it is also possible + to directly assign the underlying aggregation function for more complex use cases. + The 'custom' value is generally not an acceptable input, and should only be used as an output + to indicate that a custom aggregation function has been injected.""" + + MEAN = "mean" + MAX = "max" + MIN = "min" + SUM = "sum" + CUSTOM = "custom" + + DEFAULT_EVALUATION_RESULTS_FILE_NAME = "evaluation_results.json" CONTENT_SAFETY_DEFECT_RATE_THRESHOLD_DEFAULT = 4 diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py index 70f323470369..f7ccf449de5f 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py @@ -4,15 +4,18 @@ import inspect from abc import ABC, abstractmethod -from typing import Any, Callable, Dict, Generic, List, TypedDict, TypeVar, Union, cast, final +from typing import Any, Callable, Dict, Generic, List, TypedDict, TypeVar, Union, cast, final, Optional from promptflow._utils.async_utils import async_run_allowing_running_loop from typing_extensions import ParamSpec, TypeAlias, get_overloads -from azure.ai.evaluation._common.math import list_mean from azure.ai.evaluation._exceptions import ErrorBlame, ErrorCategory, ErrorTarget, EvaluationException from azure.ai.evaluation._common.utils import remove_optional_singletons +from azure.ai.evaluation._constants import AggregationType from azure.ai.evaluation._model_configurations import Conversation +from azure.ai.evaluation._common._experimental import experimental + +from ._conversation_aggregators import GetAggregator, GetAggregatorType P = ParamSpec("P") T = TypeVar("T") @@ -70,6 +73,13 @@ class EvaluatorBase(ABC, Generic[T_EvalValue]): :type not_singleton_inputs: List[str] :param eval_last_turn: If True, only the last turn of the conversation will be evaluated. Default is False. :type eval_last_turn: bool + :param conversation_aggregation_type: The type of aggregation to perform on the per-turn results of a conversation + to produce a single result. + Default is ~azure.ai.evaluation.AggregationType.MEAN. + :type conversation_aggregation_type: ~azure.ai.evaluation.AggregationType + :param conversation_aggregator_override: A function that will be used to aggregate per-turn results. If provided, + overrides the standard aggregator implied by conversation_aggregation_type. None by default. + :type conversation_aggregator_override: Optional[Callable[[List[float]], float]] """ # ~~~ METHODS THAT ALMOST ALWAYS NEED TO BE OVERRIDDEN BY CHILDREN~~~ @@ -81,11 +91,17 @@ def __init__( *, not_singleton_inputs: List[str] = ["conversation", "kwargs"], eval_last_turn: bool = False, + conversation_aggregation_type: AggregationType = AggregationType.MEAN, + conversation_aggregator_override: Optional[Callable[[List[float]], float]] = None, ): self._not_singleton_inputs = not_singleton_inputs self._eval_last_turn = eval_last_turn self._singleton_inputs = self._derive_singleton_inputs() self._async_evaluator = AsyncEvaluatorBase(self._real_call) + self._conversation_aggregation_function = GetAggregator(conversation_aggregation_type) + if conversation_aggregator_override is not None: + # Type ignore since we already checked for None, but mypy doesn't know that. + self._conversation_aggregation_function = conversation_aggregator_override # type: ignore[assignment] # This needs to be overridden just to change the function header into something more informative, # and to be able to add a more specific docstring. The actual function contents should just be @@ -359,7 +375,7 @@ def _aggregate_results(self, per_turn_results: List[DoEvalResult[T_EvalValue]]) # Find and average all numeric values for metric, values in evaluation_per_turn.items(): if all(isinstance(value, (int, float)) for value in values): - aggregated[metric] = list_mean(cast(List[Union[int, float]], values)) + aggregated[metric] = self._conversation_aggregation_function(cast(List[Union[int, float]], values)) # Slap the per-turn results back in. aggregated["evaluation_per_turn"] = evaluation_per_turn return aggregated @@ -387,10 +403,51 @@ async def _real_call(self, **kwargs) -> Union[DoEvalResult[T_EvalValue], Aggrega # Otherwise, aggregate results. return self._aggregate_results(per_turn_results=per_turn_results) + # ~~~ METHODS THAT SHOULD NOT BE OVERRIDDEN BY CHILDREN~~~`` + @final def _to_async(self) -> "AsyncEvaluatorBase": return self._async_evaluator + @experimental + @final + def _set_conversation_aggregation_type(self, conversation_aggregation_type: AggregationType) -> None: + """Input a conversation aggregation type to re-assign the aggregator function used by this evaluator for + multi-turn conversations. This aggregator is used to combine numeric outputs from each evaluation of a + multi-turn conversation into a single top-level result. + + :param conversation_aggregation_type: The type of aggregation to perform on the per-turn + results of a conversation to produce a single result. + :type conversation_aggregation_type: ~azure.ai.evaluation.AggregationType + """ + self._conversation_aggregation_function = GetAggregator(conversation_aggregation_type) + + @experimental + @final + def _set_conversation_aggregator(self, aggregator: Callable[[List[float]], float]) -> None: + """Set the conversation aggregator function directly. This function will be applied to all numeric outputs + of an evaluator when it evaluates a conversation with multiple-turns thus ends up with multiple results per + evaluation that is needs to coalesce into a single result. Use when built-in aggregators do not + suit your needs, but use with caution. + + :param aggregator: The function to use to aggregate per-turn results. + :type aggregator: Callable[[List[float]], float] + """ + self._conversation_aggregation_function = aggregator + + @experimental + @final + def _get_conversation_aggregator_type(self) -> AggregationType: + """Get the current conversation aggregation type used by this evaluator. This refers to the + method used when a single input produces multiple evaluation results (ex: when a multi-turn conversation + is inputted into an evaluator that evaluates each turn individually). The individual inputs + are combined by the function implied here to produce a single overall result. + + :return: The conversation aggregation type. + :rtype: ~azure.ai.evaluation.AggregationType + """ + return GetAggregatorType(self._conversation_aggregation_function) + class AsyncEvaluatorBase: """The asynchronous evaluator hidden underneath all evaluators. This makes generous use passing functions diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_rai_svc_eval.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_rai_svc_eval.py index 75bee3da43ad..26608db9f4f1 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_rai_svc_eval.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_rai_svc_eval.py @@ -15,6 +15,7 @@ from azure.ai.evaluation._common.utils import validate_azure_ai_project from azure.ai.evaluation._exceptions import EvaluationException from azure.ai.evaluation._common.utils import validate_conversation +from azure.ai.evaluation._constants import AggregationType from azure.core.credentials import TokenCredential from . import EvaluatorBase @@ -35,6 +36,10 @@ class RaiServiceEvaluatorBase(EvaluatorBase[T]): aggregated. Per-turn results are still be available in the output via the "evaluation_per_turn" key when this occurs. Default is False, resulting full conversation evaluation and aggregation. :type eval_last_turn: bool + :param conversation_aggregation_type: The type of aggregation to perform on the per-turn results of a conversation + to produce a single result. + Default is ~azure.ai.evaluation.AggregationType.MEAN. + :type conversation_aggregation_type: ~azure.ai.evaluation.AggregationType """ @override @@ -44,8 +49,9 @@ def __init__( azure_ai_project: dict, credential: TokenCredential, eval_last_turn: bool = False, + conversation_aggregation_type: AggregationType = AggregationType.MEAN, ): - super().__init__(eval_last_turn=eval_last_turn) + super().__init__(eval_last_turn=eval_last_turn, conversation_aggregation_type=conversation_aggregation_type) self._eval_metric = eval_metric self._azure_ai_project = validate_azure_ai_project(azure_ai_project) self._credential = credential diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_conversation_aggregators.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_conversation_aggregators.py new file mode 100644 index 000000000000..df76a33413cf --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_conversation_aggregators.py @@ -0,0 +1,49 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +from typing import Callable, List +from azure.ai.evaluation._common.math import list_mean +from azure.ai.evaluation._exceptions import ErrorBlame, ErrorCategory, ErrorTarget, EvaluationException +from azure.ai.evaluation._constants import AggregationType + + +def GetAggregator(aggregation_type: AggregationType) -> Callable[[List[float]], float]: + if aggregation_type == AggregationType.SUM: + return sum + if aggregation_type == AggregationType.MEAN: + return list_mean + if aggregation_type == AggregationType.MAX: + return max + if aggregation_type == AggregationType.MIN: + return min + if aggregation_type == AggregationType.CUSTOM: + msg = ( + "Cannot 'get' aggregator function associated with custom aggregation enum." + + " This enum value should only be outputted as an indicator of an injected" + + " aggregation function, not inputted directly" + ) + raise EvaluationException( + message=msg, + blame=ErrorBlame.UNKNOWN, + category=ErrorCategory.INVALID_VALUE, + target=ErrorTarget.EVALUATE, + ) + raise EvaluationException( + message=f"Unaccounted for aggregation type: {aggregation_type}", + blame=ErrorBlame.UNKNOWN, + category=ErrorCategory.INVALID_VALUE, + target=ErrorTarget.EVALUATE, + ) + + +def GetAggregatorType(aggregation_function: Callable) -> AggregationType: + if aggregation_function == sum: # pylint: disable=comparison-with-callable + return AggregationType.SUM + if aggregation_function == list_mean: # pylint: disable=comparison-with-callable + return AggregationType.MEAN + if aggregation_function == max: # pylint: disable=comparison-with-callable + return AggregationType.MAX + if aggregation_function == min: # pylint: disable=comparison-with-callable + return AggregationType.MIN + return AggregationType.CUSTOM diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_hate_unfairness.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_hate_unfairness.py index b0b15251844b..154f2bac52ba 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_hate_unfairness.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_hate_unfairness.py @@ -9,6 +9,7 @@ from azure.ai.evaluation._common.constants import EvaluationMetrics from azure.ai.evaluation._evaluators._common import RaiServiceEvaluatorBase from azure.ai.evaluation._model_configurations import Conversation +from azure.ai.evaluation._constants import AggregationType @experimental @@ -71,6 +72,7 @@ def __init__( eval_metric=EvaluationMetrics.HATE_FAIRNESS, azure_ai_project=azure_ai_project, credential=credential, + conversation_aggregation_type=AggregationType.MAX, ) @overload diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_self_harm.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_self_harm.py index 1b408e2c1e27..de2d2d20236b 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_self_harm.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_self_harm.py @@ -9,6 +9,7 @@ from azure.ai.evaluation._common.constants import EvaluationMetrics from azure.ai.evaluation._evaluators._common import RaiServiceEvaluatorBase from azure.ai.evaluation._model_configurations import Conversation +from azure.ai.evaluation._constants import AggregationType @experimental @@ -65,6 +66,7 @@ def __init__( eval_metric=EvaluationMetrics.SELF_HARM, azure_ai_project=azure_ai_project, credential=credential, + conversation_aggregation_type=AggregationType.MAX, ) @overload diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_sexual.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_sexual.py index 96a6ee0dbd73..e990e73a3522 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_sexual.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_sexual.py @@ -9,6 +9,7 @@ from azure.ai.evaluation._common.constants import EvaluationMetrics from azure.ai.evaluation._evaluators._common import RaiServiceEvaluatorBase from azure.ai.evaluation._model_configurations import Conversation +from azure.ai.evaluation._constants import AggregationType @experimental @@ -67,6 +68,7 @@ def __init__( eval_metric=EvaluationMetrics.SEXUAL, azure_ai_project=azure_ai_project, credential=credential, + conversation_aggregation_type=AggregationType.MAX, ) @overload diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_violence.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_violence.py index 0f3600a92cfc..c0c71f49983c 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_violence.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_violence.py @@ -9,6 +9,7 @@ from azure.ai.evaluation._common.constants import EvaluationMetrics from azure.ai.evaluation._evaluators._common import RaiServiceEvaluatorBase from azure.ai.evaluation._model_configurations import Conversation +from azure.ai.evaluation._constants import AggregationType @experimental @@ -67,6 +68,7 @@ def __init__( eval_metric=EvaluationMetrics.VIOLENCE, azure_ai_project=azure_ai_project, credential=credential, + conversation_aggregation_type=AggregationType.MAX, ) @overload diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/data/evaluate_test_data_conversation.jsonl b/sdk/evaluation/azure-ai-evaluation/tests/unittests/data/evaluate_test_data_conversation.jsonl new file mode 100644 index 000000000000..037487fae1e4 --- /dev/null +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/data/evaluate_test_data_conversation.jsonl @@ -0,0 +1,2 @@ +{"conversation" : {"context" : "", "messages": [{"content": "What shape has 3 sides", "role" :"user", "context": null}, {"content": "A triangle", "role" :"assistant", "context": "The answer is a triangle."}, {"content": "Next, what shape has 4 sides", "role" :"user", "context": null}, {"content": "A square", "role" :"assistant", "context": "The answer is a square."}]}} +{"conversation" : {"context" : "User wants to know about state capitals", "messages": [{"content": "What is the capital of Hawaii`''\"{}{{]", "role" :"user", "context": "User wants to know the capital of Hawaii"}, {"content": "Honolulu", "role" :"assistant", "context": "The answer is a Honolulu."}, {"content": "Ok, what is the capital of Massachusetts", "role" :"user", "context": "User wants to know the capital of Massachusetts."}, {"content": "Boston", "role" :"assistant", "context": "The answer is Boston."}]}} diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate.py index c4f0fe37c616..a8dd0f1226ae 100644 --- a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate.py +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate.py @@ -1,3 +1,4 @@ +from typing import List, Dict, Union import json import math import os @@ -10,6 +11,7 @@ from pandas.testing import assert_frame_equal from promptflow.client import PFClient +from azure.ai.evaluation._common.math import list_mean from azure.ai.evaluation import ( ContentSafetyEvaluator, F1ScoreEvaluator, @@ -17,8 +19,12 @@ SimilarityEvaluator, ProtectedMaterialEvaluator, evaluate, + ViolenceEvaluator, + SexualEvaluator, + SelfHarmEvaluator, + HateUnfairnessEvaluator, ) -from azure.ai.evaluation._constants import DEFAULT_EVALUATION_RESULTS_FILE_NAME +from azure.ai.evaluation._constants import DEFAULT_EVALUATION_RESULTS_FILE_NAME, AggregationType from azure.ai.evaluation._evaluate._evaluate import ( _aggregate_metrics, _apply_target_to_data, @@ -60,6 +66,11 @@ def evaluate_test_data_jsonl_file(): return _get_file("evaluate_test_data.jsonl") +@pytest.fixture +def evaluate_test_data_conversion_jsonl_file(): + return _get_file("evaluate_test_data_conversation.jsonl") + + @pytest.fixture def pf_client() -> PFClient: """The fixture, returning PRClient""" @@ -690,6 +701,108 @@ def test_optional_inputs_with_target(self, questions_file, questions_answers_bas assert double_override_results["rows"][0]["outputs.echo.echo_query"] == "new query" assert double_override_results["rows"][0]["outputs.echo.echo_response"] == "new response" + def test_conversation_aggregation_types(self, evaluate_test_data_conversion_jsonl_file): + from test_evaluators.test_inputs_evaluators import CountingEval + + counting_eval = CountingEval() + evaluators = {"count": counting_eval} + # test default behavior - mean + results = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + assert results["rows"][0]["outputs.count.response"] == 1.5 # average of 1 and 2 + assert results["rows"][1]["outputs.count.response"] == 3.5 # average of 3 and 4 + + # test maxing + counting_eval.reset() + counting_eval._set_conversation_aggregation_type(AggregationType.MAX) + results = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + assert results["rows"][0]["outputs.count.response"] == 2 + assert results["rows"][1]["outputs.count.response"] == 4 + + # test minimizing + counting_eval.reset() + counting_eval._set_conversation_aggregation_type(AggregationType.MIN) + results = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + assert results["rows"][0]["outputs.count.response"] == 1 + assert results["rows"][1]["outputs.count.response"] == 3 + + # test sum + counting_eval.reset() + counting_eval._set_conversation_aggregation_type(AggregationType.SUM) + results = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + assert results["rows"][0]["outputs.count.response"] == 3 + assert results["rows"][1]["outputs.count.response"] == 7 + + # test custom aggregator + def custom_aggregator(values): + return sum(values) + 1 + + counting_eval.reset() + counting_eval._set_conversation_aggregator(custom_aggregator) + results = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + assert results["rows"][0]["outputs.count.response"] == 4 + assert results["rows"][1]["outputs.count.response"] == 8 + + def test_default_conversation_aggregation_overrides(self): + fake_project = {"subscription_id": "123", "resource_group_name": "123", "project_name": "123"} + eval1 = ViolenceEvaluator(None, fake_project) + eval2 = SexualEvaluator(None, fake_project) + eval3 = SelfHarmEvaluator(None, fake_project) + eval4 = HateUnfairnessEvaluator(None, fake_project) + eval5 = F1ScoreEvaluator() # Test default + assert eval1._conversation_aggregation_function == max + assert eval2._conversation_aggregation_function == max + assert eval3._conversation_aggregation_function == max + assert eval4._conversation_aggregation_function == max + assert eval5._conversation_aggregation_function == list_mean + + def test_conversation_aggregation_type_returns(self): + fake_project = {"subscription_id": "123", "resource_group_name": "123", "project_name": "123"} + eval1 = ViolenceEvaluator(None, fake_project) + # Test builtins + assert eval1._get_conversation_aggregator_type() == AggregationType.MAX + eval1._set_conversation_aggregation_type(AggregationType.SUM) + assert eval1._get_conversation_aggregator_type() == AggregationType.SUM + eval1._set_conversation_aggregation_type(AggregationType.MAX) + assert eval1._get_conversation_aggregator_type() == AggregationType.MAX + eval1._set_conversation_aggregation_type(AggregationType.MIN) + assert eval1._get_conversation_aggregator_type() == AggregationType.MIN + + # test custom + def custom_aggregator(values): + return sum(values) + 1 + + eval1._set_conversation_aggregator(custom_aggregator) + assert eval1._get_conversation_aggregator_type() == AggregationType.CUSTOM + + @pytest.mark.parametrize("use_async", ["true", "false"]) # Strings intended + def test_aggregation_serialization(self, evaluate_test_data_conversion_jsonl_file, use_async): + # This test exists to ensure that PF doesn't crash when trying to serialize a + # complex aggregation function. + from test_evaluators.test_inputs_evaluators import CountingEval + + counting_eval = CountingEval() + evaluators = {"count": counting_eval} + + def custom_aggregator(values: List[float]) -> float: + return sum(values) + 1 + + os.environ["AI_EVALS_BATCH_USE_ASYNC"] = use_async + _ = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + counting_eval._set_conversation_aggregation_type(AggregationType.MIN) + _ = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + counting_eval._set_conversation_aggregation_type(AggregationType.SUM) + _ = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + counting_eval._set_conversation_aggregation_type(AggregationType.MAX) + _ = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + if use_async == "true": + counting_eval._set_conversation_aggregator(custom_aggregator) + _ = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + else: + with pytest.raises(EvaluationException) as exc_info: + counting_eval._set_conversation_aggregator(custom_aggregator) + _ = evaluate(data=evaluate_test_data_conversion_jsonl_file, evaluators=evaluators) + assert "TestEvaluate.test_aggregation_serialization..custom_aggregator" in exc_info.value.args[0] + def test_unsupported_file_inputs(self, mock_model_config, unsupported_file_type): with pytest.raises(EvaluationException) as cm: evaluate( diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate_performance.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate_performance.py index d71483220069..515fd6508f1c 100644 --- a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate_performance.py +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate_performance.py @@ -71,7 +71,8 @@ def test_evaluate_parallelism(self, ten_queries_file): diff = end - start # Assume any system running this test can manage to multithread 10 runs into # 2 batches at most, so it should take between 1 and 1.5 seconds. - max_duration = 1.5 + # Increase to 1.75 to account for CI lag. + max_duration = 1.75 assert diff < max_duration row_result_df = pd.DataFrame(result["rows"]) assert "outputs.slow.result" in row_result_df.columns diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluators/test_inputs_evaluators.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluators/test_inputs_evaluators.py index e09faa738c18..004aec6741a2 100644 --- a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluators/test_inputs_evaluators.py +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluators/test_inputs_evaluators.py @@ -5,6 +5,11 @@ # A collection of very simple evaluators designed to test column mappings. # (aka proper data file -> _call__ input mapping) +from typing import Dict, Union +from typing_extensions import overload, override + +from azure.ai.evaluation._evaluators._common import EvaluatorBase + class NonOptionalEval: def __init__(self): @@ -44,3 +49,40 @@ def __init__(self): def __call__(self, *, query="default", response="default"): return {"echo_query": query, "echo_response": response} + + +class CountingEval(EvaluatorBase): + """Returns an incrementing number, which can be reset as needed""" + + def __init__(self, **kwargs): + self._count = 0 + super().__init__(**kwargs) + + def reset(self): + self._count = 0 + + @override + async def _do_eval(self, eval_input: Dict) -> Dict[str, int]: + self._count += 1 + return {"response": self._count} + + @overload + def __call__( + self, + *, + query: str, + response: str, + ) -> Dict[str, Union[str, float]]: + """""" + + @overload + def __call__(self, *, conversation): + """""" + + @override + def __call__( # pylint: disable=docstring-missing-param + self, + *args, + **kwargs, + ): + return super().__call__(*args, **kwargs) From e40d5d14ce097caa08d00f1090b90b8adebf6f45 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 22 Jan 2025 10:27:07 -0800 Subject: [PATCH 16/29] Fix urls (#39129) --- sdk/ml/azure-ai-ml/README.md | 6 +- .../azure/ai/ml/_artifacts/_constants.py | 6 +- .../azure/ai/ml/_azure_environments.py | 2 +- .../_restclient/runhistory/models/_models.py | 8 +- .../runhistory/models/_models_py3.py | 8 +- .../models/_models.py | 12 +-- .../models/_models_py3.py | 12 +-- .../v2022_02_01_preview/models/_models.py | 78 +++++++-------- .../v2022_02_01_preview/models/_models_py3.py | 78 +++++++-------- .../_restclient/v2022_05_01/models/_models.py | 12 +-- .../v2022_05_01/models/_models_py3.py | 12 +-- .../_restclient/v2022_10_01/models/_models.py | 90 ++++++++--------- .../v2022_10_01/models/_models_py3.py | 90 ++++++++--------- .../v2022_10_01_preview/models/_models.py | 98 +++++++++---------- .../v2022_10_01_preview/models/_models_py3.py | 98 +++++++++---------- .../v2022_12_01_preview/models/_models.py | 90 ++++++++--------- .../v2022_12_01_preview/models/_models_py3.py | 90 ++++++++--------- .../v2023_02_01_preview/models/_models.py | 90 ++++++++--------- .../v2023_02_01_preview/models/_models_py3.py | 90 ++++++++--------- .../_restclient/v2023_04_01/models/_models.py | 98 +++++++++---------- .../v2023_04_01/models/_models_py3.py | 98 +++++++++---------- .../v2023_04_01_preview/models/_models.py | 98 +++++++++---------- .../v2023_04_01_preview/models/_models_py3.py | 98 +++++++++---------- .../v2023_06_01_preview/models/_models.py | 98 +++++++++---------- .../v2023_06_01_preview/models/_models_py3.py | 98 +++++++++---------- .../v2023_08_01_preview/models/_models.py | 98 +++++++++---------- .../v2023_08_01_preview/models/_models_py3.py | 98 +++++++++---------- .../v2023_10_01/models/_models_py3.py | 98 +++++++++---------- .../v2024_01_01_preview/models/_models.py | 98 +++++++++---------- .../v2024_01_01_preview/models/_models_py3.py | 98 +++++++++---------- .../v2024_04_01_preview/models/_models.py | 98 +++++++++---------- .../v2024_04_01_preview/models/_models_py3.py | 98 +++++++++---------- .../v2024_07_01_preview/models/_models.py | 98 +++++++++---------- .../v2024_07_01_preview/models/_models_py3.py | 98 +++++++++---------- .../v2024_10_01_preview/models/_models.py | 98 +++++++++---------- .../v2024_10_01_preview/models/_models_py3.py | 98 +++++++++---------- .../azure/ai/ml/_utils/_artifact_utils.py | 2 +- .../azure/ai/ml/automl/_automl_image.py | 8 +- .../azure/ai/ml/automl/_automl_nlp.py | 4 +- .../azure/ai/ml/automl/_automl_tabular.py | 24 ++--- .../azure/ai/ml/constants/_common.py | 2 +- .../entities/_feature_store/feature_store.py | 2 +- .../image/automl_image_classification_base.py | 4 +- .../automl_image_object_detection_base.py | 4 +- .../image_classification_search_space.py | 4 +- .../_job/automl/image/image_model_settings.py | 12 +-- .../image_object_detection_search_space.py | 4 +- .../_job/automl/tabular/automl_tabular.py | 10 +- .../_job/automl/tabular/forecasting_job.py | 12 +-- .../automl/tabular/forecasting_settings.py | 4 +- .../azure-ai-ml/azure/ai/ml/entities/_util.py | 2 +- .../ai/ml/entities/_workspace/workspace.py | 2 +- .../_aio/_credentials/aml_on_behalf_of.py | 2 +- .../identity/_credentials/aml_on_behalf_of.py | 4 +- .../_online_deployment_operations.py | 2 +- .../machineLearningServices.json | 6 +- .../machineLearningServices.json | 6 +- .../2021-10-01-dataplanepreview/mfe.json | 8 +- .../machineLearningServices.json | 2 +- .../machineLearningServices.json | 6 +- .../preview/2022-02-01-preview/mfe.json | 28 +++--- .../machineLearningServices.json | 6 +- .../preview/2022-10-01-preview/mfe.json | 30 +++--- .../machineLearningServices.json | 2 +- .../preview/2022-12-01-preview/mfe.json | 30 +++--- .../machineLearningServices.json | 2 +- .../preview/2023-02-01-preview/mfe.json | 30 +++--- .../machineLearningServices.json | 6 +- .../preview/2023-04-01-preview/mfe.json | 30 +++--- .../machineLearningServices.json | 6 +- .../preview/2023-06-01-preview/mfe.json | 30 +++--- .../machineLearningServices.json | 6 +- .../preview/2023-08-01-preview/mfe.json | 30 +++--- .../machineLearningServices.json | 6 +- .../preview/2024-01-01-preview/mfe.json | 30 +++--- .../machineLearningServices.json | 6 +- .../preview/2024-04-01-preview/mfe.json | 30 +++--- .../machineLearningServices.json | 6 +- .../preview/2024-07-01-preview/mfe.json | 30 +++--- .../machineLearningServices.json | 6 +- .../preview/2024-10-01-preview/mfe.json | 30 +++--- .../preview/runhistory/run-history.json | 4 +- .../2022-05-01/machineLearningServices.json | 6 +- .../stable/2022-05-01/mfe.json | 8 +- .../2023-04-01/machineLearningServices.json | 6 +- .../stable/2023-04-01/mfe.json | 30 +++--- .../2023-10-01/machineLearningServices.json | 6 +- .../stable/2023-10-01/mfe.json | 30 +++--- .../flow.dag.yaml | 2 +- .../automl/components/src/register.py | 2 +- .../components/src/register.py | 2 +- 91 files changed, 1624 insertions(+), 1624 deletions(-) diff --git a/sdk/ml/azure-ai-ml/README.md b/sdk/ml/azure-ai-ml/README.md index e67bcc71fbc3..42fd438b5363 100644 --- a/sdk/ml/azure-ai-ml/README.md +++ b/sdk/ml/azure-ai-ml/README.md @@ -125,11 +125,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [ml_conda]: https://anaconda.org/microsoft/azure-ai-ml/ [ml_ref_docs]: https://learn.microsoft.com/python/api/azure-ai-ml/?view=azure-python [ml_samples]: https://github.com/Azure/azureml-examples/tree/main/sdk/python -[product_documentation]: https://docs.microsoft.com/azure/machine-learning/ +[product_documentation]: https://learn.microsoft.com/azure/machine-learning/ [azure_subscription]: https://azure.microsoft.com/free/ -[workspace]: https://docs.microsoft.com/azure/machine-learning/concept-workspace +[workspace]: https://learn.microsoft.com/azure/machine-learning/concept-workspace [python_logging]: https://docs.python.org/3/library/logging.html -[sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/azure-sdk-logging +[sdk_logging_docs]: https://learn.microsoft.com/azure/developer/python/azure-sdk-logging [azure_core_readme]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md [pip_link]: https://pypi.org/project/pip/ [azure_core_ref_docs]: https://aka.ms/azsdk-python-core-policies diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_constants.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_constants.py index f007f731baa5..8c9e97ea84c5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_constants.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_constants.py @@ -7,7 +7,7 @@ PROCESSES_PER_CORE = 2 # number of parallel connections to be used for uploads > 64MB and downloads # pylint: disable=line-too-long -# (Azure Storage param: https://docs.microsoft.com/python/api/azure-storage-blob/azure.storage.blob.blobclient?view=azure-python#upload-blob-data--blob-type--blobtype-blockblob---blockblob----length-none--metadata-none----kwargs-) +# (Azure Storage param: https://learn.microsoft.com/python/api/azure-storage-blob/azure.storage.blob.blobclient?view=azure-python#upload-blob-data--blob-type--blobtype-blockblob---blockblob----length-none--metadata-none----kwargs-) MAX_CONCURRENCY = 16 ARTIFACT_ORIGIN = "LocalUpload" @@ -30,7 +30,7 @@ FILE_SIZE_WARNING = ( "Your file exceeds 100 MB. If you experience low speeds, latency, or broken connections, we recommend using " "the AzCopyv10 tool for this file transfer.\n\nExample: azcopy copy '{source}' '{destination}' " # cspell:disable-line - "\n\nSee https://docs.microsoft.com/azure/storage/common/storage-use-azcopy-v10 for more information." + "\n\nSee https://learn.microsoft.com/azure/storage/common/storage-use-azcopy-v10 for more information." ) INVALID_MLTABLE_METADATA_SCHEMA_MSG = "Invalid MLTable metadata schema" INVALID_MLTABLE_METADATA_SCHEMA_ERROR = ( @@ -54,7 +54,7 @@ "{0}\n{1}\n" "This SAS token is derived from an account key, but key-based authentication is not permitted " "for this storage account. To update workspace properties, please see the documentation: " - "https://review.learn.microsoft.com/en-us/azure/machine-learning/how-to-disable-local-auth-storage?view=" + "https://review.learn.microsoft.com/azure/machine-learning/how-to-disable-local-auth-storage?view=" "azureml-api-2&branch=pr-en-us-278974&tabs=cli#update-an-existing-workspace" ) KEY_AUTHENTICATION_ERROR_CODE = "KeyBasedAuthenticationNotPermitted" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py index 8e75587c520c..51673b141ad1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py @@ -303,7 +303,7 @@ def _get_clouds_by_metadata_url(metadata_url: str) -> Dict[str, Dict[str, str]]: "SDK requires outbound access to Azure Resource Manager. Please contact your networking team " "to configure outbound access to Azure Resource Manager on both Network Security Group and " "Firewall. For more details on required configurations, see " - "https://docs.microsoft.com/azure/machine-learning/how-to-access-azureml-behind-firewall.", + "https://learn.microsoft.com/azure/machine-learning/how-to-access-azureml-behind-firewall.", metadata_url, ex, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models.py index 618c174eb983..398700eefc69 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models.py @@ -1493,7 +1493,7 @@ class ExperimentQueryParams(msrest.serialization.Model): :ivar filter: Allows for filtering the collection of resources. The expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. - See https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for + See https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax. :vartype filter: str :ivar continuation_token: The continuation token to use for getting the next set of resources. @@ -1526,7 +1526,7 @@ def __init__( :keyword filter: Allows for filtering the collection of resources. The expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. - See https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for + See https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax. :paramtype filter: str :keyword continuation_token: The continuation token to use for getting the next set of @@ -2727,7 +2727,7 @@ class QueryParams(msrest.serialization.Model): :ivar filter: Allows for filtering the collection of resources. The expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. - See https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for + See https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax. :vartype filter: str :ivar continuation_token: The continuation token to use for getting the next set of resources. @@ -2756,7 +2756,7 @@ def __init__( :keyword filter: Allows for filtering the collection of resources. The expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. - See https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for + See https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax. :paramtype filter: str :keyword continuation_token: The continuation token to use for getting the next set of diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models_py3.py index 7156aeeff13a..4b482905d5ae 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models_py3.py @@ -1671,7 +1671,7 @@ class ExperimentQueryParams(msrest.serialization.Model): :ivar filter: Allows for filtering the collection of resources. The expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. - See https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for + See https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax. :vartype filter: str :ivar continuation_token: The continuation token to use for getting the next set of resources. @@ -1710,7 +1710,7 @@ def __init__( :keyword filter: Allows for filtering the collection of resources. The expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. - See https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for + See https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax. :paramtype filter: str :keyword continuation_token: The continuation token to use for getting the next set of @@ -3041,7 +3041,7 @@ class QueryParams(msrest.serialization.Model): :ivar filter: Allows for filtering the collection of resources. The expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. - See https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for + See https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax. :vartype filter: str :ivar continuation_token: The continuation token to use for getting the next set of resources. @@ -3075,7 +3075,7 @@ def __init__( :keyword filter: Allows for filtering the collection of resources. The expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. - See https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for + See https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax. :paramtype filter: str :keyword continuation_token: The continuation token to use for getting the next set of diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py index 965198e8618e..267544ef65cd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py @@ -2078,7 +2078,7 @@ class ComponentContainerDetails(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -2262,7 +2262,7 @@ class ComponentVersionDetails(AssetBase): .. raw:: html . :vartype component_spec: any """ @@ -2294,7 +2294,7 @@ def __init__(self, **kwargs): .. raw:: html . :paramtype component_spec: any """ @@ -2971,7 +2971,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -2980,7 +2980,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -3045,7 +3045,7 @@ def __init__(self, **kwargs): .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py index 535b207a6991..7bdbecc36dad 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py @@ -2279,7 +2279,7 @@ class ComponentContainerDetails(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -2484,7 +2484,7 @@ class ComponentVersionDetails(AssetBase): .. raw:: html . :vartype component_spec: any """ @@ -2526,7 +2526,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -3255,7 +3255,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -3264,7 +3264,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -3345,7 +3345,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py index d121442ea70f..4ec94735e1b9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py @@ -3286,7 +3286,7 @@ class ComponentContainerDetails(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -3435,7 +3435,7 @@ class ComponentVersionDetails(AssetBase): .. raw:: html . :vartype component_spec: any """ @@ -3470,7 +3470,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -4965,7 +4965,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -4974,7 +4974,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -5035,7 +5035,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -6110,9 +6110,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -6150,7 +6150,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -6159,7 +6159,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -6272,7 +6272,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -6281,7 +6281,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -6363,9 +6363,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -6403,7 +6403,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -6412,7 +6412,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -6542,7 +6542,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -6551,7 +6551,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -6621,9 +6621,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -6661,7 +6661,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -6670,7 +6670,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -6848,7 +6848,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -6857,7 +6857,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -6967,7 +6967,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -7020,7 +7020,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -7030,7 +7030,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -7164,7 +7164,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -7174,7 +7174,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -7253,7 +7253,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -7306,7 +7306,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -7316,7 +7316,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -7467,7 +7467,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -7477,7 +7477,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -7539,7 +7539,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -7592,7 +7592,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -7602,7 +7602,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -7802,7 +7802,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -7812,7 +7812,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py index 7d13ec5c1d65..ea53ffbdb36e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py @@ -3536,7 +3536,7 @@ class ComponentContainerDetails(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -3695,7 +3695,7 @@ class ComponentVersionDetails(AssetBase): .. raw:: html . :vartype component_spec: any """ @@ -3737,7 +3737,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -5335,7 +5335,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -5344,7 +5344,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -5416,7 +5416,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -6578,9 +6578,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -6618,7 +6618,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -6627,7 +6627,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -6770,7 +6770,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -6779,7 +6779,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -6861,9 +6861,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -6901,7 +6901,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -6910,7 +6910,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -7074,7 +7074,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -7083,7 +7083,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -7153,9 +7153,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -7193,7 +7193,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -7202,7 +7202,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -7423,7 +7423,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -7432,7 +7432,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -7542,7 +7542,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -7595,7 +7595,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -7605,7 +7605,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -7774,7 +7774,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -7784,7 +7784,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -7863,7 +7863,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -7916,7 +7916,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -7926,7 +7926,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -8116,7 +8116,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -8126,7 +8126,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -8188,7 +8188,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -8241,7 +8241,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -8251,7 +8251,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -8499,7 +8499,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -8509,7 +8509,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models.py index 4661879e61a9..f195106ee819 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models.py @@ -3688,7 +3688,7 @@ class ComponentContainerDetails(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -3837,7 +3837,7 @@ class ComponentVersionDetails(AssetBase): .. raw:: html . :vartype component_spec: any """ @@ -3872,7 +3872,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -6797,7 +6797,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -6806,7 +6806,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -6867,7 +6867,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models_py3.py index e6f1eefc98a4..d66af5653b57 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models_py3.py @@ -3980,7 +3980,7 @@ class ComponentContainerDetails(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -4139,7 +4139,7 @@ class ComponentVersionDetails(AssetBase): .. raw:: html . :vartype component_spec: any """ @@ -4181,7 +4181,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -7322,7 +7322,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -7331,7 +7331,7 @@ class EnvironmentVersionDetails(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -7403,7 +7403,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models.py index 75467891c4b6..fd44c8cb5b08 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models.py @@ -4614,7 +4614,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -4763,7 +4763,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any """ @@ -4798,7 +4798,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -5848,7 +5848,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -5885,7 +5885,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -5910,7 +5910,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -5948,7 +5948,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8062,7 +8062,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -8071,7 +8071,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -8136,7 +8136,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -9746,9 +9746,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -9786,7 +9786,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -9795,7 +9795,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -9903,7 +9903,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -9912,7 +9912,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -9989,9 +9989,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -10029,7 +10029,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -10038,7 +10038,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -10163,7 +10163,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -10172,7 +10172,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -10238,9 +10238,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -10278,7 +10278,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -10287,7 +10287,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -10460,7 +10460,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -10469,7 +10469,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -10575,7 +10575,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -10622,7 +10622,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -10632,7 +10632,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -10754,7 +10754,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -10764,7 +10764,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -10837,7 +10837,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -10884,7 +10884,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -10894,7 +10894,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -11033,7 +11033,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -11043,7 +11043,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11101,7 +11101,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -11148,7 +11148,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -11158,7 +11158,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -11346,7 +11346,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -11356,7 +11356,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15442,7 +15442,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -15487,7 +15487,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models_py3.py index bd73e43e3900..9265fff1d6da 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models_py3.py @@ -4972,7 +4972,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -5131,7 +5131,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any """ @@ -5173,7 +5173,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -6304,7 +6304,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6345,7 +6345,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -6370,7 +6370,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6413,7 +6413,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8671,7 +8671,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -8680,7 +8680,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -8757,7 +8757,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -10506,9 +10506,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -10546,7 +10546,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -10555,7 +10555,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -10692,7 +10692,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -10701,7 +10701,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -10778,9 +10778,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -10818,7 +10818,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -10827,7 +10827,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -10985,7 +10985,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -10994,7 +10994,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11060,9 +11060,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11100,7 +11100,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11109,7 +11109,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11324,7 +11324,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11333,7 +11333,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11439,7 +11439,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -11486,7 +11486,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -11496,7 +11496,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -11651,7 +11651,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -11661,7 +11661,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11734,7 +11734,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -11781,7 +11781,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -11791,7 +11791,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -11967,7 +11967,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -11977,7 +11977,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12035,7 +12035,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12082,7 +12082,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12092,7 +12092,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12326,7 +12326,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12336,7 +12336,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16754,7 +16754,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -16806,7 +16806,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py index 5777e945622e..44231122f8a4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py @@ -5208,7 +5208,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -5366,7 +5366,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -5410,7 +5410,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -6502,7 +6502,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -6524,7 +6524,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -6554,7 +6554,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6591,7 +6591,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -6616,7 +6616,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6654,7 +6654,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9123,7 +9123,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -9132,7 +9132,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -9199,7 +9199,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -11013,9 +11013,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11053,7 +11053,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11062,7 +11062,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11170,7 +11170,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11179,7 +11179,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11256,9 +11256,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11296,7 +11296,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11305,7 +11305,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11430,7 +11430,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11439,7 +11439,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11505,9 +11505,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11545,7 +11545,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11554,7 +11554,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11727,7 +11727,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11736,7 +11736,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11842,7 +11842,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -11889,7 +11889,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -11899,7 +11899,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12021,7 +12021,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12031,7 +12031,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12104,7 +12104,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12151,7 +12151,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12161,7 +12161,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12300,7 +12300,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12310,7 +12310,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12368,7 +12368,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12415,7 +12415,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12425,7 +12425,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12613,7 +12613,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12623,7 +12623,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17766,7 +17766,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -17794,7 +17794,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -17870,7 +17870,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -17915,7 +17915,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py index c47780374ad4..0906058e44d8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py @@ -5606,7 +5606,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -5774,7 +5774,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -5825,7 +5825,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -7003,7 +7003,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -7029,7 +7029,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -7059,7 +7059,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -7100,7 +7100,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -7125,7 +7125,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -7168,7 +7168,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9806,7 +9806,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -9815,7 +9815,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -9893,7 +9893,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -11867,9 +11867,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11907,7 +11907,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11916,7 +11916,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -12053,7 +12053,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -12062,7 +12062,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12139,9 +12139,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -12179,7 +12179,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -12188,7 +12188,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -12346,7 +12346,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -12355,7 +12355,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12421,9 +12421,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -12461,7 +12461,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -12470,7 +12470,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -12685,7 +12685,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -12694,7 +12694,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12800,7 +12800,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12847,7 +12847,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12857,7 +12857,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -13012,7 +13012,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -13022,7 +13022,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -13095,7 +13095,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -13142,7 +13142,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -13152,7 +13152,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -13328,7 +13328,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -13338,7 +13338,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -13396,7 +13396,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -13443,7 +13443,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -13453,7 +13453,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -13687,7 +13687,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -13697,7 +13697,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -19257,7 +19257,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -19291,7 +19291,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -19372,7 +19372,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -19424,7 +19424,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py index f356eacab583..ee6cd0648ca6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py @@ -5272,7 +5272,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -5430,7 +5430,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -5474,7 +5474,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -6606,7 +6606,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6643,7 +6643,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -6668,7 +6668,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6706,7 +6706,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9199,7 +9199,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -9208,7 +9208,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -9279,7 +9279,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -11256,9 +11256,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11296,7 +11296,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11305,7 +11305,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11413,7 +11413,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11422,7 +11422,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11499,9 +11499,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11539,7 +11539,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11548,7 +11548,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11673,7 +11673,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11682,7 +11682,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11748,9 +11748,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11788,7 +11788,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11797,7 +11797,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11970,7 +11970,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11979,7 +11979,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12085,7 +12085,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12132,7 +12132,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12142,7 +12142,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12264,7 +12264,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12274,7 +12274,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12347,7 +12347,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12394,7 +12394,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12404,7 +12404,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12543,7 +12543,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12553,7 +12553,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12611,7 +12611,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12658,7 +12658,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12668,7 +12668,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12856,7 +12856,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12866,7 +12866,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18385,7 +18385,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -18430,7 +18430,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py index 23ce50459383..3b0b4eebd05f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py @@ -5680,7 +5680,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -5848,7 +5848,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -5899,7 +5899,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -7122,7 +7122,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -7163,7 +7163,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -7188,7 +7188,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -7231,7 +7231,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9901,7 +9901,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -9910,7 +9910,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -9993,7 +9993,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -12145,9 +12145,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -12185,7 +12185,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -12194,7 +12194,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -12331,7 +12331,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -12340,7 +12340,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12417,9 +12417,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -12457,7 +12457,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -12466,7 +12466,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -12624,7 +12624,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -12633,7 +12633,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12699,9 +12699,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -12739,7 +12739,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -12748,7 +12748,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -12963,7 +12963,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -12972,7 +12972,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -13078,7 +13078,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -13125,7 +13125,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -13135,7 +13135,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -13290,7 +13290,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -13300,7 +13300,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -13373,7 +13373,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -13420,7 +13420,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -13430,7 +13430,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -13606,7 +13606,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -13616,7 +13616,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -13674,7 +13674,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -13721,7 +13721,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -13731,7 +13731,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -13965,7 +13965,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -13975,7 +13975,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -19945,7 +19945,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -19997,7 +19997,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py index cc1e5c306263..b4e41749877c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py @@ -5295,7 +5295,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -5444,7 +5444,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -5485,7 +5485,7 @@ def __init__(self, **kwargs): .. raw:: html . :paramtype component_spec: any """ @@ -6529,7 +6529,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6561,7 +6561,7 @@ def __init__(self, **kwargs): :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -6586,7 +6586,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6621,7 +6621,7 @@ def __init__(self, **kwargs): :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8991,7 +8991,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -9000,7 +9000,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -9068,7 +9068,7 @@ def __init__(self, **kwargs): .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -11653,9 +11653,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11693,7 +11693,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11702,7 +11702,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11807,7 +11807,7 @@ def __init__(self, **kwargs): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11816,7 +11816,7 @@ def __init__(self, **kwargs): :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11893,9 +11893,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11933,7 +11933,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11942,7 +11942,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -12064,7 +12064,7 @@ def __init__(self, **kwargs): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -12073,7 +12073,7 @@ def __init__(self, **kwargs): :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12139,9 +12139,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -12179,7 +12179,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -12188,7 +12188,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -12358,7 +12358,7 @@ def __init__(self, **kwargs): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -12367,7 +12367,7 @@ def __init__(self, **kwargs): :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12473,7 +12473,7 @@ def __init__(self, **kwargs): class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12520,7 +12520,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12530,7 +12530,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12649,7 +12649,7 @@ def __init__(self, **kwargs): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12659,7 +12659,7 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12732,7 +12732,7 @@ def __init__(self, **kwargs): class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12779,7 +12779,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12789,7 +12789,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12925,7 +12925,7 @@ def __init__(self, **kwargs): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12935,7 +12935,7 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12993,7 +12993,7 @@ def __init__(self, **kwargs): class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -13040,7 +13040,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -13050,7 +13050,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -13235,7 +13235,7 @@ def __init__(self, **kwargs): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -13245,7 +13245,7 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18750,7 +18750,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -18792,7 +18792,7 @@ def __init__(self, **kwargs): :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py index a93bc6dcd7c1..ec36e0e8877e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py @@ -5900,7 +5900,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -6061,7 +6061,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -6112,7 +6112,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -7264,7 +7264,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -7303,7 +7303,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -7328,7 +7328,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -7371,7 +7371,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9941,7 +9941,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -9950,7 +9950,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -10033,7 +10033,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -12994,9 +12994,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -13034,7 +13034,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -13043,7 +13043,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -13180,7 +13180,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -13189,7 +13189,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -13266,9 +13266,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -13306,7 +13306,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -13315,7 +13315,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -13473,7 +13473,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -13482,7 +13482,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -13578,9 +13578,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -13618,7 +13618,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -13627,7 +13627,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -13842,7 +13842,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -13851,7 +13851,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -13987,7 +13987,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -14034,7 +14034,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -14044,7 +14044,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -14199,7 +14199,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -14209,7 +14209,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -14282,7 +14282,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -14329,7 +14329,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -14339,7 +14339,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -14515,7 +14515,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -14525,7 +14525,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -14617,7 +14617,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -14664,7 +14664,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -14674,7 +14674,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -14908,7 +14908,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -14918,7 +14918,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -21152,7 +21152,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -21204,7 +21204,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models.py index 7f4f5f5c7878..99ab08757dd7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models.py @@ -4843,7 +4843,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -5001,7 +5001,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -5045,7 +5045,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -6101,7 +6101,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -6123,7 +6123,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -6153,7 +6153,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6190,7 +6190,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -6215,7 +6215,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6253,7 +6253,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8565,7 +8565,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -8574,7 +8574,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -8648,7 +8648,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -10368,9 +10368,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -10408,7 +10408,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -10417,7 +10417,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -10525,7 +10525,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -10534,7 +10534,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -10611,9 +10611,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -10651,7 +10651,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -10660,7 +10660,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -10785,7 +10785,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -10794,7 +10794,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -10860,9 +10860,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -10900,7 +10900,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -10909,7 +10909,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11082,7 +11082,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11091,7 +11091,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11197,7 +11197,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -11244,7 +11244,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -11254,7 +11254,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -11376,7 +11376,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -11386,7 +11386,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11459,7 +11459,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -11506,7 +11506,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -11516,7 +11516,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -11655,7 +11655,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -11665,7 +11665,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11723,7 +11723,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -11770,7 +11770,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -11780,7 +11780,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -11968,7 +11968,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -11978,7 +11978,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16483,7 +16483,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -16511,7 +16511,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -16587,7 +16587,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -16632,7 +16632,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models_py3.py index 619d69b1ab62..54ca7c66aead 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models_py3.py @@ -5220,7 +5220,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -5388,7 +5388,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -5439,7 +5439,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -6580,7 +6580,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -6606,7 +6606,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -6636,7 +6636,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6677,7 +6677,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -6702,7 +6702,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -6745,7 +6745,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9228,7 +9228,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -9237,7 +9237,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -9324,7 +9324,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -11195,9 +11195,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11235,7 +11235,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11244,7 +11244,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11381,7 +11381,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11390,7 +11390,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11467,9 +11467,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11507,7 +11507,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11516,7 +11516,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -11674,7 +11674,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -11683,7 +11683,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -11749,9 +11749,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -11789,7 +11789,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -11798,7 +11798,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -12013,7 +12013,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -12022,7 +12022,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12128,7 +12128,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12175,7 +12175,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12185,7 +12185,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12340,7 +12340,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12350,7 +12350,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12423,7 +12423,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12470,7 +12470,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12480,7 +12480,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -12656,7 +12656,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -12666,7 +12666,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -12724,7 +12724,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -12771,7 +12771,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -12781,7 +12781,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -13015,7 +13015,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -13025,7 +13025,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17892,7 +17892,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -17926,7 +17926,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -18007,7 +18007,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -18059,7 +18059,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py index d0b0e1b5f374..1165d3eb8142 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py @@ -6349,7 +6349,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -6511,7 +6511,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -6563,7 +6563,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -7759,7 +7759,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -7781,7 +7781,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -7811,7 +7811,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -7848,7 +7848,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -7873,7 +7873,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -7911,7 +7911,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -11080,7 +11080,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -11089,7 +11089,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -11172,7 +11172,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -14307,9 +14307,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -14347,7 +14347,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -14356,7 +14356,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -14464,7 +14464,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -14473,7 +14473,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -14550,9 +14550,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -14590,7 +14590,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -14599,7 +14599,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -14724,7 +14724,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -14733,7 +14733,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -14799,9 +14799,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -14839,7 +14839,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -14848,7 +14848,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15021,7 +15021,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15030,7 +15030,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15136,7 +15136,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -15183,7 +15183,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -15193,7 +15193,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -15315,7 +15315,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -15325,7 +15325,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15398,7 +15398,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -15445,7 +15445,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -15455,7 +15455,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -15594,7 +15594,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -15604,7 +15604,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15662,7 +15662,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -15709,7 +15709,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -15719,7 +15719,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -15917,7 +15917,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -15927,7 +15927,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -23358,7 +23358,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -23386,7 +23386,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -23462,7 +23462,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -23507,7 +23507,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py index 626f8ed291bf..b8e2b7bcd701 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py @@ -6823,7 +6823,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -6995,7 +6995,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -7056,7 +7056,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -8345,7 +8345,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8371,7 +8371,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8401,7 +8401,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8442,7 +8442,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -8467,7 +8467,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8510,7 +8510,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -11919,7 +11919,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -11928,7 +11928,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -12026,7 +12026,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -15438,9 +15438,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15478,7 +15478,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15487,7 +15487,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15624,7 +15624,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15633,7 +15633,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15710,9 +15710,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15750,7 +15750,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15759,7 +15759,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15917,7 +15917,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15926,7 +15926,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15992,9 +15992,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16032,7 +16032,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16041,7 +16041,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16256,7 +16256,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16265,7 +16265,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16371,7 +16371,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16418,7 +16418,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16428,7 +16428,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16583,7 +16583,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16593,7 +16593,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16666,7 +16666,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16713,7 +16713,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16723,7 +16723,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16899,7 +16899,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16909,7 +16909,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16967,7 +16967,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17014,7 +17014,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17024,7 +17024,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17270,7 +17270,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17280,7 +17280,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -25319,7 +25319,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -25353,7 +25353,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -25434,7 +25434,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -25486,7 +25486,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models.py index fe9068164eb6..d2ae30a5af84 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models.py @@ -6452,7 +6452,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -6614,7 +6614,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -6666,7 +6666,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -7862,7 +7862,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -7884,7 +7884,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -7914,7 +7914,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -7951,7 +7951,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -7976,7 +7976,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8014,7 +8014,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -11287,7 +11287,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -11296,7 +11296,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -11379,7 +11379,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -14863,9 +14863,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -14903,7 +14903,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -14912,7 +14912,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15020,7 +15020,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15029,7 +15029,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15106,9 +15106,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15146,7 +15146,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15155,7 +15155,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15280,7 +15280,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15289,7 +15289,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15355,9 +15355,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15395,7 +15395,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15404,7 +15404,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15577,7 +15577,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15586,7 +15586,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15692,7 +15692,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -15739,7 +15739,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -15749,7 +15749,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -15871,7 +15871,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -15881,7 +15881,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15954,7 +15954,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16001,7 +16001,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16011,7 +16011,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16150,7 +16150,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16160,7 +16160,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16218,7 +16218,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16265,7 +16265,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16275,7 +16275,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16473,7 +16473,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16483,7 +16483,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -23883,7 +23883,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -23911,7 +23911,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -23987,7 +23987,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -24032,7 +24032,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models_py3.py index e963a760a83f..824fef4839bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models_py3.py @@ -6926,7 +6926,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -7098,7 +7098,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -7159,7 +7159,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -8448,7 +8448,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8474,7 +8474,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8504,7 +8504,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8545,7 +8545,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -8570,7 +8570,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8613,7 +8613,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -12137,7 +12137,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -12146,7 +12146,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -12244,7 +12244,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -16033,9 +16033,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16073,7 +16073,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16082,7 +16082,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16219,7 +16219,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16228,7 +16228,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16305,9 +16305,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16345,7 +16345,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16354,7 +16354,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16512,7 +16512,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16521,7 +16521,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16587,9 +16587,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16627,7 +16627,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16636,7 +16636,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16851,7 +16851,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16860,7 +16860,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16966,7 +16966,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17013,7 +17013,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17023,7 +17023,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17178,7 +17178,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17188,7 +17188,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17261,7 +17261,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17308,7 +17308,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17318,7 +17318,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17494,7 +17494,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17504,7 +17504,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17562,7 +17562,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17609,7 +17609,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17619,7 +17619,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17865,7 +17865,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17875,7 +17875,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -25885,7 +25885,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -25919,7 +25919,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule @@ -26000,7 +26000,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -26052,7 +26052,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models.py index 1c1b3c539fdd..d22720e97eee 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models.py @@ -6614,7 +6614,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -6776,7 +6776,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -6828,7 +6828,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -8102,7 +8102,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8124,7 +8124,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8154,7 +8154,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8191,7 +8191,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -8216,7 +8216,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8254,7 +8254,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -11534,7 +11534,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -11543,7 +11543,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -11626,7 +11626,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -15155,9 +15155,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15195,7 +15195,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15204,7 +15204,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15312,7 +15312,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15321,7 +15321,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15398,9 +15398,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15438,7 +15438,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15447,7 +15447,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15572,7 +15572,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15581,7 +15581,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15647,9 +15647,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15687,7 +15687,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15696,7 +15696,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15869,7 +15869,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15878,7 +15878,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15984,7 +15984,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16031,7 +16031,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16041,7 +16041,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16163,7 +16163,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16173,7 +16173,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16246,7 +16246,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16293,7 +16293,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16303,7 +16303,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16442,7 +16442,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16452,7 +16452,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16510,7 +16510,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16557,7 +16557,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16567,7 +16567,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16765,7 +16765,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16775,7 +16775,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -25177,7 +25177,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -25206,7 +25206,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -25282,7 +25282,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -25327,7 +25327,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models_py3.py index 87cbd3851fef..6911dae5a24c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models_py3.py @@ -7103,7 +7103,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -7275,7 +7275,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -7336,7 +7336,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -8712,7 +8712,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8738,7 +8738,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8768,7 +8768,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8809,7 +8809,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -8834,7 +8834,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8877,7 +8877,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -12411,7 +12411,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -12420,7 +12420,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -12518,7 +12518,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -16355,9 +16355,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16395,7 +16395,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16404,7 +16404,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16541,7 +16541,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16550,7 +16550,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16627,9 +16627,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16667,7 +16667,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16676,7 +16676,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16834,7 +16834,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16843,7 +16843,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16909,9 +16909,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16949,7 +16949,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16958,7 +16958,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17173,7 +17173,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17182,7 +17182,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17288,7 +17288,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17335,7 +17335,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17345,7 +17345,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17500,7 +17500,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17510,7 +17510,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17583,7 +17583,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17630,7 +17630,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17640,7 +17640,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17816,7 +17816,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17826,7 +17826,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17884,7 +17884,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17931,7 +17931,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17941,7 +17941,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18187,7 +18187,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18197,7 +18197,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -27293,7 +27293,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -27328,7 +27328,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -27409,7 +27409,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -27461,7 +27461,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_10_01/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_10_01/models/_models_py3.py index e69cc93262a8..0129e8fa69d6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_10_01/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_10_01/models/_models_py3.py @@ -5720,7 +5720,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html . Variables are only populated by the server, and will be ignored when sending a request. @@ -5884,7 +5884,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: JSON :ivar provisioning_state: Provisioning state for the component version. Known values are: @@ -5935,7 +5935,7 @@ def __init__( .. raw:: html . :paramtype component_spec: JSON """ @@ -7165,7 +7165,7 @@ class Cron(_serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -7191,7 +7191,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -7221,7 +7221,7 @@ class TriggerBase(_serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: [Required]. Required. Known values are: "Recurrence" and "Cron". :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType @@ -7254,7 +7254,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super().__init__(**kwargs) @@ -7279,7 +7279,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: [Required]. Required. Known values are: "Recurrence" and "Cron". :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType @@ -7321,7 +7321,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. Required. @@ -10111,7 +10111,7 @@ class EnvironmentVersionProperties(AssetBase): # pylint: disable=too-many-insta .. raw:: html . Known values are: "Curated" and "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -10120,7 +10120,7 @@ class EnvironmentVersionProperties(AssetBase): # pylint: disable=too-many-insta .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -10207,7 +10207,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -13556,9 +13556,9 @@ class ImageModelDistributionSettings(_serialization.Model): # pylint: disable=t valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -13596,7 +13596,7 @@ class ImageModelDistributionSettings(_serialization.Model): # pylint: disable=t For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -13605,7 +13605,7 @@ class ImageModelDistributionSettings(_serialization.Model): # pylint: disable=t :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -13742,7 +13742,7 @@ def __init__( # pylint: disable=too-many-locals For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -13751,7 +13751,7 @@ def __init__( # pylint: disable=too-many-locals :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -13830,9 +13830,9 @@ class ImageModelDistributionSettingsClassification( LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -13870,7 +13870,7 @@ class ImageModelDistributionSettingsClassification( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -13879,7 +13879,7 @@ class ImageModelDistributionSettingsClassification( :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -14037,7 +14037,7 @@ def __init__( # pylint: disable=too-many-locals For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -14046,7 +14046,7 @@ def __init__( # pylint: disable=too-many-locals :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -14144,9 +14144,9 @@ class ImageModelDistributionSettingsObjectDetection( LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -14184,7 +14184,7 @@ class ImageModelDistributionSettingsObjectDetection( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -14193,7 +14193,7 @@ class ImageModelDistributionSettingsObjectDetection( :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -14408,7 +14408,7 @@ def __init__( # pylint: disable=too-many-locals For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -14417,7 +14417,7 @@ def __init__( # pylint: disable=too-many-locals :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -14553,7 +14553,7 @@ def __init__( # pylint: disable=too-many-locals class ImageModelSettings(_serialization.Model): # pylint: disable=too-many-instance-attributes """Settings used for training the model. For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -14600,7 +14600,7 @@ class ImageModelSettings(_serialization.Model): # pylint: disable=too-many-inst For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -14610,7 +14610,7 @@ class ImageModelSettings(_serialization.Model): # pylint: disable=too-many-inst ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -14765,7 +14765,7 @@ def __init__( # pylint: disable=too-many-locals For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -14775,7 +14775,7 @@ def __init__( # pylint: disable=too-many-locals ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -14848,7 +14848,7 @@ def __init__( # pylint: disable=too-many-locals class ImageModelSettingsClassification(ImageModelSettings): # pylint: disable=too-many-instance-attributes """Settings used for training the model. For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -14895,7 +14895,7 @@ class ImageModelSettingsClassification(ImageModelSettings): # pylint: disable=t For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -14905,7 +14905,7 @@ class ImageModelSettingsClassification(ImageModelSettings): # pylint: disable=t ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -15081,7 +15081,7 @@ def __init__( # pylint: disable=too-many-locals For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -15091,7 +15091,7 @@ def __init__( # pylint: disable=too-many-locals ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15183,7 +15183,7 @@ def __init__( # pylint: disable=too-many-locals class ImageModelSettingsObjectDetection(ImageModelSettings): # pylint: disable=too-many-instance-attributes """Settings used for training the model. For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -15230,7 +15230,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): # pylint: disable= For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -15240,7 +15240,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): # pylint: disable= ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -15474,7 +15474,7 @@ def __init__( # pylint: disable=too-many-locals For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -15484,7 +15484,7 @@ def __init__( # pylint: disable=too-many-locals ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -21214,7 +21214,7 @@ class Recurrence(_serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -21249,7 +21249,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -21330,7 +21330,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: [Required]. Required. Known values are: "Recurrence" and "Cron". :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType @@ -21381,7 +21381,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: [Required] The frequency to trigger schedule. Required. Known values are: "Minute", "Hour", "Day", "Week", and "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models.py index 72261ed2910c..ae7539830f7c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models.py @@ -7562,7 +7562,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -7724,7 +7724,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -7776,7 +7776,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -9306,7 +9306,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9328,7 +9328,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9358,7 +9358,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -9395,7 +9395,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -9420,7 +9420,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -9458,7 +9458,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -13180,7 +13180,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -13189,7 +13189,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -13272,7 +13272,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -17014,9 +17014,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17054,7 +17054,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -17063,7 +17063,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17171,7 +17171,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17180,7 +17180,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17257,9 +17257,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17297,7 +17297,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -17306,7 +17306,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17431,7 +17431,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17440,7 +17440,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17506,9 +17506,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17546,7 +17546,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -17555,7 +17555,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17728,7 +17728,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17737,7 +17737,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17843,7 +17843,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17890,7 +17890,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17900,7 +17900,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18022,7 +18022,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18032,7 +18032,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18105,7 +18105,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -18152,7 +18152,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -18162,7 +18162,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18301,7 +18301,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18311,7 +18311,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18369,7 +18369,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -18416,7 +18416,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -18426,7 +18426,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18624,7 +18624,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18634,7 +18634,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -27895,7 +27895,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -27924,7 +27924,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -28000,7 +28000,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -28045,7 +28045,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models_py3.py index d967e0c7e151..0cce7c2c64a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models_py3.py @@ -8128,7 +8128,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -8300,7 +8300,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -8361,7 +8361,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -10012,7 +10012,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -10038,7 +10038,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -10068,7 +10068,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -10109,7 +10109,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -10134,7 +10134,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -10177,7 +10177,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -14189,7 +14189,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -14198,7 +14198,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -14296,7 +14296,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -18370,9 +18370,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -18410,7 +18410,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -18419,7 +18419,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -18556,7 +18556,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -18565,7 +18565,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18642,9 +18642,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -18682,7 +18682,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -18691,7 +18691,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -18849,7 +18849,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -18858,7 +18858,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18924,9 +18924,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -18964,7 +18964,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -18973,7 +18973,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -19188,7 +19188,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -19197,7 +19197,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -19303,7 +19303,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -19350,7 +19350,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -19360,7 +19360,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -19515,7 +19515,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -19525,7 +19525,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -19598,7 +19598,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -19645,7 +19645,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -19655,7 +19655,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -19831,7 +19831,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -19841,7 +19841,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -19899,7 +19899,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -19946,7 +19946,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -19956,7 +19956,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -20202,7 +20202,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -20212,7 +20212,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -30228,7 +30228,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -30263,7 +30263,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -30344,7 +30344,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -30396,7 +30396,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models.py index e791f7b72139..daccee47223c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models.py @@ -7571,7 +7571,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -7733,7 +7733,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -7785,7 +7785,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -9334,7 +9334,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9356,7 +9356,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9386,7 +9386,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -9423,7 +9423,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -9448,7 +9448,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -9486,7 +9486,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -13210,7 +13210,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -13219,7 +13219,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -13302,7 +13302,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -17067,9 +17067,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17107,7 +17107,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -17116,7 +17116,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17224,7 +17224,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17233,7 +17233,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17310,9 +17310,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17350,7 +17350,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -17359,7 +17359,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17484,7 +17484,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17493,7 +17493,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17559,9 +17559,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17599,7 +17599,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -17608,7 +17608,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17781,7 +17781,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17790,7 +17790,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17896,7 +17896,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17943,7 +17943,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17953,7 +17953,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18075,7 +18075,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18085,7 +18085,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18158,7 +18158,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -18205,7 +18205,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -18215,7 +18215,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18354,7 +18354,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18364,7 +18364,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18422,7 +18422,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -18469,7 +18469,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -18479,7 +18479,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18677,7 +18677,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18687,7 +18687,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -28431,7 +28431,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -28460,7 +28460,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -28536,7 +28536,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -28581,7 +28581,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models_py3.py index 8e5625ef3647..dcb2def94e72 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models_py3.py @@ -8137,7 +8137,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -8309,7 +8309,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -8370,7 +8370,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any :keyword stage: Stage in the component lifecycle. @@ -10042,7 +10042,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -10068,7 +10068,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -10098,7 +10098,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -10139,7 +10139,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -10164,7 +10164,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -10207,7 +10207,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -14221,7 +14221,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -14230,7 +14230,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -14328,7 +14328,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -18427,9 +18427,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -18467,7 +18467,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -18476,7 +18476,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -18613,7 +18613,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -18622,7 +18622,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18699,9 +18699,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -18739,7 +18739,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -18748,7 +18748,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -18906,7 +18906,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -18915,7 +18915,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18981,9 +18981,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -19021,7 +19021,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -19030,7 +19030,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -19245,7 +19245,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -19254,7 +19254,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -19360,7 +19360,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -19407,7 +19407,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -19417,7 +19417,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -19572,7 +19572,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -19582,7 +19582,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -19655,7 +19655,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -19702,7 +19702,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -19712,7 +19712,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -19888,7 +19888,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -19898,7 +19898,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -19956,7 +19956,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -20003,7 +20003,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -20013,7 +20013,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -20259,7 +20259,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -20269,7 +20269,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -30808,7 +30808,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -30843,7 +30843,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -30924,7 +30924,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -30976,7 +30976,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models.py index 4367e5524e01..6a382c7e1252 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models.py @@ -6450,7 +6450,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -6608,7 +6608,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -6652,7 +6652,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -8265,7 +8265,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8287,7 +8287,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8317,7 +8317,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8354,7 +8354,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -8379,7 +8379,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8417,7 +8417,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -11990,7 +11990,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -11999,7 +11999,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -12073,7 +12073,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -15229,9 +15229,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15269,7 +15269,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15278,7 +15278,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15386,7 +15386,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15395,7 +15395,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15472,9 +15472,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15512,7 +15512,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15521,7 +15521,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15646,7 +15646,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15655,7 +15655,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -15721,9 +15721,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -15761,7 +15761,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -15770,7 +15770,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -15943,7 +15943,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -15952,7 +15952,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16058,7 +16058,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16105,7 +16105,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16115,7 +16115,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16237,7 +16237,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16247,7 +16247,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16320,7 +16320,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16367,7 +16367,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16377,7 +16377,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16516,7 +16516,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16526,7 +16526,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16584,7 +16584,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16631,7 +16631,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16641,7 +16641,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -16829,7 +16829,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -16839,7 +16839,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -23984,7 +23984,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -24013,7 +24013,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -24089,7 +24089,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -24134,7 +24134,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models_py3.py index d385b6fae657..fa9ed84e1e80 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models_py3.py @@ -6939,7 +6939,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -7107,7 +7107,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -7158,7 +7158,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -8899,7 +8899,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8925,7 +8925,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8955,7 +8955,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8996,7 +8996,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -9021,7 +9021,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -9064,7 +9064,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -12927,7 +12927,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -12936,7 +12936,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -13023,7 +13023,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -16453,9 +16453,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16493,7 +16493,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16502,7 +16502,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16639,7 +16639,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16648,7 +16648,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16725,9 +16725,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16765,7 +16765,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16774,7 +16774,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16932,7 +16932,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16941,7 +16941,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17007,9 +17007,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17047,7 +17047,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -17056,7 +17056,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17271,7 +17271,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17280,7 +17280,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17386,7 +17386,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17433,7 +17433,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17443,7 +17443,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17598,7 +17598,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17608,7 +17608,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17681,7 +17681,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17728,7 +17728,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17738,7 +17738,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17914,7 +17914,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17924,7 +17924,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17982,7 +17982,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -18029,7 +18029,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -18039,7 +18039,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18273,7 +18273,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18283,7 +18283,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -26007,7 +26007,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -26042,7 +26042,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -26123,7 +26123,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -26175,7 +26175,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models.py index 2f3261e47885..e998cda3ae50 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models.py @@ -6801,7 +6801,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -6959,7 +6959,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -7003,7 +7003,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -8622,7 +8622,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8644,7 +8644,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -8674,7 +8674,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8711,7 +8711,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -8736,7 +8736,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -8774,7 +8774,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -12606,7 +12606,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -12615,7 +12615,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -12689,7 +12689,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -16084,9 +16084,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16124,7 +16124,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16133,7 +16133,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16241,7 +16241,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16250,7 +16250,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16327,9 +16327,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16367,7 +16367,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16376,7 +16376,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16501,7 +16501,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16510,7 +16510,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16576,9 +16576,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -16616,7 +16616,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -16625,7 +16625,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -16798,7 +16798,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -16807,7 +16807,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -16913,7 +16913,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -16960,7 +16960,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -16970,7 +16970,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17092,7 +17092,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17102,7 +17102,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17175,7 +17175,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17222,7 +17222,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17232,7 +17232,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17371,7 +17371,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17381,7 +17381,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17439,7 +17439,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -17486,7 +17486,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -17496,7 +17496,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -17684,7 +17684,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -17694,7 +17694,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -25506,7 +25506,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -25535,7 +25535,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -25611,7 +25611,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -25656,7 +25656,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models_py3.py index fcb36586ee8b..05353fd2ca50 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models_py3.py @@ -7322,7 +7322,7 @@ class ComponentContainerProperties(AssetContainer): .. raw:: html - . + . Variables are only populated by the server, and will be ignored when sending a request. @@ -7490,7 +7490,7 @@ class ComponentVersionProperties(AssetBase): .. raw:: html . :vartype component_spec: any :ivar provisioning_state: Provisioning state for the component version. Possible values @@ -7541,7 +7541,7 @@ def __init__( .. raw:: html . :paramtype component_spec: any """ @@ -9289,7 +9289,7 @@ class Cron(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9315,7 +9315,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -9345,7 +9345,7 @@ class TriggerBase(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -9386,7 +9386,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) @@ -9411,7 +9411,7 @@ class CronTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -9454,7 +9454,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword expression: Required. [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. @@ -13604,7 +13604,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. @@ -13613,7 +13613,7 @@ class EnvironmentVersionProperties(AssetBase): .. raw:: html . :vartype image: str :ivar inference_config: Defines configuration specific to inference. @@ -13700,7 +13700,7 @@ def __init__( .. raw:: html . :paramtype image: str :keyword inference_config: Defines configuration specific to inference. @@ -17397,9 +17397,9 @@ class ImageModelDistributionSettings(msrest.serialization.Model): All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17437,7 +17437,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -17446,7 +17446,7 @@ class ImageModelDistributionSettings(msrest.serialization.Model): :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17583,7 +17583,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17592,7 +17592,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17669,9 +17669,9 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17709,7 +17709,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -17718,7 +17718,7 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -17876,7 +17876,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -17885,7 +17885,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -17951,9 +17951,9 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin LayersToFreeze = "choice(0, 2)"; ```` For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :vartype ams_gradient: str @@ -17991,7 +17991,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: str :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: str @@ -18000,7 +18000,7 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin :vartype learning_rate_scheduler: str :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: str @@ -18215,7 +18215,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: str :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: str @@ -18224,7 +18224,7 @@ def __init__( :paramtype learning_rate_scheduler: str :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18330,7 +18330,7 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -18377,7 +18377,7 @@ class ImageModelSettings(msrest.serialization.Model): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -18387,7 +18387,7 @@ class ImageModelSettings(msrest.serialization.Model): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18542,7 +18542,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18552,7 +18552,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18625,7 +18625,7 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -18672,7 +18672,7 @@ class ImageModelSettingsClassification(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -18682,7 +18682,7 @@ class ImageModelSettingsClassification(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -18858,7 +18858,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -18868,7 +18868,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -18926,7 +18926,7 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :ivar advanced_settings: Settings for advanced scenarios. :vartype advanced_settings: str @@ -18973,7 +18973,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype layers_to_freeze: int :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :vartype learning_rate: float @@ -18983,7 +18983,7 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :ivar model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :vartype model_name: str :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :vartype momentum: float @@ -19217,7 +19217,7 @@ def __init__( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -19227,7 +19227,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :paramtype model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. @@ -27679,7 +27679,7 @@ class Recurrence(msrest.serialization.Model): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar schedule: [Required] The recurrence schedule. :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -27714,7 +27714,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword schedule: [Required] The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule @@ -27795,7 +27795,7 @@ class RecurrenceTrigger(TriggerBase): :vartype start_time: str :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :vartype time_zone: str :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: "Recurrence", "Cron". @@ -27847,7 +27847,7 @@ def __init__( :paramtype start_time: str :keyword time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. :paramtype time_zone: str :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_artifact_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_artifact_utils.py index 8b19c7c36e39..9dafaf79e339 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_artifact_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_artifact_utils.py @@ -132,7 +132,7 @@ def get_organization_project_by_git(): # Organization URL has two format, https://dev.azure.com/{organization} and # https://{organization}.visualstudio.com - # https://docs.microsoft.com/en-us/azure/devops/extend/develop/work-with-urls?view=azure-devops&tabs=http + # https://learn.microsoft.com/azure/devops/extend/develop/work-with-urls?view=azure-devops&tabs=http if "dev.azure.com" in origin_url: regex = r"^https:\/\/\w*@?dev\.azure\.com\/(\w*)\/(\w*)" results = re.findall(regex, origin_url) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_image.py b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_image.py index 82ac498268fb..521c9aa2064d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_image.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_image.py @@ -80,7 +80,7 @@ def image_classification( :keyword primary_metric: The metric that Automated Machine Learning will optimize for model selection. Automated Machine Learning collects more metrics than it can optimize. For more information on how metrics are calculated, see - https://docs.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. + https://learn.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. Acceptable values: accuracy, AUC_weighted, norm_macro_recall, average_precision_score_weighted, and precision_score_weighted @@ -140,7 +140,7 @@ def image_classification_multilabel( :keyword primary_metric: The metric that Automated Machine Learning will optimize for model selection. Automated Machine Learning collects more metrics than it can optimize. For more information on how metrics are calculated, see - https://docs.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. + https://learn.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. Acceptable values: accuracy, AUC_weighted, norm_macro_recall, average_precision_score_weighted, precision_score_weighted, and Iou @@ -200,7 +200,7 @@ def image_object_detection( :keyword primary_metric: The metric that Automated Machine Learning will optimize for model selection. Automated Machine Learning collects more metrics than it can optimize. For more information on how metrics are calculated, see - https://docs.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. + https://learn.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. Acceptable values: MeanAveragePrecision Defaults to MeanAveragePrecision. @@ -259,7 +259,7 @@ def image_instance_segmentation( :keyword primary_metric: The metric that Automated Machine Learning will optimize for model selection. Automated Machine Learning collects more metrics than it can optimize. For more information on how metrics are calculated, see - https://docs.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. + https://learn.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. Acceptable values: MeanAveragePrecision Defaults to MeanAveragePrecision. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_nlp.py b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_nlp.py index c7bddc3f519e..ac7ebcf6631c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_nlp.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_nlp.py @@ -82,7 +82,7 @@ def text_classification_multilabel( A text classification multilabel job is used to train a model that can predict the classes/categories of a text data. Input training data should include a target column that classifies the text into class(es). For more information on format of multilabel data, refer to: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-nlp-models#multi-label + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-nlp-models#multi-label :keyword training_data: The training data to be used within the experiment. It should contain both training features and a target column. @@ -137,7 +137,7 @@ def text_ner( A text named entity recognition job is used to train a model that can predict the named entities in the text. Input training data should be a text file in CoNLL format. For more information on format of text NER data, refer to: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-nlp-models#named-entity-recognition-ner + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-nlp-models#named-entity-recognition-ner :keyword training_data: The training data to be used within the experiment. It should contain both training features and a target column. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_tabular.py b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_tabular.py index 7d0fecc741b9..9c45e5f1c938 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_tabular.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_tabular.py @@ -46,7 +46,7 @@ def classification( :keyword primary_metric: The metric that Automated Machine Learning will optimize for model selection. Automated Machine Learning collects more metrics than it can optimize. For more information on how metrics are calculated, see - https://docs.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. + https://learn.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. Acceptable values: accuracy, AUC_weighted, norm_macro_recall, average_precision_score_weighted, and precision_score_weighted @@ -56,7 +56,7 @@ def classification( training iterations. The default is None. For more information, see `Interpretability: model explanations in automated machine learning - `__. + `__. :paramtype enable_model_explainability: bool :keyword weight_column_name: The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. @@ -78,7 +78,7 @@ def classification( For custom cross validation fold, use ``cv_split_column_names``. For more information, see - `Configure data splits and cross-validation in automated machine learning `__. Defaults to None @@ -90,7 +90,7 @@ def classification( For custom cross validation fold, use ``cv_split_column_names``. For more information, see - `Configure data splits and cross-validation in automated machine learning `__. Defaults to None @@ -188,7 +188,7 @@ def regression( :keyword primary_metric: The metric that Automated Machine Learning will optimize for model selection. Automated Machine Learning collects more metrics than it can optimize. For more information on how metrics are calculated, see - https://docs.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. + https://learn.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. Acceptable values: spearman_correlation, r2_score, normalized_mean_absolute_error, normalized_root_mean_squared_error. @@ -198,7 +198,7 @@ def regression( training iterations. The default is None. For more information, see `Interpretability: model explanations in automated machine learning - `__. + `__. :paramtype enable_model_explainability: bool :keyword weight_column_name: The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. @@ -220,7 +220,7 @@ def regression( For custom cross validation fold, use ``cv_split_column_names``. For more information, see - `Configure data splits and cross-validation in automated machine learning `__. Defaults to None @@ -232,7 +232,7 @@ def regression( For custom cross validation fold, use ``cv_split_column_names``. For more information, see - `Configure data splits and cross-validation in automated machine learning `__. Defaults to None @@ -330,7 +330,7 @@ def forecasting( :keyword primary_metric: The metric that Automated Machine Learning will optimize for model selection. Automated Machine Learning collects more metrics than it can optimize. For more information on how metrics are calculated, see - https://docs.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. + https://learn.microsoft.com/azure/machine-learning/how-to-configure-auto-train#primary-metric. Acceptable values: r2_score, normalized_mean_absolute_error, normalized_root_mean_squared_error Defaults to normalized_root_mean_squared_error @@ -339,7 +339,7 @@ def forecasting( training iterations. The default is None. For more information, see `Interpretability: model explanations in automated machine learning - `__. + `__. :paramtype enable_model_explainability: bool :keyword weight_column_name: The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. @@ -361,7 +361,7 @@ def forecasting( For custom cross validation fold, use ``cv_split_column_names``. For more information, see - `Configure data splits and cross-validation in automated machine learning `__. Defaults to None @@ -373,7 +373,7 @@ def forecasting( For custom cross validation fold, use ``cv_split_column_names``. For more information, see - `Configure data splits and cross-validation in automated machine learning `__. Defaults to None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py index df490b0fdeb9..647b261f29b0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py @@ -168,7 +168,7 @@ "\nAdditional Resources: The easiest way to author a yaml specification file is using IntelliSense and " "auto-completion Azure ML VS code extension provides: " "{link_color}https://code.visualstudio.com/docs/datascience/azure-machine-learning.{reset} " - "To set up VS Code, visit {link_color}https://docs.microsoft.com/azure/machine-learning/how-to-setup-vs-" + "To set up VS Code, visit {link_color}https://learn.microsoft.com/azure/machine-learning/how-to-setup-vs-" "code{reset}\n" ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py index 11dd9127b854..0c41f1a3e6ad 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py @@ -54,7 +54,7 @@ class FeatureStore(Workspace): :param hbi_workspace: Boolean for whether the customer data is of high business impact (HBI), containing sensitive business information. Defaults to False. For more information, see - https://docs.microsoft.com/azure/machine-learning/concept-data-encryption#encryption-at-rest. + https://learn.microsoft.com/azure/machine-learning/concept-data-encryption#encryption-at-rest. :type hbi_workspace: Optional[bool] :param storage_account: The resource ID of an existing storage account to use instead of creating a new one. Defaults to None. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_classification_base.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_classification_base.py index 3d73ba7b7c62..ef0c8a2db679 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_classification_base.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_classification_base.py @@ -219,7 +219,7 @@ def set_training_parameters( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/reference-automl-images-hyperparameters#model-agnostic-hyperparameters. # pylint: disable=line-too-long + see: https://learn.microsoft.com/azure/machine-learning/reference-automl-images-hyperparameters#model-agnostic-hyperparameters. # pylint: disable=line-too-long :type layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -229,7 +229,7 @@ def set_training_parameters( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_object_detection_base.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_object_detection_base.py index 5ae6fd0e1280..db0c7bc6c660 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_object_detection_base.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_object_detection_base.py @@ -220,7 +220,7 @@ def set_training_parameters( For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/reference-automl-images-hyperparameters#model-agnostic-hyperparameters. # pylint: disable=line-too-long + see: https://learn.microsoft.com/azure/machine-learning/reference-automl-images-hyperparameters#model-agnostic-hyperparameters. # pylint: disable=line-too-long :type layers_to_freeze: int :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :paramtype learning_rate: float @@ -230,7 +230,7 @@ def set_training_parameters( ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :keyword model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type model_name: str :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_search_space.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_search_space.py index d2796216a168..0691f243294b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_search_space.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_search_space.py @@ -52,7 +52,7 @@ class ImageClassificationSearchSpace(RestTranslatableMixin): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/reference-automl-images-hyperparameters#model-agnostic-hyperparameters. # pylint: disable=line-too-long + see: https://learn.microsoft.com/azure/machine-learning/reference-automl-images-hyperparameters#model-agnostic-hyperparameters. # pylint: disable=line-too-long :type layers_to_freeze: int or ~azure.ai.ml.entities._job.sweep.search_space.SweepDistribution :param learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :type learning_rate: float or ~azure.ai.ml.entities._job.sweep.search_space.SweepDistribution @@ -61,7 +61,7 @@ class ImageClassificationSearchSpace(RestTranslatableMixin): :type learning_rate_scheduler: str or ~azure.ai.ml.entities._job.sweep.search_space.SweepDistribution :param model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type model_name: str or ~azure.ai.ml.entities._job.sweep.search_space.SweepDistribution :param momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_model_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_model_settings.py index 1b075c22a792..890f987a67e9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_model_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_model_settings.py @@ -67,7 +67,7 @@ class ImageModelDistributionSettings(RestTranslatableMixin): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type layers_to_freeze: int :param learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :type learning_rate: float @@ -77,7 +77,7 @@ class ImageModelDistributionSettings(RestTranslatableMixin): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :param model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type model_name: str :param momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :type momentum: float @@ -259,7 +259,7 @@ class ImageModelSettingsClassification(ImageModelDistributionSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type layers_to_freeze: int :param learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :type learning_rate: float @@ -269,7 +269,7 @@ class ImageModelSettingsClassification(ImageModelDistributionSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :param model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type model_name: str :param momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :type momentum: float @@ -540,7 +540,7 @@ class ImageModelSettingsObjectDetection(ImageModelDistributionSettings): For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type layers_to_freeze: int :param learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :type learning_rate: float @@ -550,7 +550,7 @@ class ImageModelSettingsObjectDetection(ImageModelDistributionSettings): ~azure.mgmt.machinelearningservices.models.LearningRateScheduler :param model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type model_name: str :param momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. :type momentum: float diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_search_space.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_search_space.py index 1a5e4e17f529..a9004d1ed25c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_search_space.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_search_space.py @@ -58,7 +58,7 @@ class ImageObjectDetectionSearchSpace(RestTranslatableMixin): :param layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please - see: https://docs.microsoft.com/en-us/azure/machine-learning/reference-automl-images-hyperparameters#model-agnostic-hyperparameters. # pylint: disable=line-too-long + see: https://learn.microsoft.com/azure/machine-learning/reference-automl-images-hyperparameters#model-agnostic-hyperparameters. # pylint: disable=line-too-long :type layers_to_freeze: int or ~azure.ai.ml.entities.SweepDistribution :param learning_rate: Initial learning rate. Must be a float in the range [0, 1]. :type learning_rate: float or ~azure.ai.ml.entities.SweepDistribution @@ -67,7 +67,7 @@ class ImageObjectDetectionSearchSpace(RestTranslatableMixin): :type learning_rate_scheduler: str or ~azure.ai.ml.entities.SweepDistribution :param model_name: Name of the model to use for training. For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. :type model_name: str or ~azure.ai.ml.entities.SweepDistribution :param momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/automl_tabular.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/automl_tabular.py index cfa1346b9799..5f4ed22b3249 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/automl_tabular.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/automl_tabular.py @@ -270,7 +270,7 @@ def set_limits( :keyword exit_score: Target score for experiment. The experiment terminates after this score is reached. If not specified (no criteria), the experiment runs until no further progress is made on the primary metric. For for more information on exit criteria, see this `article - `_ + `_ , defaults to None :paramtype exit_score: typing.Optional[float] :keyword max_concurrent_trials: This is the maximum number of iterations that would be executed in parallel. @@ -358,7 +358,7 @@ def set_training( :keyword enable_onnx_compatible_models: Whether to enable or disable enforcing the ONNX-compatible models. The default is False. For more information about Open Neural Network Exchange (ONNX) and Azure Machine - Learning,see this `article `__. + Learning,see this `article `__. :paramtype enable_onnx_compatible_models: typing.Optional[bool] :keyword enable_dnn_training: Whether to include DNN based models during model selection. However, the default is True for DNN NLP tasks, and it's False for all other AutoML tasks. @@ -366,7 +366,7 @@ def set_training( :keyword enable_model_explainability: Whether to enable explaining the best AutoML model at the end of all AutoML training iterations. For more information, see `Interpretability: model explanations in automated machine learning - `__. + `__. , defaults to None :paramtype enable_model_explainability: typing.Optional[bool] :keyword enable_stack_ensemble: Whether to enable/disable StackEnsemble iteration. @@ -374,12 +374,12 @@ def set_training( Similarly, for Timeseries tasks, StackEnsemble iteration will be disabled by default, to avoid risks of overfitting due to small training set used in fitting the meta learner. For more information about ensembles, see `Ensemble configuration - `__ + `__ , defaults to None :paramtype enable_stack_ensemble: typing.Optional[bool] :keyword enable_vote_ensemble: Whether to enable/disable VotingEnsemble iteration. For more information about ensembles, see `Ensemble configuration - `__ + `__ , defaults to None :paramtype enable_vote_ensemble: typing.Optional[bool] :keyword stack_ensemble_settings: Settings for StackEnsemble iteration, defaults to None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py index 76f0c0b594ff..9bd10b19875d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py @@ -143,7 +143,7 @@ def set_forecast_settings( Units are based on the time interval of your training data, e.g., monthly, weekly that the forecaster should predict out. When task type is forecasting, this parameter is required. For more information on - setting forecasting parameters, see `Auto-train a time-series forecast model `_. :type forecast_horizon: Optional[Union[int, str]] :keyword time_series_id_column_names: @@ -162,7 +162,7 @@ def set_forecast_settings( month may depend on the price of specific commodities 3 months prior. In this example, you may want to lag the target (demand) negatively by 3 months so that the model is training on the correct relationship. For more information, see `Auto-train a time-series forecast model - `_. + `_. **Note on auto detection of target lags and rolling window size. Please see the corresponding comments in the rolling window section.** @@ -425,7 +425,7 @@ def set_training( :keyword enable_onnx_compatible_models: Whether to enable or disable enforcing the ONNX-compatible models. The default is False. For more information about Open Neural Network Exchange (ONNX) and Azure Machine - Learning, see this `article `__. + Learning, see this `article `__. :type enable_onnx_compatible: Optional[bool] :keyword enable_dnn_training: Whether to include DNN based models during model selection. @@ -434,7 +434,7 @@ def set_training( :keyword enable_model_explainability: Whether to enable explaining the best AutoML model at the end of all AutoML training iterations. For more information, see `Interpretability: model explanations in automated machine learning - `__. + `__. , defaults to None :type enable_model_explainability: Optional[bool] :keyword enable_stack_ensemble: @@ -443,13 +443,13 @@ def set_training( Similarly, for Timeseries tasks, StackEnsemble iteration will be disabled by default, to avoid risks of overfitting due to small training set used in fitting the meta learner. For more information about ensembles, see `Ensemble configuration - `__ + `__ , defaults to None :type enable_stack_ensemble: Optional[bool] :keyword enable_vote_ensemble: Whether to enable/disable VotingEnsemble iteration. For more information about ensembles, see `Ensemble configuration - `__ + `__ , defaults to None :type enable_vote_ensemble: Optional[bool] :keyword stack_ensemble_settings: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_settings.py index 88a6a0028f64..09439483a8a2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_settings.py @@ -44,7 +44,7 @@ class ForecastingSettings(RestTranslatableMixin): Units are based on the time interval of your training data, e.g., monthly, weekly that the forecaster should predict out. When task type is forecasting, this parameter is required. For more information on - setting forecasting parameters, see `Auto-train a time-series forecast model `_. :type forecast_horizon: Optional[Union[int, str]] :param target_lags: @@ -57,7 +57,7 @@ class ForecastingSettings(RestTranslatableMixin): month may depend on the price of specific commodities 3 months prior. In this example, you may want to lag the target (demand) negatively by 3 months so that the model is training on the correct relationship. For more information, see `Auto-train a time-series forecast model - `_. + `_. **Note on auto detection of target lags and rolling window size. Please see the corresponding comments in the rolling window section.** diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py index c85662bd20e5..c487be6edeea 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py @@ -213,7 +213,7 @@ def decorate_validation_error(schema: Any, pretty_error: str, additional_message additional_message += ( "\nThe easiest way to author a specification file is using IntelliSense and auto-completion Azure ML VS " "code extension provides: https://code.visualstudio.com/docs/datascience/azure-machine-learning. " - "To set up: https://docs.microsoft.com/azure/machine-learning/how-to-setup-vs-code" + "To set up: https://learn.microsoft.com/azure/machine-learning/how-to-setup-vs-code" ) return f"Validation for {schema.__name__} failed:\n\n {pretty_error} \n\n {additional_message}" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py index 9a1eae7fb636..495e00b0fcc0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py @@ -56,7 +56,7 @@ class Workspace(Resource): :param hbi_workspace: Whether the customer data is of high business impact (HBI), containing sensitive business information. For more information, see - https://docs.microsoft.com/azure/machine-learning/concept-data-encryption#encryption-at-rest. + https://learn.microsoft.com/azure/machine-learning/concept-data-encryption#encryption-at-rest. :type hbi_workspace: bool :param storage_account: The resource ID of an existing storage account to use instead of creating a new one. :type storage_account: str diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/identity/_aio/_credentials/aml_on_behalf_of.py b/sdk/ml/azure-ai-ml/azure/ai/ml/identity/_aio/_credentials/aml_on_behalf_of.py index f9af37f9d446..386993d67828 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/identity/_aio/_credentials/aml_on_behalf_of.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/identity/_aio/_credentials/aml_on_behalf_of.py @@ -19,7 +19,7 @@ class AzureMLOnBehalfOfCredential(AsyncContextManager): """Authenticates a user via the on-behalf-of flow. This credential can only be used on `Azure Machine Learning Compute. - `_ during job execution when user request to + `_ during job execution when user request to run job during its identity. """ # pylint: enable=line-too-long diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/identity/_credentials/aml_on_behalf_of.py b/sdk/ml/azure-ai-ml/azure/ai/ml/identity/_credentials/aml_on_behalf_of.py index 4afed59572c9..ba9385129b43 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/identity/_credentials/aml_on_behalf_of.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/identity/_credentials/aml_on_behalf_of.py @@ -19,8 +19,8 @@ class AzureMLOnBehalfOfCredential(object): """Authenticates a user via the on-behalf-of flow. This credential can only be used on `Azure Machine Learning Compute - `_ or `Azure Machine Learning Serverless Spark Compute - `_ + `_ or `Azure Machine Learning Serverless Spark Compute + `_ during job execution when user request to run job using its identity. """ # pylint: enable=line-too-long diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py index 89c4f980f2f8..13fe2357728e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py @@ -150,7 +150,7 @@ def begin_create_or_update( module_logger.warning( "Instance type %s may be too small for compute resources. " "Minimum recommended compute SKU is Standard_DS3_v2 for general purpose endpoints. Learn more about SKUs here: " # pylint: disable=line-too-long - "https://learn.microsoft.com/en-us/azure/machine-learning/referencemanaged-online-endpoints-vm-sku-list", + "https://learn.microsoft.com/azure/machine-learning/referencemanaged-online-endpoints-vm-sku-list", deployment.instance_type, ) if ( diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2020-09-01-dataplanepreview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2020-09-01-dataplanepreview/machineLearningServices.json index ce408bfa872a..a9ca648a63fd 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2020-09-01-dataplanepreview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2020-09-01-dataplanepreview/machineLearningServices.json @@ -680,7 +680,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -1615,7 +1615,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning services and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning services and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedServiceList" } @@ -1912,7 +1912,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Workspace connections and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Workspace connections and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedWorkspaceConnectionsList" } diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2021-10-01-dataplanepreview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2021-10-01-dataplanepreview/machineLearningServices.json index ce408bfa872a..a9ca648a63fd 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2021-10-01-dataplanepreview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2021-10-01-dataplanepreview/machineLearningServices.json @@ -680,7 +680,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -1615,7 +1615,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning services and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning services and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedServiceList" } @@ -1912,7 +1912,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Workspace connections and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Workspace connections and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedWorkspaceConnectionsList" } diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2021-10-01-dataplanepreview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2021-10-01-dataplanepreview/mfe.json index 509b76dc853a..8401619b18d4 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2021-10-01-dataplanepreview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2021-10-01-dataplanepreview/mfe.json @@ -4057,7 +4057,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -4177,7 +4177,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -4730,7 +4730,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -4738,7 +4738,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-01-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-01-01-preview/machineLearningServices.json index ecfcd6096c8f..026e952d29ec 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-01-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-01-01-preview/machineLearningServices.json @@ -719,7 +719,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-02-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-02-01-preview/machineLearningServices.json index d2a90eaf2c30..04c09f98ed2c 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-02-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-02-01-preview/machineLearningServices.json @@ -719,7 +719,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -4780,11 +4780,11 @@ "properties": { "objectId": { "type": "string", - "description": "User�s AAD Object Id." + "description": "User�s AAD Object Id." }, "tenantId": { "type": "string", - "description": "User�s AAD Tenant Id." + "description": "User�s AAD Tenant Id." } }, "required": [ diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-02-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-02-01-preview/mfe.json index cefa0a4dab1a..32adb3f2efeb 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-02-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-02-01-preview/mfe.json @@ -6772,7 +6772,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -6830,7 +6830,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -8009,7 +8009,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -8017,7 +8017,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -8714,7 +8714,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -8784,7 +8784,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -8802,7 +8802,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -8895,7 +8895,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -8931,7 +8931,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -9021,7 +9021,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -9115,7 +9115,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -9131,7 +9131,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -9221,7 +9221,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -9257,7 +9257,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-10-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-10-01-preview/machineLearningServices.json index 86f0afe434f1..fbcd78a7ee7e 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-10-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-10-01-preview/machineLearningServices.json @@ -736,7 +736,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -5433,7 +5433,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -5453,7 +5453,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-10-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-10-01-preview/mfe.json index e6bd556dfcac..89ea2fb5e56d 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-10-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-10-01-preview/mfe.json @@ -10295,7 +10295,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -10363,7 +10363,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -11625,7 +11625,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -11633,7 +11633,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -12462,7 +12462,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -12532,7 +12532,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -12550,7 +12550,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -12637,7 +12637,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -12673,7 +12673,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -12763,7 +12763,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -12852,7 +12852,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -12868,7 +12868,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -12952,7 +12952,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -12988,7 +12988,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -18484,7 +18484,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/machineLearningServices.json index 70cba01fd3a4..057dbcad4198 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/machineLearningServices.json @@ -736,7 +736,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/mfe.json index 32ad23635952..fb2ce5912bcb 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/mfe.json @@ -10326,7 +10326,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -10394,7 +10394,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -11673,7 +11673,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -11681,7 +11681,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -12510,7 +12510,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -12580,7 +12580,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -12598,7 +12598,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -12685,7 +12685,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -12721,7 +12721,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -12811,7 +12811,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -12900,7 +12900,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -12916,7 +12916,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -13000,7 +13000,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -13036,7 +13036,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -18618,7 +18618,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-02-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-02-01-preview/machineLearningServices.json index 58bfa1399110..fd632d87a884 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-02-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-02-01-preview/machineLearningServices.json @@ -736,7 +736,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-02-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-02-01-preview/mfe.json index bed9e3d885f7..90eb61348487 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-02-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-02-01-preview/mfe.json @@ -12855,7 +12855,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -12923,7 +12923,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -14245,7 +14245,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -14253,7 +14253,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -15636,7 +15636,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -15706,7 +15706,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -15724,7 +15724,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -15811,7 +15811,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -15847,7 +15847,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -15937,7 +15937,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -16026,7 +16026,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -16042,7 +16042,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -16126,7 +16126,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -16162,7 +16162,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -22393,7 +22393,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-04-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-04-01-preview/machineLearningServices.json index 907a5cbb04d9..4b25c622001e 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-04-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-04-01-preview/machineLearningServices.json @@ -745,7 +745,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -5825,7 +5825,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -5845,7 +5845,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-04-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-04-01-preview/mfe.json index f187354b53bc..0e03ac5f511d 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-04-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-04-01-preview/mfe.json @@ -13602,7 +13602,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -13670,7 +13670,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -15473,7 +15473,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -15481,7 +15481,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -17017,7 +17017,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -17087,7 +17087,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -17105,7 +17105,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -17192,7 +17192,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17228,7 +17228,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17318,7 +17318,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -17407,7 +17407,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -17423,7 +17423,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -17507,7 +17507,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17543,7 +17543,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -25214,7 +25214,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/machineLearningServices.json index 359ef637c72f..ac1f3aa19ebc 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/machineLearningServices.json @@ -260,7 +260,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -3331,7 +3331,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -3351,7 +3351,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/mfe.json index 1b34f5856dea..b61072349b12 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/mfe.json @@ -13714,7 +13714,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -13782,7 +13782,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -15633,7 +15633,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -15641,7 +15641,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -17420,7 +17420,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -17490,7 +17490,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -17508,7 +17508,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -17595,7 +17595,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17631,7 +17631,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17721,7 +17721,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -17810,7 +17810,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -17826,7 +17826,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -17910,7 +17910,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17946,7 +17946,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -25934,7 +25934,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/machineLearningServices.json index 3d216a8476cb..b145130b96e4 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/machineLearningServices.json @@ -260,7 +260,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -3555,7 +3555,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -3704,7 +3704,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/mfe.json index 55740e8b1570..a43d2248423b 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/mfe.json @@ -16102,7 +16102,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -16170,7 +16170,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -18046,7 +18046,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -18054,7 +18054,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -19864,7 +19864,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -19934,7 +19934,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -19952,7 +19952,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -20039,7 +20039,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -20075,7 +20075,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -20165,7 +20165,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -20254,7 +20254,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -20270,7 +20270,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -20354,7 +20354,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -20390,7 +20390,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -29097,7 +29097,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-01-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-01-01-preview/machineLearningServices.json index afa3853f7f6c..5398f66623fa 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-01-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-01-01-preview/machineLearningServices.json @@ -260,7 +260,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -3608,7 +3608,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -3757,7 +3757,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-01-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-01-01-preview/mfe.json index 237468057e3d..baad35390f2e 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-01-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-01-01-preview/mfe.json @@ -17010,7 +17010,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -17078,7 +17078,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -19066,7 +19066,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -19074,7 +19074,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -21068,7 +21068,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -21138,7 +21138,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -21156,7 +21156,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -21243,7 +21243,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -21279,7 +21279,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -21369,7 +21369,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -21458,7 +21458,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -21474,7 +21474,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -21558,7 +21558,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -21594,7 +21594,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -30691,7 +30691,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-preview/machineLearningServices.json index 456323283df3..cc002c8b0fe9 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-preview/machineLearningServices.json @@ -260,7 +260,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -3619,7 +3619,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -3768,7 +3768,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-preview/mfe.json index 73584342ffb6..efb888111741 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-preview/mfe.json @@ -17010,7 +17010,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -17078,7 +17078,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -19066,7 +19066,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -19074,7 +19074,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -21068,7 +21068,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -21138,7 +21138,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -21156,7 +21156,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -21243,7 +21243,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -21279,7 +21279,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -21369,7 +21369,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -21458,7 +21458,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -21474,7 +21474,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -21558,7 +21558,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -21594,7 +21594,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -30691,7 +30691,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/machineLearningServices.json index f7bfe4541028..df6780e17a97 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/machineLearningServices.json @@ -260,7 +260,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -3619,7 +3619,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -3768,7 +3768,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/mfe.json index 2ddf62964ce8..f563b40b753c 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/mfe.json @@ -13905,7 +13905,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -13973,7 +13973,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -15728,7 +15728,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -15736,7 +15736,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -17144,7 +17144,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -17214,7 +17214,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -17232,7 +17232,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -17319,7 +17319,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17355,7 +17355,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17445,7 +17445,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -17534,7 +17534,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -17550,7 +17550,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -17634,7 +17634,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17670,7 +17670,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -23807,7 +23807,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/machineLearningServices.json index c19ee4515256..19f84adc2dcc 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/machineLearningServices.json @@ -260,7 +260,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -3619,7 +3619,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -3768,7 +3768,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/mfe.json index d8906051a3b7..a7d93889a98b 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/mfe.json @@ -15918,7 +15918,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -15986,7 +15986,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -17900,7 +17900,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -17908,7 +17908,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -19536,7 +19536,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -19606,7 +19606,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -19624,7 +19624,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -19711,7 +19711,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -19747,7 +19747,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -19837,7 +19837,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -19926,7 +19926,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -19942,7 +19942,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -20026,7 +20026,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -20062,7 +20062,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -26636,7 +26636,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/runhistory/run-history.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/runhistory/run-history.json index cd27d542a0a9..d88b532c41e7 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/runhistory/run-history.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/runhistory/run-history.json @@ -5796,7 +5796,7 @@ }, "filter": { "type": "string", - "description": "Allows for filtering the collection of resources.\r\nThe expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response.\r\nSee https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax.", + "description": "Allows for filtering the collection of resources.\r\nThe expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response.\r\nSee https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax.", "nullable": true }, "continuationToken": { @@ -6563,7 +6563,7 @@ "properties": { "filter": { "type": "string", - "description": "Allows for filtering the collection of resources.\r\nThe expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response.\r\nSee https://docs.microsoft.com/en-us/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax.", + "description": "Allows for filtering the collection of resources.\r\nThe expression specified is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response.\r\nSee https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax for details on the expression syntax.", "nullable": true }, "continuationToken": { diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/machineLearningServices.json index f5ae53d16418..29691978b5ba 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/machineLearningServices.json @@ -736,7 +736,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -5337,11 +5337,11 @@ "properties": { "objectId": { "type": "string", - "description": "User�s AAD Object Id." + "description": "User�s AAD Object Id." }, "tenantId": { "type": "string", - "description": "User�s AAD Tenant Id." + "description": "User�s AAD Tenant Id." } }, "required": [ diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/mfe.json index 14d9eaeeb21a..9611e76c1052 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/mfe.json @@ -6413,7 +6413,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -6471,7 +6471,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -7466,7 +7466,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -7474,7 +7474,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-04-01/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-04-01/machineLearningServices.json index 41f26c87e1c4..cae976f254b0 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-04-01/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-04-01/machineLearningServices.json @@ -736,7 +736,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -5275,7 +5275,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -5295,7 +5295,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-04-01/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-04-01/mfe.json index 32a6800b9e5d..2374c317c6d2 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-04-01/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-04-01/mfe.json @@ -10640,7 +10640,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -10708,7 +10708,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -11918,7 +11918,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -11926,7 +11926,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -12612,7 +12612,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -12682,7 +12682,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -12700,7 +12700,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -12787,7 +12787,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -12823,7 +12823,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -12913,7 +12913,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -13002,7 +13002,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -13018,7 +13018,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -13102,7 +13102,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -13138,7 +13138,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -17221,7 +17221,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-10-01/machineLearningServices.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-10-01/machineLearningServices.json index 46c379531f63..8f1a35767f1e 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-10-01/machineLearningServices.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-10-01/machineLearningServices.json @@ -778,7 +778,7 @@ ], "responses": { "200": { - "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/.", + "description": "The response includes a paginated array of Machine Learning computes and a URI to the next set of results, if any. For the more information the limits of the number of items in a resource group, see https://azure.microsoft.com/documentation/articles/azure-subscription-service-limits/.", "schema": { "$ref": "#/definitions/PaginatedComputeResourcesList" } @@ -5637,7 +5637,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, @@ -5786,7 +5786,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "type": "string", "default": "UTC" }, diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-10-01/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-10-01/mfe.json index 618d167b57b0..4eacc012d563 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-10-01/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2023-10-01/mfe.json @@ -13043,7 +13043,7 @@ "additionalProperties": false }, "ComponentContainer": { - "description": "Component container definition.\r\n", + "description": "Component container definition.\r\n", "type": "object", "allOf": [ { @@ -13111,7 +13111,7 @@ ], "properties": { "componentSpec": { - "description": "Defines Component definition details.\r\n", + "description": "Defines Component definition details.\r\n", "type": "object", "example": { "name": "Hello_Python_World", @@ -14781,7 +14781,7 @@ ] }, "environmentType": { - "description": "Environment type is either user managed or curated by the Azure ML service\r\n", + "description": "Environment type is either user managed or curated by the Azure ML service\r\n", "$ref": "#/definitions/EnvironmentType", "readOnly": true, "x-ms-mutability": [ @@ -14789,7 +14789,7 @@ ] }, "image": { - "description": "Name of the image that will be used for the environment.\r\n", + "description": "Name of the image that will be used for the environment.\r\n", "type": "string", "example": "docker.io/tensorflow/serving:latest", "x-ms-mutability": [ @@ -16197,7 +16197,7 @@ "additionalProperties": false }, "ImageModelDistributionSettings": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nAll distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn)\r\nwhere distribution name can be: uniform, quniform, loguniform, etc\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "amsGradient": { @@ -16267,7 +16267,7 @@ "x-nullable": true }, "layersToFreeze": { - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice(1, 2)", "x-nullable": true @@ -16285,7 +16285,7 @@ "x-nullable": true }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "example": "choice('seresnext', 'resnest50')", "x-nullable": true @@ -16372,7 +16372,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsClassification": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -16408,7 +16408,7 @@ "additionalProperties": false }, "ImageModelDistributionSettingsObjectDetection": { - "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Distribution expressions to sweep over values of model settings.\r\n\r\nSome examples are:\r\n```\r\nModelName = \"choice('seresnext', 'resnest50')\";\r\nLearningRate = \"uniform(0.001, 0.01)\";\r\nLayersToFreeze = \"choice(0, 2)\";\r\n```\r\nFor more details on how to compose distribution expressions please check the documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -16498,7 +16498,7 @@ "additionalProperties": false }, "ImageModelSettings": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "properties": { "advancedSettings": { @@ -16587,7 +16587,7 @@ }, "layersToFreeze": { "format": "int32", - "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Number of layers to freeze for the model. Must be a positive integer.\r\nFor instance, passing 2 as value for 'seresnext' means\r\nfreezing layer0 and layer1. For a full list of models supported and details on layer freeze, please\r\nsee: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "integer", "x-nullable": true }, @@ -16603,7 +16603,7 @@ "$ref": "#/definitions/LearningRateScheduler" }, "modelName": { - "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Name of the model to use for training.\r\nFor more information on the available models please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "string", "x-nullable": true }, @@ -16687,7 +16687,7 @@ "additionalProperties": false }, "ImageModelSettingsClassification": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -16723,7 +16723,7 @@ "additionalProperties": false }, "ImageModelSettingsObjectDetection": { - "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.", + "description": "Settings used for training the model.\r\nFor more information on the available settings please visit the official documentation:\r\nhttps://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models.", "type": "object", "allOf": [ { @@ -21957,7 +21957,7 @@ "x-nullable": true }, "timeZone": { - "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", + "description": "Specifies time zone in which the schedule runs.\r\nTimeZone should follow Windows time zone format. Refer: https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11", "default": "UTC", "type": "string" }, diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/flows/web_classification_with_additional_includes/flow.dag.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/flows/web_classification_with_additional_includes/flow.dag.yaml index b61c122c5457..7863bb452226 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/flows/web_classification_with_additional_includes/flow.dag.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/flows/web_classification_with_additional_includes/flow.dag.yaml @@ -2,7 +2,7 @@ $schema: https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.json inputs: url: type: string - default: https://www.microsoft.com/en-us/d/xbox-wireless-controller-stellar-shift-special-edition/94fbjc7h0h6h + default: https://www.microsoft.com/d/xbox-wireless-controller-stellar-shift-special-edition/94fbjc7h0h6h outputs: category: type: string diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/pipeline_jobs/serverless_compute/all_types/automl/components/src/register.py b/sdk/ml/azure-ai-ml/tests/test_configs/pipeline_jobs/serverless_compute/all_types/automl/components/src/register.py index ea46ddacd2fa..ce1a68c65905 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/pipeline_jobs/serverless_compute/all_types/automl/components/src/register.py +++ b/sdk/ml/azure-ai-ml/tests/test_configs/pipeline_jobs/serverless_compute/all_types/automl/components/src/register.py @@ -14,7 +14,7 @@ import mlflow.sklearn # Based on example: -# https://docs.microsoft.com/en-us/azure/machine-learning/how-to-train-cli +# https://learn.microsoft.com/azure/machine-learning/how-to-train-cli # which references # https://github.com/Azure/azureml-examples/tree/main/cli/jobs/train/lightgbm/iris diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/pipeline_jobs/serverless_compute/job_tier/automl_in_pipeline/components/src/register.py b/sdk/ml/azure-ai-ml/tests/test_configs/pipeline_jobs/serverless_compute/job_tier/automl_in_pipeline/components/src/register.py index ea46ddacd2fa..ce1a68c65905 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/pipeline_jobs/serverless_compute/job_tier/automl_in_pipeline/components/src/register.py +++ b/sdk/ml/azure-ai-ml/tests/test_configs/pipeline_jobs/serverless_compute/job_tier/automl_in_pipeline/components/src/register.py @@ -14,7 +14,7 @@ import mlflow.sklearn # Based on example: -# https://docs.microsoft.com/en-us/azure/machine-learning/how-to-train-cli +# https://learn.microsoft.com/azure/machine-learning/how-to-train-cli # which references # https://github.com/Azure/azureml-examples/tree/main/cli/jobs/train/lightgbm/iris From 03d10c06e25fa669d7ab6d113bbc9719347e6987 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 22 Jan 2025 10:33:32 -0800 Subject: [PATCH 17/29] Fix urls (#39262) --- sdk/purview/azure-purview-administration/README.md | 6 +++--- sdk/purview/azure-purview-catalog/README.md | 6 +++--- sdk/purview/azure-purview-datamap/README.md | 2 +- .../azure/purview/datamap/aio/operations/_operations.py | 6 +++--- .../azure/purview/datamap/operations/_operations.py | 6 +++--- sdk/purview/azure-purview-datamap/samples/README.md | 2 +- sdk/purview/azure-purview-scanning/README.md | 6 +++--- sdk/purview/azure-purview-sharing/README.md | 2 +- sdk/purview/azure-purview-workflow/README.md | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sdk/purview/azure-purview-administration/README.md b/sdk/purview/azure-purview-administration/README.md index 3d7d7ba02c3d..2d3f4a18e481 100644 --- a/sdk/purview/azure-purview-administration/README.md +++ b/sdk/purview/azure-purview-administration/README.md @@ -163,13 +163,13 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [account_ref_docs]: https://azure.github.io/azure-sdk-for-python/ [account_product_documentation]: https://azure.microsoft.com/services/purview/ [azure_subscription]: https://azure.microsoft.com/free/ -[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal +[purview_resource]: https://learn.microsoft.com/azure/purview/create-catalog-portal [pip]: https://pypi.org/project/pip/ -[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[authenticate_with_token]: https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[enable_aad]: https://docs.microsoft.com/azure/purview/create-catalog-portal#add-a-security-principal-to-a-data-plane-role +[enable_aad]: https://learn.microsoft.com/azure/purview/create-catalog-portal#add-a-security-principal-to-a-data-plane-role [python_logging]: https://docs.python.org/3.5/library/logging.html [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/purview/azure-purview-catalog/README.md b/sdk/purview/azure-purview-catalog/README.md index d0208647b3cc..80c976e88935 100644 --- a/sdk/purview/azure-purview-catalog/README.md +++ b/sdk/purview/azure-purview-catalog/README.md @@ -155,14 +155,14 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [catalog_ref_docs]: https://aka.ms/azsdk/python/purviewcatalog/ref-docs [catalog_product_documentation]: https://azure.microsoft.com/services/purview/ [azure_subscription]: https://azure.microsoft.com/free/ -[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal +[purview_resource]: https://learn.microsoft.com/azure/purview/create-catalog-portal [pip]: https://pypi.org/project/pip/ -[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[authenticate_with_token]: https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [request_builders_and_client]: https://aka.ms/azsdk/python/protocol/quickstart -[enable_aad]: https://docs.microsoft.com/azure/purview/create-catalog-portal#add-a-security-principal-to-a-data-plane-role +[enable_aad]: https://learn.microsoft.com/azure/purview/create-catalog-portal#add-a-security-principal-to-a-data-plane-role [azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md [python_logging]: https://docs.python.org/3.5/library/logging.html [cla]: https://cla.microsoft.com diff --git a/sdk/purview/azure-purview-datamap/README.md b/sdk/purview/azure-purview-datamap/README.md index 6d9e8a389c46..c114718751e3 100644 --- a/sdk/purview/azure-purview-datamap/README.md +++ b/sdk/purview/azure-purview-datamap/README.md @@ -82,7 +82,7 @@ additional questions or comments. [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[authenticate_with_token]: https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_operations.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_operations.py index 3d3e3db3b6ae..7887ea980ba9 100644 --- a/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_operations.py +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_operations.py @@ -21145,7 +21145,7 @@ async def assign_term_to_entities( # pylint: disable=inconsistent-return-statem `Entities Create Or Update operation - `_ + `_ is an alternative to assign a term to multiple entities. :param term_id: The globally unique identifier for glossary term. Required. @@ -21199,7 +21199,7 @@ async def assign_term_to_entities( # pylint: disable=inconsistent-return-statem `Entities Create Or Update operation - `_ + `_ is an alternative to assign a term to multiple entities. :param term_id: The globally unique identifier for glossary term. Required. @@ -21223,7 +21223,7 @@ async def assign_term_to_entities( # pylint: disable=inconsistent-return-statem `Entities Create Or Update operation - `_ + `_ is an alternative to assign a term to multiple entities. :param term_id: The globally unique identifier for glossary term. Required. diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_operations.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_operations.py index 2dbd9c71546a..6cd5b503efbc 100644 --- a/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_operations.py +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_operations.py @@ -23312,7 +23312,7 @@ def assign_term_to_entities( # pylint: disable=inconsistent-return-statements `Entities Create Or Update operation - `_ + `_ is an alternative to assign a term to multiple entities. :param term_id: The globally unique identifier for glossary term. Required. @@ -23366,7 +23366,7 @@ def assign_term_to_entities( # pylint: disable=inconsistent-return-statements `Entities Create Or Update operation - `_ + `_ is an alternative to assign a term to multiple entities. :param term_id: The globally unique identifier for glossary term. Required. @@ -23390,7 +23390,7 @@ def assign_term_to_entities( # pylint: disable=inconsistent-return-statements `Entities Create Or Update operation - `_ + `_ is an alternative to assign a term to multiple entities. :param term_id: The globally unique identifier for glossary term. Required. diff --git a/sdk/purview/azure-purview-datamap/samples/README.md b/sdk/purview/azure-purview-datamap/samples/README.md index bc16107dc987..54679e550c0c 100644 --- a/sdk/purview/azure-purview-datamap/samples/README.md +++ b/sdk/purview/azure-purview-datamap/samples/README.md @@ -39,4 +39,4 @@ pip install azure-purview-datamap [product_documentation]: https://azure.microsoft.com/services/purview/ [azure_subscription]: https://azure.microsoft.com/free/ -[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal \ No newline at end of file +[purview_resource]: https://learn.microsoft.com/azure/purview/create-catalog-portal \ No newline at end of file diff --git a/sdk/purview/azure-purview-scanning/README.md b/sdk/purview/azure-purview-scanning/README.md index 447880b25769..4970f8cd743d 100644 --- a/sdk/purview/azure-purview-scanning/README.md +++ b/sdk/purview/azure-purview-scanning/README.md @@ -152,14 +152,14 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [scanning_ref_docs]: https://aka.ms/azsdk/python/purviewscanning/ref-docs [scanning_product_documentation]: https://azure.microsoft.com/services/purview/ [azure_subscription]: https://azure.microsoft.com/free/ -[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal +[purview_resource]: https://learn.microsoft.com/azure/purview/create-catalog-portal [pip]: https://pypi.org/project/pip/ -[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[authenticate_with_token]: https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [request_builders_and_client]: https://aka.ms/azsdk/python/protocol/quickstart -[enable_aad]: https://docs.microsoft.com/azure/purview/create-catalog-portal#add-a-security-principal-to-a-data-plane-role +[enable_aad]: https://learn.microsoft.com/azure/purview/create-catalog-portal#add-a-security-principal-to-a-data-plane-role [azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md [python_logging]: https://docs.python.org/3.5/library/logging.html [cla]: https://cla.microsoft.com diff --git a/sdk/purview/azure-purview-sharing/README.md b/sdk/purview/azure-purview-sharing/README.md index b6502be2270a..ea5de6d84a9c 100644 --- a/sdk/purview/azure-purview-sharing/README.md +++ b/sdk/purview/azure-purview-sharing/README.md @@ -575,7 +575,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_subscription]: https://azure.microsoft.com/free/ [purview_resource]: https://learn.microsoft.com/purview/ [pip]: https://pypi.org/project/pip/ -[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[authenticate_with_token]: https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-identity/latest/azure.identity.html#azure.identity.DefaultAzureCredential diff --git a/sdk/purview/azure-purview-workflow/README.md b/sdk/purview/azure-purview-workflow/README.md index 2b547a155b0b..f6858e62bed3 100644 --- a/sdk/purview/azure-purview-workflow/README.md +++ b/sdk/purview/azure-purview-workflow/README.md @@ -90,7 +90,7 @@ additional questions or comments. [product_documentation]: https://learn.microsoft.com/azure/purview/concept-workflow -[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal +[purview_resource]: https://learn.microsoft.com/azure/purview/create-catalog-portal [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [username_password_credential]: https://learn.microsoft.com/python/api/azure-identity/azure.identity.usernamepasswordcredential?view=azure-python [azure_sub]: https://azure.microsoft.com/free/ From 6547d9281d8a804ae8cda661c02b16c31005de25 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:36:31 -0800 Subject: [PATCH 18/29] Sync eng/common directory with azure-sdk-tools for PR 9668 (#39347) * Support incrementing semver prereleases with 'zero' versions * Make tests more explicit --------- Co-authored-by: Patrick Hallisey --- eng/common/scripts/SemVer.ps1 | 107 ++++++++++++++++++++++++++++------ 1 file changed, 88 insertions(+), 19 deletions(-) diff --git a/eng/common/scripts/SemVer.ps1 b/eng/common/scripts/SemVer.ps1 index 6459f252a67c..689a70e778c4 100644 --- a/eng/common/scripts/SemVer.ps1 +++ b/eng/common/scripts/SemVer.ps1 @@ -78,13 +78,10 @@ class AzureEngSemanticVersion : IComparable { if ($null -eq $matches['prelabel']) { - # artifically provide these values for non-prereleases to enable easy sorting of them later than prereleases. - $this.PrereleaseLabel = "zzz" - $this.PrereleaseNumber = 99999999 $this.IsPrerelease = $false $this.VersionType = "GA" if ($this.Major -eq 0) { - # Treat initial 0 versions as a prerelease beta's + # Treat initial 0 versions as a prerelease beta's $this.VersionType = "Beta" $this.IsPrerelease = $true } @@ -116,7 +113,7 @@ class AzureEngSemanticVersion : IComparable { # See https://azure.github.io/azure-sdk/policies_releases.html#package-versioning [bool] HasValidPrereleaseLabel() { - if ($this.IsPrerelease -eq $true) { + if ($this.PrereleaseLabel) { if ($this.PrereleaseLabel -ne $this.DefaultPrereleaseLabel -and $this.PrereleaseLabel -ne $this.DefaultAlphaReleaseLabel) { Write-Host "Unexpected pre-release identifier '$($this.PrereleaseLabel)', "` "should be '$($this.DefaultPrereleaseLabel)' or '$($this.DefaultAlphaReleaseLabel)'" @@ -136,7 +133,7 @@ class AzureEngSemanticVersion : IComparable { { $versionString = "{0}.{1}.{2}" -F $this.Major, $this.Minor, $this.Patch - if ($this.IsPrerelease -and $this.PrereleaseLabel -ne "zzz") + if ($this.PrereleaseLabel) { $versionString += $this.PrereleaseLabelSeparator + $this.PrereleaseLabel + ` $this.PrereleaseNumberSeparator + $this.PrereleaseNumber @@ -147,24 +144,42 @@ class AzureEngSemanticVersion : IComparable { return $versionString; } - [void] IncrementAndSetToPrerelease() { - if ($this.IsPrerelease -eq $false) + [void] IncrementAndSetToPrerelease($Segment) { + if ($this.BuildNumber) { - $this.PrereleaseLabel = $this.DefaultPrereleaseLabel - $this.PrereleaseNumber = 1 - $this.Minor++ - $this.Patch = 0 - $this.IsPrerelease = $true + throw "Cannot increment releases tagged with azure pipelines build numbers" + } + + if ($this.PrereleaseLabel) + { + $this.PrereleaseNumber++ } else { - if ($this.BuildNumber) { - throw "Cannot increment releases tagged with azure pipelines build numbers" + $this.$Segment++ + if($Segment -eq "Major") { + $this.Minor = 0 + $this.Patch = 0 } - $this.PrereleaseNumber++ + if($Segment -eq "Minor") { + $this.Patch = 0 + } + + # If the major version is 0, we don't need a prerelease label + if ($this.Major -ne 0) + { + $this.PrereleaseLabel = $this.DefaultPrereleaseLabel + $this.PrereleaseNumber = 1 + } + + $this.IsPrerelease = $true } } + [void] IncrementAndSetToPrerelease() { + $this.IncrementAndSetToPrerelease("Minor") + } + [void] SetupPythonConventions() { # Python uses no separators and "b" for beta so this sets up the the object to work with those conventions @@ -198,11 +213,30 @@ class AzureEngSemanticVersion : IComparable { $ret = $this.Patch.CompareTo($other.Patch) if ($ret) { return $ret } + # provide artificial prerelease values for non-prereleases to sort them later than prereleases. + if ($this.PrereleaseLabel) { + $thisPrereleaseLabel = $this.PrereleaseLabel + $thisPrereleaseNumber = $this.PrereleaseNumber + } + else { + $thisPrereleaseLabel = "zzz" + $thisPrereleaseNumber = 99999999 + } + + if ($other.PrereleaseLabel) { + $otherPrereleaseLabel = $other.PrereleaseLabel + $otherPrereleaseNumber = $other.PrereleaseNumber + } + else { + $otherPrereleaseLabel = "zzz" + $otherPrereleaseNumber = 99999999 + } + # Mimic PowerShell that uses case-insensitive comparisons by default. - $ret = [string]::Compare($this.PrereleaseLabel, $other.PrereleaseLabel, $true) + $ret = [string]::Compare($thisPrereleaseLabel, $otherPrereleaseLabel, $true) if ($ret) { return $ret } - $ret = $this.PrereleaseNumber.CompareTo($other.PrereleaseNumber) + $ret = $thisPrereleaseNumber.CompareTo($otherPrereleaseNumber) if ($ret) { return $ret } return ([int] $this.BuildNumber).CompareTo([int] $other.BuildNumber) @@ -360,6 +394,41 @@ class AzureEngSemanticVersion : IComparable { Write-Host "Error: Python beta string did not correctly increment" } + $version = [AzureEngSemanticVersion]::ParseVersionString("0.1.2") + $version.IncrementAndSetToPrerelease() + $expected = "0.2.0" + if ($expected -ne $version.ToString()) { + Write-Host "Error: version string did not correctly increment. Expected: $expected, Actual: $version" + } + + $version = [AzureEngSemanticVersion]::ParseVersionString("0.1.2") + $version.IncrementAndSetToPrerelease("patch") + $expected = "0.1.3" + if ($expected -ne $version.ToString()) { + Write-Host "Error: version string did not correctly increment. Expected: $expected, Actual: $version" + } + + $version = [AzureEngSemanticVersion]::ParseVersionString("0.1.2") + $version.IncrementAndSetToPrerelease("minor") + $expected = "0.2.0" + if ($expected -ne $version.ToString()) { + Write-Host "Error: version string did not correctly increment. Expected: $expected, Actual: $version" + } + + $version = [AzureEngSemanticVersion]::ParseVersionString("0.1.2") + $version.IncrementAndSetToPrerelease("major") + $expected = "1.0.0-beta.1" + if ($expected -ne $version.ToString()) { + Write-Host "Error: version string did not correctly increment. Expected: $expected, Actual: $version" + } + + $version = [AzureEngSemanticVersion]::ParseVersionString("1.0.0-beta.1") + $version.IncrementAndSetToPrerelease() + $expected = "1.0.0-beta.2" + if ($expected -ne $version.ToString()) { + Write-Host "Error: version string did not correctly increment. Expected: $expected, Actual: $version" + } + Write-Host "QuickTests done" } -} +} \ No newline at end of file From 11efc59dae44e68668322982b5f7536a5c1f1484 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Wed, 22 Jan 2025 11:55:50 -0800 Subject: [PATCH 19/29] [ServiceBus/EventHub] lock pending deliveries on send (#38067) * [ServiceBus/EventHub] lock pending deliveries on send * remove misc logging * changelog + test * fix tests, remove session lock * remove logging from test * sync with sb * add todo in sender.py tfor temporary fix --- .../azure/eventhub/_pyamqp/sender.py | 33 +++++---- sdk/servicebus/azure-servicebus/CHANGELOG.md | 2 + .../azure/servicebus/_pyamqp/sender.py | 33 +++++---- .../azure-servicebus/tests/test_topic.py | 69 ++++++++++++++++--- 4 files changed, 99 insertions(+), 38 deletions(-) diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/sender.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/sender.py index 9cba87f2bc71..ea6f202bfd0f 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/sender.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/sender.py @@ -7,6 +7,7 @@ import uuid import logging import time +from threading import Lock from ._encode import encode_payload from .link import Link @@ -45,6 +46,7 @@ def __init__(self, session, handle, target_address, **kwargs): kwargs["source_address"] = "sender-link-{}".format(name) super(SenderLink, self).__init__(session, handle, name, role, target_address=target_address, **kwargs) self._pending_deliveries = [] + self.lock = Lock() @classmethod def from_incoming_frame(cls, session, handle, frame): @@ -139,21 +141,24 @@ def _on_session_state_change(self): super()._on_session_state_change() def update_pending_deliveries(self): - if self.current_link_credit <= 0: - self.current_link_credit = self.link_credit - self._outgoing_flow() - now = time.time() - pending = [] - for delivery in self._pending_deliveries: - if delivery.timeout and (now - delivery.start) >= delivery.timeout: - delivery.on_settled(LinkDeliverySettleReason.TIMEOUT, None) - continue - if not delivery.sent: - sent_and_settled = self._outgoing_transfer(delivery) - if sent_and_settled: + # TODO: Temporary fix until connection.listen removed from keep alive thread. + with self.lock: + if self.current_link_credit <= 0: + self.current_link_credit = self.link_credit + self._outgoing_flow() + now = time.time() + pending = [] + + for delivery in self._pending_deliveries: + if delivery.timeout and (now - delivery.start) >= delivery.timeout: + delivery.on_settled(LinkDeliverySettleReason.TIMEOUT, None) continue - pending.append(delivery) - self._pending_deliveries = pending + if not delivery.sent: + sent_and_settled = self._outgoing_transfer(delivery) + if sent_and_settled: + continue + pending.append(delivery) + self._pending_deliveries = pending def send_transfer(self, message, *, send_async=False, **kwargs): self._check_if_closed() diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index 7b6e6b02b1fb..877c4a0a66c8 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -9,6 +9,8 @@ ### Bugs Fixed +- Fixed a bug where sending large messages with synchronous client caused a frame buffer offset error ([#37916](https://github.com/Azure/azure-sdk-for-python/issues/37916)) + ### Other Changes ## 7.13.0 (2024-11-12) diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/sender.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/sender.py index 9cba87f2bc71..ea6f202bfd0f 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/sender.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/sender.py @@ -7,6 +7,7 @@ import uuid import logging import time +from threading import Lock from ._encode import encode_payload from .link import Link @@ -45,6 +46,7 @@ def __init__(self, session, handle, target_address, **kwargs): kwargs["source_address"] = "sender-link-{}".format(name) super(SenderLink, self).__init__(session, handle, name, role, target_address=target_address, **kwargs) self._pending_deliveries = [] + self.lock = Lock() @classmethod def from_incoming_frame(cls, session, handle, frame): @@ -139,21 +141,24 @@ def _on_session_state_change(self): super()._on_session_state_change() def update_pending_deliveries(self): - if self.current_link_credit <= 0: - self.current_link_credit = self.link_credit - self._outgoing_flow() - now = time.time() - pending = [] - for delivery in self._pending_deliveries: - if delivery.timeout and (now - delivery.start) >= delivery.timeout: - delivery.on_settled(LinkDeliverySettleReason.TIMEOUT, None) - continue - if not delivery.sent: - sent_and_settled = self._outgoing_transfer(delivery) - if sent_and_settled: + # TODO: Temporary fix until connection.listen removed from keep alive thread. + with self.lock: + if self.current_link_credit <= 0: + self.current_link_credit = self.link_credit + self._outgoing_flow() + now = time.time() + pending = [] + + for delivery in self._pending_deliveries: + if delivery.timeout and (now - delivery.start) >= delivery.timeout: + delivery.on_settled(LinkDeliverySettleReason.TIMEOUT, None) continue - pending.append(delivery) - self._pending_deliveries = pending + if not delivery.sent: + sent_and_settled = self._outgoing_transfer(delivery) + if sent_and_settled: + continue + pending.append(delivery) + self._pending_deliveries = pending def send_transfer(self, message, *, send_async=False, **kwargs): self._check_if_closed() diff --git a/sdk/servicebus/azure-servicebus/tests/test_topic.py b/sdk/servicebus/azure-servicebus/tests/test_topic.py index e0a799403efa..d07632116921 100644 --- a/sdk/servicebus/azure-servicebus/tests/test_topic.py +++ b/sdk/servicebus/azure-servicebus/tests/test_topic.py @@ -6,6 +6,9 @@ import logging import pytest +import time +import json +import sys from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, get_credential @@ -36,7 +39,7 @@ class TestServiceBusTopics(AzureMgmtRecordedTestCase): @CachedServiceBusTopicPreparer(name_prefix="servicebustest") @pytest.mark.parametrize("uamqp_transport", uamqp_transport_params, ids=uamqp_transport_ids) @ArgPasser() - def test_topic_by_servicebus_client_conn_str_send_basic( + def test_topic_by_servicebus_client_send_basic( self, uamqp_transport, *, servicebus_namespace=None, servicebus_topic=None, **kwargs ): fully_qualified_namespace = f"{servicebus_namespace.name}{SERVICEBUS_ENDPOINT_SUFFIX}" @@ -58,15 +61,15 @@ def test_topic_by_servicebus_client_conn_str_send_basic( @CachedServiceBusTopicPreparer(name_prefix="servicebustest") @pytest.mark.parametrize("uamqp_transport", uamqp_transport_params, ids=uamqp_transport_ids) @ArgPasser() - def test_topic_by_sas_token_credential_conn_str_send_basic( - self, - uamqp_transport, - *, - servicebus_namespace=None, - servicebus_namespace_key_name=None, - servicebus_namespace_primary_key=None, - servicebus_topic=None, - **kwargs, + def test_topic_by_sas_token_credential_send_basic( + self, + uamqp_transport, + *, + servicebus_namespace=None, + servicebus_namespace_key_name=None, + servicebus_namespace_primary_key=None, + servicebus_topic=None, + **kwargs ): fully_qualified_namespace = f"{servicebus_namespace.name}{SERVICEBUS_ENDPOINT_SUFFIX}" with ServiceBusClient( @@ -111,3 +114,49 @@ def test_topic_by_servicebus_client_list_topics( topics = client.list_topics() assert len(topics) >= 1 # assert all(isinstance(t, TopicClient) for t in topics) + + @pytest.mark.liveTest + @pytest.mark.live_test_only + @CachedServiceBusResourceGroupPreparer(name_prefix='servicebustest') + @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') + @CachedServiceBusTopicPreparer(name_prefix='servicebustest') + @pytest.mark.parametrize("uamqp_transport", uamqp_transport_params, ids=uamqp_transport_ids) + @ArgPasser() + def test_topic_by_servicebus_client_send_large_messages_w_sleep(self, uamqp_transport, *, servicebus_namespace=None, servicebus_topic=None, **kwargs): + fully_qualified_namespace = f"{servicebus_namespace.name}{SERVICEBUS_ENDPOINT_SUFFIX}" + credential = get_credential() + + # message of 100 kb - requires multiple transfer frames + size = 100 + large_dict = { + "key": "A" * 1024 + } + for i in range(size): + large_dict[f"key_{i}"] = "A" * 1024 + body = json.dumps(large_dict) + + sb_client = ServiceBusClient( + fully_qualified_namespace=fully_qualified_namespace, + credential=credential, + logging_enable=True, + uamqp_transport=uamqp_transport + ) + + # This issue doesn't repro unless logging is added here w/ this socket timeout, + # seemingly due to slowing down and some threading behavior. + # Adding in the logging here to make sure this bug is being hit and tested. + sender = sb_client.get_topic_sender(servicebus_topic.name, socket_timeout=60) + for i in range(10): + try: + time.sleep(10) + logging.info("sender created for %d", i) + size_in_bytes = sys.getsizeof(body) + + # Convert bytes to kilobytes (KB) + size_in_kb = size_in_bytes / 1024 + logging.info(f"size of body: {size_in_kb:.2f} KB") + sender.send_messages(ServiceBusMessage(body)) + logging.info(f"Message sent %d successfully", i) + except Exception as e: + logging.error(f"Error sending message %d: %s", i, str(e)) + raise From 28d13e0e888d6b03c1b2eb16d4a6f3db764a06ba Mon Sep 17 00:00:00 2001 From: Peter Wu <162184229+weirongw23-msft@users.noreply.github.com> Date: Wed, 22 Jan 2025 17:58:05 -0500 Subject: [PATCH 20/29] bumped versions after jan 22 patch release (#39355) --- sdk/storage/azure-storage-blob/CHANGELOG.md | 4 ++++ sdk/storage/azure-storage-blob/azure/storage/blob/_version.py | 2 +- sdk/storage/azure-storage-file-datalake/CHANGELOG.md | 4 ++++ .../azure/storage/filedatalake/_version.py | 2 +- sdk/storage/azure-storage-file-datalake/setup.py | 2 +- sdk/storage/azure-storage-file-share/CHANGELOG.md | 4 ++++ .../azure/storage/fileshare/_version.py | 2 +- 7 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sdk/storage/azure-storage-blob/CHANGELOG.md b/sdk/storage/azure-storage-blob/CHANGELOG.md index 0b758a126215..4bc915e2ef70 100644 --- a/sdk/storage/azure-storage-blob/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 12.25.0b1 (Unreleased) + +### Features Added + ## 12.24.1 (2025-01-22) ### Bugs Fixed diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_version.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_version.py index 92726764cda3..5192aed4c84b 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_version.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_version.py @@ -4,4 +4,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "12.24.1" +VERSION = "12.25.0b1" diff --git a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md index 3b46eae964f0..0e730f8db6d5 100644 --- a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 12.19.0b1 (Unreleased) + +### Features Added + ## 12.18.1 (2025-01-22) ### Bugs Fixed diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py index 404053207602..867c3e64caf7 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py @@ -4,4 +4,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "12.18.1" +VERSION = "12.19.0b1" diff --git a/sdk/storage/azure-storage-file-datalake/setup.py b/sdk/storage/azure-storage-file-datalake/setup.py index 02b66bad5f5e..94195192f65d 100644 --- a/sdk/storage/azure-storage-file-datalake/setup.py +++ b/sdk/storage/azure-storage-file-datalake/setup.py @@ -78,7 +78,7 @@ python_requires=">=3.8", install_requires=[ "azure-core>=1.30.0", - "azure-storage-blob>=12.24.1", + "azure-storage-blob>=12.25.0b1", "typing-extensions>=4.6.0", "isodate>=0.6.1" ], diff --git a/sdk/storage/azure-storage-file-share/CHANGELOG.md b/sdk/storage/azure-storage-file-share/CHANGELOG.md index bf3ccb382f82..dd26f607531f 100644 --- a/sdk/storage/azure-storage-file-share/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-share/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 12.21.0b1 (Unreleased) + +### Features Added + ## 12.20.1 (2025-01-22) ### Bugs Fixed diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_version.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_version.py index 6915bb3809c8..e9621bd9ee67 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_version.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_version.py @@ -4,4 +4,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "12.20.1" +VERSION = "12.21.0b1" From f0d430cbaf525de6ee96fef7b58bbebdea7e3331 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:30:26 -0800 Subject: [PATCH 21/29] Sync eng/common directory with azure-sdk-tools for PR 9656 (#39356) * Added label handle sdk-gen pipeline template Added common script to delete label from a PR * Update eng/common/scripts/Invoke-GitHubAPI.ps1 Co-authored-by: Ben Broderick Phillips --------- Co-authored-by: ray chen Co-authored-by: Ben Broderick Phillips --- .../templates/jobs/archetype-spec-gen-sdk.yml | 28 ++++++++++++++++ eng/common/scripts/Invoke-GitHubAPI.ps1 | 33 +++++++++++++++++++ eng/common/scripts/Remove-IssueLabel.ps1 | 32 ++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 eng/common/scripts/Remove-IssueLabel.ps1 diff --git a/eng/common/pipelines/templates/jobs/archetype-spec-gen-sdk.yml b/eng/common/pipelines/templates/jobs/archetype-spec-gen-sdk.yml index 2eb1ca65992b..30722e8df7fb 100644 --- a/eng/common/pipelines/templates/jobs/archetype-spec-gen-sdk.yml +++ b/eng/common/pipelines/templates/jobs/archetype-spec-gen-sdk.yml @@ -168,6 +168,34 @@ jobs: artifactName: $(sdkArtifactName) targetPath: "$(System.DefaultWorkingDirectory)/generatedSdkArtifacts" + - task: PowerShell@2 + displayName: Add label to the spec PR + condition: and(eq(variables['Build.Reason'], 'PullRequest'), ne(variables['BreakingChangeLabel'], ''), eq(variables['BreakingChangeLabelAction'], 'add')) + inputs: + pwsh: true + workingDirectory: $(SdkRepoDirectory) + filePath: $(SdkRepoDirectory)/eng/common/scripts/Add-IssueLabels.ps1 + arguments: > + -RepoOwner $(SpecRepoOwner) + -RepoName $(SpecRepoName) + -IssueNumber "$(System.PullRequest.PullRequestNumber)" + -Labels $(BreakingChangeLabel) + -AuthToken "$(azuresdk-github-pat)" + + - task: PowerShell@2 + displayName: Remove label from the spec PR + condition: and(eq(variables['Build.Reason'], 'PullRequest'), ne(variables['BreakingChangeLabel'], ''), eq(variables['BreakingChangeLabelAction'], 'remove')) + inputs: + pwsh: true + workingDirectory: $(SdkRepoDirectory) + filePath: $(SdkRepoDirectory)/eng/common/scripts/Remove-IssueLabel.ps1 + arguments: > + -RepoOwner $(SpecRepoOwner) + -RepoName $(SpecRepoName) + -IssueNumber "$(System.PullRequest.PullRequestNumber)" + -LabelName $(BreakingChangeLabel) + -AuthToken "$(azuresdk-github-pat)" + - ${{ if eq(parameters.SkipPullRequestCreation, false) }}: - template: /eng/common/pipelines/templates/steps/git-push-changes.yml parameters: diff --git a/eng/common/scripts/Invoke-GitHubAPI.ps1 b/eng/common/scripts/Invoke-GitHubAPI.ps1 index c4a9fa5bb11e..3c7c0596dfcd 100644 --- a/eng/common/scripts/Invoke-GitHubAPI.ps1 +++ b/eng/common/scripts/Invoke-GitHubAPI.ps1 @@ -258,6 +258,39 @@ function Add-GitHubIssueComment { -MaximumRetryCount 3 } +# Will delete label from the issue if it exists +function Remove-GitHubIssueLabel { + param ( + [Parameter(Mandatory = $true)] + $RepoOwner, + [Parameter(Mandatory = $true)] + $RepoName, + [Parameter(Mandatory = $true)] + $IssueNumber, + [ValidateNotNullOrEmpty()] + [Parameter(Mandatory = $true)] + $LabelName, + [ValidateNotNullOrEmpty()] + [Parameter(Mandatory = $true)] + $AuthToken + ) + + if ($LabelName.Trim().Length -eq 0) + { + throw " The 'LabelName' parameter should not be empty or whitespace." + } + # Encode the label name + $encodedLabelName = [System.Web.HttpUtility]::UrlEncode($LabelName) + + $uri = "$GithubAPIBaseURI/$RepoOwner/$RepoName/issues/$IssueNumber/labels/$encodedLabelName" + + return Invoke-RestMethod ` + -Method DELETE ` + -Uri $uri ` + -Headers (Get-GitHubApiHeaders -token $AuthToken) ` + -MaximumRetryCount 3 +} + # Will add labels to existing labels on the issue function Add-GitHubIssueLabels { param ( diff --git a/eng/common/scripts/Remove-IssueLabel.ps1 b/eng/common/scripts/Remove-IssueLabel.ps1 new file mode 100644 index 000000000000..1af5bea443c9 --- /dev/null +++ b/eng/common/scripts/Remove-IssueLabel.ps1 @@ -0,0 +1,32 @@ +[CmdletBinding(SupportsShouldProcess = $true)] +param( + [Parameter(Mandatory = $true)] + [string]$RepoOwner, + + [Parameter(Mandatory = $true)] + [string]$RepoName, + + [Parameter(Mandatory = $true)] + [string]$IssueNumber, + + [Parameter(Mandatory = $true)] + [string]$LabelName, + + [Parameter(Mandatory = $true)] + [string]$AuthToken +) + +. (Join-Path $PSScriptRoot common.ps1) + +try { + Remove-GitHubIssueLabel -RepoOwner $RepoOwner -RepoName $RepoName ` + -IssueNumber $IssueNumber -LabelName $LabelName -AuthToken $AuthToken +} +catch { + if ($_.Exception.Response.StatusCode -eq 404) { + LogWarning "Label $LabelName not found on issue" + exit 0 + } + LogError "Remove-GithubIssueLabel failed with exception:`n$_" + exit 1 +} \ No newline at end of file From 8318f4a2df6ecd86c40462b3724f475492742130 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:29:07 +0800 Subject: [PATCH 22/29] Update package_utils.py (#39361) --- tools/azure-sdk-tools/packaging_tools/package_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/azure-sdk-tools/packaging_tools/package_utils.py b/tools/azure-sdk-tools/packaging_tools/package_utils.py index 89ff7e24f21b..4eb1ea9c9364 100644 --- a/tools/azure-sdk-tools/packaging_tools/package_utils.py +++ b/tools/azure-sdk-tools/packaging_tools/package_utils.py @@ -62,7 +62,7 @@ def change_log_generate( else: last_version[-1] = str(last_release) except: - return "### Other Changes\n\n - Initial version" + return ("### Other Changes\n\n - Initial version", last_version) # try new changelog tool if prefolder and not is_multiapi: From 2fdfa595621016a62a36c9191fabe35291970d83 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 23 Jan 2025 01:20:09 -0800 Subject: [PATCH 23/29] [AutoRelease] t2-web-2024-11-15-26155(can only be merged by SDK owner) (#38561) * code and test * Update app_service_environments_create_or_update_multi_role_pool.py * udpate version * update-testcase * update testcases * update format * Update CHANGELOG.md * Update CHANGELOG.md * update version --------- Co-authored-by: azure-sdk Co-authored-by: Yuchao Yan Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: ChenxiJiang333 Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> --- sdk/appservice/azure-mgmt-web/CHANGELOG.md | 6 +- .../azure-mgmt-web/azure/mgmt/web/__init__.py | 4 +- .../azure/mgmt/web/_configuration.py | 39 +- .../azure/mgmt/web/_operations_mixin.py | 563 ++----- .../azure-mgmt-web/azure/mgmt/web/_version.py | 2 +- .../mgmt/web/_web_site_management_client.py | 1383 +++++++--------- .../azure/mgmt/web/aio/__init__.py | 3 +- .../azure/mgmt/web/aio/_configuration.py | 39 +- .../azure/mgmt/web/aio/_operations_mixin.py | 563 ++----- .../web/aio/_web_site_management_client.py | 1391 +++++++---------- .../azure/mgmt/web/v2016_03_01/_version.py | 2 +- .../azure/mgmt/web/v2018_02_01/_version.py | 2 +- .../azure/mgmt/web/v2022_09_01/_version.py | 2 +- .../azure/mgmt/web/v2023_01_01/_version.py | 2 +- .../azure/mgmt/web/v2024_04_01/_version.py | 2 +- ...vironments_create_or_update_worker_pool.py | 14 +- .../generated_samples/list_operations.py | 10 +- ...ist_workflows_configuration_connections.py | 10 +- .../start_web_site_network_trace_operation.py | 12 +- .../stop_web_site_network_trace.py | 11 +- sdk/appservice/azure-mgmt-web/setup.py | 8 +- .../azure-mgmt-web/tests/conftest.py | 2 +- .../disable_test_cli_mgmt_app_service.py | 61 +- .../disable_test_cli_mgmt_certificate.py | 59 +- .../disable_test_cli_mgmt_static_site.py | 190 ++- .../tests/disable_test_cli_mgmt_web.py | 1139 ++++++++------ .../tests/disable_test_cli_mgmt_web_app.py | 1183 +++++++------- ...ertificate_orders_operations_async_test.py | 36 + ...vice_certificate_orders_operations_test.py | 35 + ...vice_environments_operations_async_test.py | 36 + ...pp_service_environments_operations_test.py | 35 + ...app_service_plans_operations_async_test.py | 36 + ...ement_app_service_plans_operations_test.py | 35 + .../test_web_site_management_async_test.py | 69 + ...stration_provider_operations_async_test.py | 27 + ...e_registration_provider_operations_test.py | 26 + ...ment_certificates_operations_async_test.py | 36 + ...management_certificates_operations_test.py | 35 + ...nt_container_apps_operations_async_test.py | 36 + ...nagement_container_apps_operations_test.py | 35 + ..._deleted_web_apps_operations_async_test.py | 27 + ...gement_deleted_web_apps_operations_test.py | 26 + ...stration_provider_operations_async_test.py | 27 + ...n_registration_provider_operations_test.py | 26 + ...anagement_domains_operations_async_test.py | 36 + ...site_management_domains_operations_test.py | 33 + ...kube_environments_operations_async_test.py | 36 + ...ement_kube_environments_operations_test.py | 35 + ...nagement_provider_operations_async_test.py | 55 + ...ite_management_provider_operations_test.py | 54 + ...t_recommendations_operations_async_test.py | 27 + ...agement_recommendations_operations_test.py | 26 + ...e_health_metadata_operations_async_test.py | 27 + ...esource_health_metadata_operations_test.py | 26 + ...ment_static_sites_operations_async_test.py | 36 + ...management_static_sites_operations_test.py | 35 + .../tests/test_web_site_management_test.py | 75 + ...top_level_domains_operations_async_test.py | 27 + ...ement_top_level_domains_operations_test.py | 26 + ...nagement_web_apps_operations_async_test.py | 9 +- ...ite_management_web_apps_operations_test.py | 9 +- 61 files changed, 4008 insertions(+), 3849 deletions(-) create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_certificate_orders_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_certificate_orders_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_environments_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_environments_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_plans_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_plans_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificate_registration_provider_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificate_registration_provider_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificates_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificates_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_container_apps_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_container_apps_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_deleted_web_apps_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_deleted_web_apps_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domain_registration_provider_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domain_registration_provider_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domains_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domains_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_kube_environments_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_kube_environments_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_provider_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_provider_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_recommendations_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_recommendations_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_resource_health_metadata_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_resource_health_metadata_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_static_sites_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_static_sites_operations_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_top_level_domains_operations_async_test.py create mode 100644 sdk/appservice/azure-mgmt-web/tests/test_web_site_management_top_level_domains_operations_test.py diff --git a/sdk/appservice/azure-mgmt-web/CHANGELOG.md b/sdk/appservice/azure-mgmt-web/CHANGELOG.md index 74aa8166ab9c..a0d94b6a65c6 100644 --- a/sdk/appservice/azure-mgmt-web/CHANGELOG.md +++ b/sdk/appservice/azure-mgmt-web/CHANGELOG.md @@ -1,8 +1,10 @@ # Release History -## 0.0.0 (2024-11-18) +## 8.0.0 (2025-01-23) -change log generation failed!!! +### Breaking Changes + + - Removed subfolders of some unused Api-Versions for smaller package size. If your application requires a specific and non-latest Api-Version, it's recommended to pin this package to the previous released version; If your application always only use latest Api-Version, please ignore this change. ## 7.3.1 (2024-08-19) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/__init__.py index 41da083b833b..c2f92f94f4d8 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/__init__.py @@ -7,10 +7,12 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -__all__ = ['WebSiteManagementClient'] + +__all__ = ["WebSiteManagementClient"] try: from ._patch import patch_sdk # type: ignore + patch_sdk() except ImportError: pass diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_configuration.py index 7884fff20c78..6baf828723b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_configuration.py @@ -19,6 +19,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential + class WebSiteManagementClientConfiguration: """Configuration for WebSiteManagementClient. @@ -31,12 +32,7 @@ class WebSiteManagementClientConfiguration: :type subscription_id: str """ - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - **kwargs: Any - ): + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any): if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -44,23 +40,22 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-web/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "azure-mgmt-web/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ): - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any): + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py index f828816faac3..599f237da703 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py @@ -21,7 +21,7 @@ from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object class WebSiteManagementClientOperationsMixin(object): @@ -56,32 +56,16 @@ def check_name_availability( :rtype: ~azure.mgmt.web.v2024_04_01.models.ResourceNameAvailability :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('check_name_availability') - if api_version == '2016-03-01': + api_version = self._get_api_version("check_name_availability") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'check_name_availability'".format(api_version)) @@ -94,10 +78,7 @@ def check_name_availability( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.check_name_availability(name, type, is_fqdn, environment_id, **kwargs) - def get_publishing_user( - self, - **kwargs: Any - ) -> _models.User: + def get_publishing_user(self, **kwargs: Any) -> _models.User: """Gets publishing user. Description for Gets publishing user. @@ -106,32 +87,16 @@ def get_publishing_user( :rtype: ~azure.mgmt.web.v2024_04_01.models.User :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('get_publishing_user') - if api_version == '2016-03-01': + api_version = self._get_api_version("get_publishing_user") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_publishing_user'".format(api_version)) @@ -144,11 +109,7 @@ def get_publishing_user( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.get_publishing_user(**kwargs) - def get_source_control( - self, - source_control_type: str, - **kwargs: Any - ) -> _models.SourceControl: + def get_source_control(self, source_control_type: str, **kwargs: Any) -> _models.SourceControl: """Gets source control token. Description for Gets source control token. @@ -159,32 +120,16 @@ def get_source_control( :rtype: ~azure.mgmt.web.v2024_04_01.models.SourceControl :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('get_source_control') - if api_version == '2016-03-01': + api_version = self._get_api_version("get_source_control") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_source_control'".format(api_version)) @@ -197,10 +142,7 @@ def get_source_control( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.get_source_control(source_control_type, **kwargs) - def get_subscription_deployment_locations( - self, - **kwargs: Any - ) -> _models.DeploymentLocations: + def get_subscription_deployment_locations(self, **kwargs: Any) -> _models.DeploymentLocations: """Gets list of available geo regions plus ministamps. Description for Gets list of available geo regions plus ministamps. @@ -209,35 +151,21 @@ def get_subscription_deployment_locations( :rtype: ~azure.mgmt.web.v2024_04_01.models.DeploymentLocations :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('get_subscription_deployment_locations') - if api_version == '2016-03-01': + api_version = self._get_api_version("get_subscription_deployment_locations") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: - raise ValueError("API version {} does not have operation 'get_subscription_deployment_locations'".format(api_version)) + raise ValueError( + "API version {} does not have operation 'get_subscription_deployment_locations'".format(api_version) + ) mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config @@ -247,10 +175,7 @@ def get_subscription_deployment_locations( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.get_subscription_deployment_locations(**kwargs) - def list_ase_regions( - self, - **kwargs: Any - ) -> Iterable["_models.AseRegion"]: + def list_ase_regions(self, **kwargs: Any) -> Iterable["_models.AseRegion"]: """Get a list of available ASE regions and its supported Skus. Description for get a list of available ASE regions and its supported Skus. @@ -259,12 +184,10 @@ def list_ase_regions( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2024_04_01.models.AseRegion] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_ase_regions') - if api_version == '2023-01-01': + api_version = self._get_api_version("list_ase_regions") + if api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_ase_regions'".format(api_version)) @@ -278,10 +201,7 @@ def list_ase_regions( return mixin_instance.list_ase_regions(**kwargs) def list_billing_meters( - self, - billing_location: Optional[str] = None, - os_type: Optional[str] = None, - **kwargs: Any + self, billing_location: Optional[str] = None, os_type: Optional[str] = None, **kwargs: Any ) -> Iterable["_models.BillingMeter"]: """Gets a list of meters for a given location. @@ -295,30 +215,14 @@ def list_billing_meters( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2024_04_01.models.BillingMeter] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_billing_meters') - if api_version == '2018-02-01': + api_version = self._get_api_version("list_billing_meters") + if api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_billing_meters'".format(api_version)) @@ -332,9 +236,7 @@ def list_billing_meters( return mixin_instance.list_billing_meters(billing_location, os_type, **kwargs) def list_custom_host_name_sites( - self, - hostname: Optional[str] = None, - **kwargs: Any + self, hostname: Optional[str] = None, **kwargs: Any ) -> Iterable["_models.CustomHostnameSites"]: """Get custom hostnames under this subscription. @@ -346,16 +248,12 @@ def list_custom_host_name_sites( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2024_04_01.models.CustomHostnameSites] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_custom_host_name_sites') - if api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("list_custom_host_name_sites") + if api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_custom_host_name_sites'".format(api_version)) @@ -398,32 +296,16 @@ def list_geo_regions( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2024_04_01.models.GeoRegion] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_geo_regions') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_geo_regions") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_geo_regions'".format(api_version)) @@ -434,12 +316,11 @@ def list_geo_regions( mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_geo_regions(sku, linux_workers_enabled, xenon_workers_enabled, linux_dynamic_workers_enabled, **kwargs) + return mixin_instance.list_geo_regions( + sku, linux_workers_enabled, xenon_workers_enabled, linux_dynamic_workers_enabled, **kwargs + ) - def list_premier_add_on_offers( - self, - **kwargs: Any - ) -> Iterable["_models.PremierAddOnOffer"]: + def list_premier_add_on_offers(self, **kwargs: Any) -> Iterable["_models.PremierAddOnOffer"]: """List all premier add-on offers. Description for List all premier add-on offers. @@ -448,32 +329,16 @@ def list_premier_add_on_offers( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2024_04_01.models.PremierAddOnOffer] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_premier_add_on_offers') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_premier_add_on_offers") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_premier_add_on_offers'".format(api_version)) @@ -487,9 +352,7 @@ def list_premier_add_on_offers( return mixin_instance.list_premier_add_on_offers(**kwargs) def list_site_identifiers_assigned_to_host_name( # pylint: disable=name-too-long - self, - name_identifier: Union[_models.NameIdentifier, IO[bytes]], - **kwargs: Any + self, name_identifier: Union[_models.NameIdentifier, IO[bytes]], **kwargs: Any ) -> Iterable["_models.Identifier"]: """List all apps that are assigned to a hostname. @@ -502,35 +365,23 @@ def list_site_identifiers_assigned_to_host_name( # pylint: disable=name-too-lon :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2024_04_01.models.Identifier] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_site_identifiers_assigned_to_host_name') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_site_identifiers_assigned_to_host_name") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: - raise ValueError("API version {} does not have operation 'list_site_identifiers_assigned_to_host_name'".format(api_version)) + raise ValueError( + "API version {} does not have operation 'list_site_identifiers_assigned_to_host_name'".format( + api_version + ) + ) mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config @@ -540,10 +391,7 @@ def list_site_identifiers_assigned_to_host_name( # pylint: disable=name-too-lon mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.list_site_identifiers_assigned_to_host_name(name_identifier, **kwargs) - def list_skus( - self, - **kwargs: Any - ) -> _models.SkuInfos: + def list_skus(self, **kwargs: Any) -> _models.SkuInfos: """List all SKUs. Description for List all SKUs. @@ -552,32 +400,16 @@ def list_skus( :rtype: ~azure.mgmt.web.v2024_04_01.models.SkuInfos :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_skus') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_skus") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_skus'".format(api_version)) @@ -590,10 +422,7 @@ def list_skus( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.list_skus(**kwargs) - def list_source_controls( - self, - **kwargs: Any - ) -> Iterable["_models.SourceControl"]: + def list_source_controls(self, **kwargs: Any) -> Iterable["_models.SourceControl"]: """Gets the source controls available for Azure websites. Description for Gets the source controls available for Azure websites. @@ -602,32 +431,16 @@ def list_source_controls( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2024_04_01.models.SourceControl] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_source_controls') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_source_controls") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_source_controls'".format(api_version)) @@ -660,32 +473,16 @@ def move( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('move') - if api_version == '2016-03-01': + api_version = self._get_api_version("move") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'move'".format(api_version)) @@ -698,11 +495,7 @@ def move( # pylint: disable=inconsistent-return-statements mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.move(resource_group_name, move_resource_envelope, **kwargs) - def update_publishing_user( - self, - user_details: Union[_models.User, IO[bytes]], - **kwargs: Any - ) -> _models.User: + def update_publishing_user(self, user_details: Union[_models.User, IO[bytes]], **kwargs: Any) -> _models.User: """Updates publishing user. Description for Updates publishing user. @@ -714,32 +507,16 @@ def update_publishing_user( :rtype: ~azure.mgmt.web.v2024_04_01.models.User :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('update_publishing_user') - if api_version == '2016-03-01': + api_version = self._get_api_version("update_publishing_user") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_publishing_user'".format(api_version)) @@ -753,10 +530,7 @@ def update_publishing_user( return mixin_instance.update_publishing_user(user_details, **kwargs) def update_source_control( - self, - source_control_type: str, - request_message: Union[_models.SourceControl, IO[bytes]], - **kwargs: Any + self, source_control_type: str, request_message: Union[_models.SourceControl, IO[bytes]], **kwargs: Any ) -> _models.SourceControl: """Updates source control token. @@ -771,32 +545,16 @@ def update_source_control( :rtype: ~azure.mgmt.web.v2024_04_01.models.SourceControl :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('update_source_control') - if api_version == '2016-03-01': + api_version = self._get_api_version("update_source_control") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_source_control'".format(api_version)) @@ -810,10 +568,7 @@ def update_source_control( return mixin_instance.update_source_control(source_control_type, request_message, **kwargs) def validate( - self, - resource_group_name: str, - validate_request: Union[_models.ValidateRequest, IO[bytes]], - **kwargs: Any + self, resource_group_name: str, validate_request: Union[_models.ValidateRequest, IO[bytes]], **kwargs: Any ) -> _models.ValidateResponse: """Validate if a resource can be created. @@ -828,32 +583,16 @@ def validate( :rtype: ~azure.mgmt.web.v2024_04_01.models.ValidateResponse :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('validate') - if api_version == '2016-03-01': + api_version = self._get_api_version("validate") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate'".format(api_version)) @@ -886,8 +625,8 @@ def validate_container_settings( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('validate_container_settings') - if api_version == '2018-02-01': + api_version = self._get_api_version("validate_container_settings") + if api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate_container_settings'".format(api_version)) @@ -898,7 +637,9 @@ def validate_container_settings( mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.validate_container_settings(resource_group_name, validate_container_settings_request, **kwargs) + return mixin_instance.validate_container_settings( + resource_group_name, validate_container_settings_request, **kwargs + ) def validate_move( # pylint: disable=inconsistent-return-statements self, @@ -920,32 +661,16 @@ def validate_move( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('validate_move') - if api_version == '2016-03-01': + api_version = self._get_api_version("validate_move") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate_move'".format(api_version)) @@ -959,9 +684,7 @@ def validate_move( # pylint: disable=inconsistent-return-statements return mixin_instance.validate_move(resource_group_name, move_resource_envelope, **kwargs) def verify_hosting_environment_vnet( - self, - parameters: Union[_models.VnetParameters, IO[bytes]], - **kwargs: Any + self, parameters: Union[_models.VnetParameters, IO[bytes]], **kwargs: Any ) -> _models.VnetValidationFailureDetails: """Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. @@ -976,35 +699,21 @@ def verify_hosting_environment_vnet( :rtype: ~azure.mgmt.web.v2024_04_01.models.VnetValidationFailureDetails :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('verify_hosting_environment_vnet') - if api_version == '2016-03-01': + api_version = self._get_api_version("verify_hosting_environment_vnet") + if api_version == "2016-03-01": from .v2016_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: - raise ValueError("API version {} does not have operation 'verify_hosting_environment_vnet'".format(api_version)) + raise ValueError( + "API version {} does not have operation 'verify_hosting_environment_vnet'".format(api_version) + ) mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py index fb6c13e9c00f..b56384cd4633 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "0.0.0" +VERSION = "8.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py index 8fddd571114d..a92777697e87 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py @@ -26,6 +26,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential + class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -33,6 +34,7 @@ def __init__(self, *args, **kwargs): """ pass + class WebSiteManagementClient(WebSiteManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): """WebSite Management Client. @@ -57,28 +59,30 @@ class WebSiteManagementClient(WebSiteManagementClientOperationsMixin, MultiApiCl :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2024-04-01' + DEFAULT_API_VERSION = "2024-04-01" _PROFILE_TAG = "azure.mgmt.web.WebSiteManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - 'billing_meters': '2016-03-01', - 'validate_container_settings': '2018-02-01', - }}, - _PROFILE_TAG + " latest" + LATEST_PROFILE = ProfileDefinition( + { + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + "billing_meters": "2016-03-01", + "validate_container_settings": "2018-02-01", + } + }, + _PROFILE_TAG + " latest", ) def __init__( self, credential: "TokenCredential", subscription_id: str, - api_version: Optional[str]=None, + api_version: Optional[str] = None, base_url: str = "https://management.azure.com", - profile: KnownProfiles=KnownProfiles.default, + profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ): if api_version: - kwargs.setdefault('api_version', api_version) + kwargs.setdefault("api_version", api_version) self._config = WebSiteManagementClientConfiguration(credential, subscription_id, **kwargs) _policies = kwargs.pop("policies", None) if _policies is None: @@ -99,10 +103,7 @@ def __init__( self._config.http_logging_policy, ] self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - super(WebSiteManagementClient, self).__init__( - api_version=api_version, - profile=profile - ) + super(WebSiteManagementClient, self).__init__(api_version=api_version, profile=profile) @classmethod def _models_dict(cls, api_version): @@ -112,78 +113,31 @@ def _models_dict(cls, api_version): def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: - * 2015-04-01: :mod:`v2015_04_01.models` - * 2015-08-01: :mod:`v2015_08_01.models` - * 2016-03-01: :mod:`v2016_03_01.models` - * 2016-08-01: :mod:`v2016_08_01.models` - * 2016-09-01: :mod:`v2016_09_01.models` - * 2018-02-01: :mod:`v2018_02_01.models` - * 2018-11-01: :mod:`v2018_11_01.models` - * 2019-08-01: :mod:`v2019_08_01.models` - * 2020-06-01: :mod:`v2020_06_01.models` - * 2020-09-01: :mod:`v2020_09_01.models` - * 2020-12-01: :mod:`v2020_12_01.models` - * 2021-01-01: :mod:`v2021_01_01.models` - * 2021-01-15: :mod:`v2021_01_15.models` - * 2021-03-01: :mod:`v2021_03_01.models` - * 2022-09-01: :mod:`v2022_09_01.models` - * 2023-01-01: :mod:`v2023_01_01.models` - * 2023-12-01: :mod:`v2023_12_01.models` - * 2024-04-01: :mod:`v2024_04_01.models` + * 2016-03-01: :mod:`v2016_03_01.models` + * 2018-02-01: :mod:`v2018_02_01.models` + * 2022-09-01: :mod:`v2022_09_01.models` + * 2023-01-01: :mod:`v2023_01_01.models` + * 2024-04-01: :mod:`v2024_04_01.models` """ - if api_version == '2015-04-01': - from .v2015_04_01 import models - return models - elif api_version == '2015-08-01': - from .v2015_08_01 import models - return models - elif api_version == '2016-03-01': + if api_version == "2016-03-01": from .v2016_03_01 import models + return models - elif api_version == '2016-08-01': - from .v2016_08_01 import models - return models - elif api_version == '2016-09-01': - from .v2016_09_01 import models - return models - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01 import models + return models - elif api_version == '2018-11-01': - from .v2018_11_01 import models - return models - elif api_version == '2019-08-01': - from .v2019_08_01 import models - return models - elif api_version == '2020-06-01': - from .v2020_06_01 import models - return models - elif api_version == '2020-09-01': - from .v2020_09_01 import models - return models - elif api_version == '2020-12-01': - from .v2020_12_01 import models - return models - elif api_version == '2021-01-01': - from .v2021_01_01 import models - return models - elif api_version == '2021-01-15': - from .v2021_01_15 import models - return models - elif api_version == '2021-03-01': - from .v2021_03_01 import models - return models - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01 import models + return models - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01 import models + return models - elif api_version == '2023-12-01': - from .v2023_12_01 import models - return models - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @@ -191,1148 +145,893 @@ def models(cls, api_version=DEFAULT_API_VERSION): def app_service_certificate_orders(self): """Instance depends on the API version: - * 2015-08-01: :class:`AppServiceCertificateOrdersOperations` - * 2018-02-01: :class:`AppServiceCertificateOrdersOperations` - * 2019-08-01: :class:`AppServiceCertificateOrdersOperations` - * 2020-06-01: :class:`AppServiceCertificateOrdersOperations` - * 2020-09-01: :class:`AppServiceCertificateOrdersOperations` - * 2020-12-01: :class:`AppServiceCertificateOrdersOperations` - * 2021-01-01: :class:`AppServiceCertificateOrdersOperations` - * 2021-01-15: :class:`AppServiceCertificateOrdersOperations` - * 2021-03-01: :class:`AppServiceCertificateOrdersOperations` - * 2022-09-01: :class:`AppServiceCertificateOrdersOperations` - * 2023-01-01: :class:`AppServiceCertificateOrdersOperations` - * 2023-12-01: :class:`AppServiceCertificateOrdersOperations` - * 2024-04-01: :class:`AppServiceCertificateOrdersOperations` + * 2018-02-01: :class:`AppServiceCertificateOrdersOperations` + * 2022-09-01: :class:`AppServiceCertificateOrdersOperations` + * 2023-01-01: :class:`AppServiceCertificateOrdersOperations` + * 2024-04-01: :class:`AppServiceCertificateOrdersOperations` """ - api_version = self._get_api_version('app_service_certificate_orders') - if api_version == '2015-08-01': - from .v2015_08_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("app_service_certificate_orders") + if api_version == "2018-02-01": from .v2018_02_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import AppServiceCertificateOrdersOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'app_service_certificate_orders'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'app_service_certificate_orders'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def app_service_environments(self): """Instance depends on the API version: - * 2016-09-01: :class:`AppServiceEnvironmentsOperations` - * 2018-02-01: :class:`AppServiceEnvironmentsOperations` - * 2019-08-01: :class:`AppServiceEnvironmentsOperations` - * 2020-06-01: :class:`AppServiceEnvironmentsOperations` - * 2020-09-01: :class:`AppServiceEnvironmentsOperations` - * 2020-12-01: :class:`AppServiceEnvironmentsOperations` - * 2021-01-01: :class:`AppServiceEnvironmentsOperations` - * 2021-01-15: :class:`AppServiceEnvironmentsOperations` - * 2021-03-01: :class:`AppServiceEnvironmentsOperations` - * 2022-09-01: :class:`AppServiceEnvironmentsOperations` - * 2023-01-01: :class:`AppServiceEnvironmentsOperations` - * 2023-12-01: :class:`AppServiceEnvironmentsOperations` - * 2024-04-01: :class:`AppServiceEnvironmentsOperations` + * 2018-02-01: :class:`AppServiceEnvironmentsOperations` + * 2022-09-01: :class:`AppServiceEnvironmentsOperations` + * 2023-01-01: :class:`AppServiceEnvironmentsOperations` + * 2024-04-01: :class:`AppServiceEnvironmentsOperations` """ - api_version = self._get_api_version('app_service_environments') - if api_version == '2016-09-01': - from .v2016_09_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("app_service_environments") + if api_version == "2018-02-01": from .v2018_02_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import AppServiceEnvironmentsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'app_service_environments'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'app_service_environments'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def app_service_plans(self): """Instance depends on the API version: - * 2016-09-01: :class:`AppServicePlansOperations` - * 2018-02-01: :class:`AppServicePlansOperations` - * 2019-08-01: :class:`AppServicePlansOperations` - * 2020-06-01: :class:`AppServicePlansOperations` - * 2020-09-01: :class:`AppServicePlansOperations` - * 2020-12-01: :class:`AppServicePlansOperations` - * 2021-01-01: :class:`AppServicePlansOperations` - * 2021-01-15: :class:`AppServicePlansOperations` - * 2021-03-01: :class:`AppServicePlansOperations` - * 2022-09-01: :class:`AppServicePlansOperations` - * 2023-01-01: :class:`AppServicePlansOperations` - * 2023-12-01: :class:`AppServicePlansOperations` - * 2024-04-01: :class:`AppServicePlansOperations` + * 2018-02-01: :class:`AppServicePlansOperations` + * 2022-09-01: :class:`AppServicePlansOperations` + * 2023-01-01: :class:`AppServicePlansOperations` + * 2024-04-01: :class:`AppServicePlansOperations` """ - api_version = self._get_api_version('app_service_plans') - if api_version == '2016-09-01': - from .v2016_09_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("app_service_plans") + if api_version == "2018-02-01": from .v2018_02_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import AppServicePlansOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import AppServicePlansOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import AppServicePlansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_plans'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def billing_meters(self): """Instance depends on the API version: - * 2016-03-01: :class:`BillingMetersOperations` + * 2016-03-01: :class:`BillingMetersOperations` """ - api_version = self._get_api_version('billing_meters') - if api_version == '2016-03-01': + api_version = self._get_api_version("billing_meters") + if api_version == "2016-03-01": from .v2016_03_01.operations import BillingMetersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'billing_meters'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def certificate_orders_diagnostics(self): """Instance depends on the API version: - * 2020-12-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2021-01-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2021-01-15: :class:`CertificateOrdersDiagnosticsOperations` - * 2021-03-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2022-09-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2023-01-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2023-12-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2024-04-01: :class:`CertificateOrdersDiagnosticsOperations` + * 2022-09-01: :class:`CertificateOrdersDiagnosticsOperations` + * 2023-01-01: :class:`CertificateOrdersDiagnosticsOperations` + * 2024-04-01: :class:`CertificateOrdersDiagnosticsOperations` """ - api_version = self._get_api_version('certificate_orders_diagnostics') - if api_version == '2020-12-01': - from .v2020_12_01.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("certificate_orders_diagnostics") + if api_version == "2022-09-01": from .v2022_09_01.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import CertificateOrdersDiagnosticsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'certificate_orders_diagnostics'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'certificate_orders_diagnostics'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def certificate_registration_provider(self): """Instance depends on the API version: - * 2015-08-01: :class:`CertificateRegistrationProviderOperations` - * 2018-02-01: :class:`CertificateRegistrationProviderOperations` - * 2019-08-01: :class:`CertificateRegistrationProviderOperations` - * 2020-06-01: :class:`CertificateRegistrationProviderOperations` - * 2020-09-01: :class:`CertificateRegistrationProviderOperations` - * 2020-12-01: :class:`CertificateRegistrationProviderOperations` - * 2021-01-01: :class:`CertificateRegistrationProviderOperations` - * 2021-01-15: :class:`CertificateRegistrationProviderOperations` - * 2021-03-01: :class:`CertificateRegistrationProviderOperations` - * 2022-09-01: :class:`CertificateRegistrationProviderOperations` - * 2023-01-01: :class:`CertificateRegistrationProviderOperations` - * 2023-12-01: :class:`CertificateRegistrationProviderOperations` - * 2024-04-01: :class:`CertificateRegistrationProviderOperations` + * 2018-02-01: :class:`CertificateRegistrationProviderOperations` + * 2022-09-01: :class:`CertificateRegistrationProviderOperations` + * 2023-01-01: :class:`CertificateRegistrationProviderOperations` + * 2024-04-01: :class:`CertificateRegistrationProviderOperations` """ - api_version = self._get_api_version('certificate_registration_provider') - if api_version == '2015-08-01': - from .v2015_08_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("certificate_registration_provider") + if api_version == "2018-02-01": from .v2018_02_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import CertificateRegistrationProviderOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'certificate_registration_provider'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'certificate_registration_provider'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def certificates(self): """Instance depends on the API version: - * 2016-03-01: :class:`CertificatesOperations` - * 2018-02-01: :class:`CertificatesOperations` - * 2018-11-01: :class:`CertificatesOperations` - * 2019-08-01: :class:`CertificatesOperations` - * 2020-06-01: :class:`CertificatesOperations` - * 2020-09-01: :class:`CertificatesOperations` - * 2020-12-01: :class:`CertificatesOperations` - * 2021-01-01: :class:`CertificatesOperations` - * 2021-01-15: :class:`CertificatesOperations` - * 2021-03-01: :class:`CertificatesOperations` - * 2022-09-01: :class:`CertificatesOperations` - * 2023-01-01: :class:`CertificatesOperations` - * 2023-12-01: :class:`CertificatesOperations` - * 2024-04-01: :class:`CertificatesOperations` + * 2016-03-01: :class:`CertificatesOperations` + * 2018-02-01: :class:`CertificatesOperations` + * 2022-09-01: :class:`CertificatesOperations` + * 2023-01-01: :class:`CertificatesOperations` + * 2024-04-01: :class:`CertificatesOperations` """ - api_version = self._get_api_version('certificates') - if api_version == '2016-03-01': + api_version = self._get_api_version("certificates") + if api_version == "2016-03-01": from .v2016_03_01.operations import CertificatesOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import CertificatesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import CertificatesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import CertificatesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import CertificatesOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import CertificatesOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import CertificatesOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import CertificatesOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import CertificatesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import CertificatesOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import CertificatesOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import CertificatesOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import CertificatesOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import CertificatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificates'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def container_apps(self): """Instance depends on the API version: - * 2021-03-01: :class:`ContainerAppsOperations` - * 2022-09-01: :class:`ContainerAppsOperations` - * 2023-01-01: :class:`ContainerAppsOperations` - * 2023-12-01: :class:`ContainerAppsOperations` - * 2024-04-01: :class:`ContainerAppsOperations` + * 2022-09-01: :class:`ContainerAppsOperations` + * 2023-01-01: :class:`ContainerAppsOperations` + * 2024-04-01: :class:`ContainerAppsOperations` """ - api_version = self._get_api_version('container_apps') - if api_version == '2021-03-01': - from .v2021_03_01.operations import ContainerAppsOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("container_apps") + if api_version == "2022-09-01": from .v2022_09_01.operations import ContainerAppsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import ContainerAppsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import ContainerAppsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import ContainerAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'container_apps'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def container_apps_revisions(self): """Instance depends on the API version: - * 2021-03-01: :class:`ContainerAppsRevisionsOperations` - * 2022-09-01: :class:`ContainerAppsRevisionsOperations` - * 2023-01-01: :class:`ContainerAppsRevisionsOperations` - * 2023-12-01: :class:`ContainerAppsRevisionsOperations` - * 2024-04-01: :class:`ContainerAppsRevisionsOperations` + * 2022-09-01: :class:`ContainerAppsRevisionsOperations` + * 2023-01-01: :class:`ContainerAppsRevisionsOperations` + * 2024-04-01: :class:`ContainerAppsRevisionsOperations` """ - api_version = self._get_api_version('container_apps_revisions') - if api_version == '2021-03-01': - from .v2021_03_01.operations import ContainerAppsRevisionsOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("container_apps_revisions") + if api_version == "2022-09-01": from .v2022_09_01.operations import ContainerAppsRevisionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import ContainerAppsRevisionsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import ContainerAppsRevisionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import ContainerAppsRevisionsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'container_apps_revisions'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'container_apps_revisions'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def deleted_web_apps(self): """Instance depends on the API version: - * 2016-03-01: :class:`DeletedWebAppsOperations` - * 2018-02-01: :class:`DeletedWebAppsOperations` - * 2019-08-01: :class:`DeletedWebAppsOperations` - * 2020-06-01: :class:`DeletedWebAppsOperations` - * 2020-09-01: :class:`DeletedWebAppsOperations` - * 2020-12-01: :class:`DeletedWebAppsOperations` - * 2021-01-01: :class:`DeletedWebAppsOperations` - * 2021-01-15: :class:`DeletedWebAppsOperations` - * 2021-03-01: :class:`DeletedWebAppsOperations` - * 2022-09-01: :class:`DeletedWebAppsOperations` - * 2023-01-01: :class:`DeletedWebAppsOperations` - * 2023-12-01: :class:`DeletedWebAppsOperations` - * 2024-04-01: :class:`DeletedWebAppsOperations` + * 2016-03-01: :class:`DeletedWebAppsOperations` + * 2018-02-01: :class:`DeletedWebAppsOperations` + * 2022-09-01: :class:`DeletedWebAppsOperations` + * 2023-01-01: :class:`DeletedWebAppsOperations` + * 2024-04-01: :class:`DeletedWebAppsOperations` """ - api_version = self._get_api_version('deleted_web_apps') - if api_version == '2016-03-01': + api_version = self._get_api_version("deleted_web_apps") + if api_version == "2016-03-01": from .v2016_03_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import DeletedWebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deleted_web_apps'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def diagnostics(self): """Instance depends on the API version: - * 2016-03-01: :class:`DiagnosticsOperations` - * 2018-02-01: :class:`DiagnosticsOperations` - * 2019-08-01: :class:`DiagnosticsOperations` - * 2020-06-01: :class:`DiagnosticsOperations` - * 2020-09-01: :class:`DiagnosticsOperations` - * 2020-12-01: :class:`DiagnosticsOperations` - * 2021-01-01: :class:`DiagnosticsOperations` - * 2021-01-15: :class:`DiagnosticsOperations` - * 2021-03-01: :class:`DiagnosticsOperations` - * 2022-09-01: :class:`DiagnosticsOperations` - * 2023-01-01: :class:`DiagnosticsOperations` - * 2023-12-01: :class:`DiagnosticsOperations` - * 2024-04-01: :class:`DiagnosticsOperations` + * 2016-03-01: :class:`DiagnosticsOperations` + * 2018-02-01: :class:`DiagnosticsOperations` + * 2022-09-01: :class:`DiagnosticsOperations` + * 2023-01-01: :class:`DiagnosticsOperations` + * 2024-04-01: :class:`DiagnosticsOperations` """ - api_version = self._get_api_version('diagnostics') - if api_version == '2016-03-01': + api_version = self._get_api_version("diagnostics") + if api_version == "2016-03-01": from .v2016_03_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import DiagnosticsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import DiagnosticsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import DiagnosticsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'diagnostics'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def domain_registration_provider(self): """Instance depends on the API version: - * 2015-04-01: :class:`DomainRegistrationProviderOperations` - * 2018-02-01: :class:`DomainRegistrationProviderOperations` - * 2019-08-01: :class:`DomainRegistrationProviderOperations` - * 2020-06-01: :class:`DomainRegistrationProviderOperations` - * 2020-09-01: :class:`DomainRegistrationProviderOperations` - * 2020-12-01: :class:`DomainRegistrationProviderOperations` - * 2021-01-01: :class:`DomainRegistrationProviderOperations` - * 2021-01-15: :class:`DomainRegistrationProviderOperations` - * 2021-03-01: :class:`DomainRegistrationProviderOperations` - * 2022-09-01: :class:`DomainRegistrationProviderOperations` - * 2023-01-01: :class:`DomainRegistrationProviderOperations` - * 2023-12-01: :class:`DomainRegistrationProviderOperations` - * 2024-04-01: :class:`DomainRegistrationProviderOperations` + * 2018-02-01: :class:`DomainRegistrationProviderOperations` + * 2022-09-01: :class:`DomainRegistrationProviderOperations` + * 2023-01-01: :class:`DomainRegistrationProviderOperations` + * 2024-04-01: :class:`DomainRegistrationProviderOperations` """ - api_version = self._get_api_version('domain_registration_provider') - if api_version == '2015-04-01': - from .v2015_04_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("domain_registration_provider") + if api_version == "2018-02-01": from .v2018_02_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import DomainRegistrationProviderOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'domain_registration_provider'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'domain_registration_provider'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def domains(self): """Instance depends on the API version: - * 2015-04-01: :class:`DomainsOperations` - * 2018-02-01: :class:`DomainsOperations` - * 2019-08-01: :class:`DomainsOperations` - * 2020-06-01: :class:`DomainsOperations` - * 2020-09-01: :class:`DomainsOperations` - * 2020-12-01: :class:`DomainsOperations` - * 2021-01-01: :class:`DomainsOperations` - * 2021-01-15: :class:`DomainsOperations` - * 2021-03-01: :class:`DomainsOperations` - * 2022-09-01: :class:`DomainsOperations` - * 2023-01-01: :class:`DomainsOperations` - * 2023-12-01: :class:`DomainsOperations` - * 2024-04-01: :class:`DomainsOperations` + * 2018-02-01: :class:`DomainsOperations` + * 2022-09-01: :class:`DomainsOperations` + * 2023-01-01: :class:`DomainsOperations` + * 2024-04-01: :class:`DomainsOperations` """ - api_version = self._get_api_version('domains') - if api_version == '2015-04-01': - from .v2015_04_01.operations import DomainsOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("domains") + if api_version == "2018-02-01": from .v2018_02_01.operations import DomainsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import DomainsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import DomainsOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import DomainsOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import DomainsOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import DomainsOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import DomainsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import DomainsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import DomainsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import DomainsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import DomainsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import DomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domains'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def get_usages_in_location(self): """Instance depends on the API version: - * 2023-01-01: :class:`GetUsagesInLocationOperations` - * 2023-12-01: :class:`GetUsagesInLocationOperations` - * 2024-04-01: :class:`GetUsagesInLocationOperations` + * 2023-01-01: :class:`GetUsagesInLocationOperations` + * 2024-04-01: :class:`GetUsagesInLocationOperations` """ - api_version = self._get_api_version('get_usages_in_location') - if api_version == '2023-01-01': + api_version = self._get_api_version("get_usages_in_location") + if api_version == "2023-01-01": from .v2023_01_01.operations import GetUsagesInLocationOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import GetUsagesInLocationOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import GetUsagesInLocationOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'get_usages_in_location'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'get_usages_in_location'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def global_operations(self): """Instance depends on the API version: - * 2020-12-01: :class:`GlobalOperations` - * 2021-01-01: :class:`GlobalOperations` - * 2021-01-15: :class:`GlobalOperations` - * 2021-03-01: :class:`GlobalOperations` - * 2022-09-01: :class:`GlobalOperations` - * 2023-01-01: :class:`GlobalOperations` - * 2023-12-01: :class:`GlobalOperations` - * 2024-04-01: :class:`GlobalOperations` + * 2022-09-01: :class:`GlobalOperations` + * 2023-01-01: :class:`GlobalOperations` + * 2024-04-01: :class:`GlobalOperations` """ - api_version = self._get_api_version('global_operations') - if api_version == '2020-12-01': - from .v2020_12_01.operations import GlobalOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import GlobalOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import GlobalOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import GlobalOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("global_operations") + if api_version == "2022-09-01": from .v2022_09_01.operations import GlobalOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import GlobalOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import GlobalOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import GlobalOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'global_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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def kube_environments(self): """Instance depends on the API version: - * 2021-01-01: :class:`KubeEnvironmentsOperations` - * 2021-01-15: :class:`KubeEnvironmentsOperations` - * 2021-03-01: :class:`KubeEnvironmentsOperations` - * 2022-09-01: :class:`KubeEnvironmentsOperations` - * 2023-01-01: :class:`KubeEnvironmentsOperations` - * 2023-12-01: :class:`KubeEnvironmentsOperations` - * 2024-04-01: :class:`KubeEnvironmentsOperations` + * 2022-09-01: :class:`KubeEnvironmentsOperations` + * 2023-01-01: :class:`KubeEnvironmentsOperations` + * 2024-04-01: :class:`KubeEnvironmentsOperations` """ - api_version = self._get_api_version('kube_environments') - if api_version == '2021-01-01': - from .v2021_01_01.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("kube_environments") + if api_version == "2022-09-01": from .v2022_09_01.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import KubeEnvironmentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'kube_environments'".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)), 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(self): """Instance depends on the API version: - * 2016-03-01: :class:`ProviderOperations` - * 2018-02-01: :class:`ProviderOperations` - * 2019-08-01: :class:`ProviderOperations` - * 2020-06-01: :class:`ProviderOperations` - * 2020-09-01: :class:`ProviderOperations` - * 2020-12-01: :class:`ProviderOperations` - * 2021-01-01: :class:`ProviderOperations` - * 2021-01-15: :class:`ProviderOperations` - * 2021-03-01: :class:`ProviderOperations` - * 2022-09-01: :class:`ProviderOperations` - * 2023-01-01: :class:`ProviderOperations` - * 2023-12-01: :class:`ProviderOperations` - * 2024-04-01: :class:`ProviderOperations` + * 2016-03-01: :class:`ProviderOperations` + * 2018-02-01: :class:`ProviderOperations` + * 2022-09-01: :class:`ProviderOperations` + * 2023-01-01: :class:`ProviderOperations` + * 2024-04-01: :class:`ProviderOperations` """ - api_version = self._get_api_version('provider') - if api_version == '2016-03-01': + api_version = self._get_api_version("provider") + if api_version == "2016-03-01": from .v2016_03_01.operations import ProviderOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import ProviderOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ProviderOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ProviderOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import ProviderOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import ProviderOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import ProviderOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import ProviderOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ProviderOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import ProviderOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import ProviderOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import ProviderOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import ProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'provider'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def recommendations(self): """Instance depends on the API version: - * 2016-03-01: :class:`RecommendationsOperations` - * 2018-02-01: :class:`RecommendationsOperations` - * 2019-08-01: :class:`RecommendationsOperations` - * 2020-06-01: :class:`RecommendationsOperations` - * 2020-09-01: :class:`RecommendationsOperations` - * 2020-12-01: :class:`RecommendationsOperations` - * 2021-01-01: :class:`RecommendationsOperations` - * 2021-01-15: :class:`RecommendationsOperations` - * 2021-03-01: :class:`RecommendationsOperations` - * 2022-09-01: :class:`RecommendationsOperations` - * 2023-01-01: :class:`RecommendationsOperations` - * 2023-12-01: :class:`RecommendationsOperations` - * 2024-04-01: :class:`RecommendationsOperations` + * 2016-03-01: :class:`RecommendationsOperations` + * 2018-02-01: :class:`RecommendationsOperations` + * 2022-09-01: :class:`RecommendationsOperations` + * 2023-01-01: :class:`RecommendationsOperations` + * 2024-04-01: :class:`RecommendationsOperations` """ - api_version = self._get_api_version('recommendations') - if api_version == '2016-03-01': + api_version = self._get_api_version("recommendations") + if api_version == "2016-03-01": from .v2016_03_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import RecommendationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import RecommendationsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import RecommendationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'recommendations'".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)), 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_health_metadata(self): """Instance depends on the API version: - * 2016-03-01: :class:`ResourceHealthMetadataOperations` - * 2018-02-01: :class:`ResourceHealthMetadataOperations` - * 2019-08-01: :class:`ResourceHealthMetadataOperations` - * 2020-06-01: :class:`ResourceHealthMetadataOperations` - * 2020-09-01: :class:`ResourceHealthMetadataOperations` - * 2020-12-01: :class:`ResourceHealthMetadataOperations` - * 2021-01-01: :class:`ResourceHealthMetadataOperations` - * 2021-01-15: :class:`ResourceHealthMetadataOperations` - * 2021-03-01: :class:`ResourceHealthMetadataOperations` - * 2022-09-01: :class:`ResourceHealthMetadataOperations` - * 2023-01-01: :class:`ResourceHealthMetadataOperations` - * 2023-12-01: :class:`ResourceHealthMetadataOperations` - * 2024-04-01: :class:`ResourceHealthMetadataOperations` + * 2016-03-01: :class:`ResourceHealthMetadataOperations` + * 2018-02-01: :class:`ResourceHealthMetadataOperations` + * 2022-09-01: :class:`ResourceHealthMetadataOperations` + * 2023-01-01: :class:`ResourceHealthMetadataOperations` + * 2024-04-01: :class:`ResourceHealthMetadataOperations` """ - api_version = self._get_api_version('resource_health_metadata') - if api_version == '2016-03-01': + api_version = self._get_api_version("resource_health_metadata") + if api_version == "2016-03-01": from .v2016_03_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from .v2018_02_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import ResourceHealthMetadataOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'resource_health_metadata'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'resource_health_metadata'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def static_sites(self): """Instance depends on the API version: - * 2019-08-01: :class:`StaticSitesOperations` - * 2020-06-01: :class:`StaticSitesOperations` - * 2020-09-01: :class:`StaticSitesOperations` - * 2020-12-01: :class:`StaticSitesOperations` - * 2021-01-01: :class:`StaticSitesOperations` - * 2021-01-15: :class:`StaticSitesOperations` - * 2021-03-01: :class:`StaticSitesOperations` - * 2022-09-01: :class:`StaticSitesOperations` - * 2023-01-01: :class:`StaticSitesOperations` - * 2023-12-01: :class:`StaticSitesOperations` - * 2024-04-01: :class:`StaticSitesOperations` + * 2022-09-01: :class:`StaticSitesOperations` + * 2023-01-01: :class:`StaticSitesOperations` + * 2024-04-01: :class:`StaticSitesOperations` """ - api_version = self._get_api_version('static_sites') - if api_version == '2019-08-01': - from .v2019_08_01.operations import StaticSitesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import StaticSitesOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import StaticSitesOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import StaticSitesOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import StaticSitesOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import StaticSitesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import StaticSitesOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("static_sites") + if api_version == "2022-09-01": from .v2022_09_01.operations import StaticSitesOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import StaticSitesOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import StaticSitesOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import StaticSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'static_sites'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def top_level_domains(self): """Instance depends on the API version: - * 2015-04-01: :class:`TopLevelDomainsOperations` - * 2018-02-01: :class:`TopLevelDomainsOperations` - * 2019-08-01: :class:`TopLevelDomainsOperations` - * 2020-06-01: :class:`TopLevelDomainsOperations` - * 2020-09-01: :class:`TopLevelDomainsOperations` - * 2020-12-01: :class:`TopLevelDomainsOperations` - * 2021-01-01: :class:`TopLevelDomainsOperations` - * 2021-01-15: :class:`TopLevelDomainsOperations` - * 2021-03-01: :class:`TopLevelDomainsOperations` - * 2022-09-01: :class:`TopLevelDomainsOperations` - * 2023-01-01: :class:`TopLevelDomainsOperations` - * 2023-12-01: :class:`TopLevelDomainsOperations` - * 2024-04-01: :class:`TopLevelDomainsOperations` + * 2018-02-01: :class:`TopLevelDomainsOperations` + * 2022-09-01: :class:`TopLevelDomainsOperations` + * 2023-01-01: :class:`TopLevelDomainsOperations` + * 2024-04-01: :class:`TopLevelDomainsOperations` """ - api_version = self._get_api_version('top_level_domains') - if api_version == '2015-04-01': - from .v2015_04_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("top_level_domains") + if api_version == "2018-02-01": from .v2018_02_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import TopLevelDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'top_level_domains'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def web_apps(self): """Instance depends on the API version: - * 2016-08-01: :class:`WebAppsOperations` - * 2018-02-01: :class:`WebAppsOperations` - * 2019-08-01: :class:`WebAppsOperations` - * 2020-06-01: :class:`WebAppsOperations` - * 2020-09-01: :class:`WebAppsOperations` - * 2020-12-01: :class:`WebAppsOperations` - * 2021-01-01: :class:`WebAppsOperations` - * 2021-01-15: :class:`WebAppsOperations` - * 2021-03-01: :class:`WebAppsOperations` - * 2022-09-01: :class:`WebAppsOperations` - * 2023-01-01: :class:`WebAppsOperations` - * 2023-12-01: :class:`WebAppsOperations` - * 2024-04-01: :class:`WebAppsOperations` + * 2018-02-01: :class:`WebAppsOperations` + * 2022-09-01: :class:`WebAppsOperations` + * 2023-01-01: :class:`WebAppsOperations` + * 2024-04-01: :class:`WebAppsOperations` """ - api_version = self._get_api_version('web_apps') - if api_version == '2016-08-01': - from .v2016_08_01.operations import WebAppsOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("web_apps") + if api_version == "2018-02-01": from .v2018_02_01.operations import WebAppsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebAppsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebAppsOperations as OperationClass - elif api_version == '2020-09-01': - from .v2020_09_01.operations import WebAppsOperations as OperationClass - elif api_version == '2020-12-01': - from .v2020_12_01.operations import WebAppsOperations as OperationClass - elif api_version == '2021-01-01': - from .v2021_01_01.operations import WebAppsOperations as OperationClass - elif api_version == '2021-01-15': - from .v2021_01_15.operations import WebAppsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebAppsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from .v2022_09_01.operations import WebAppsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WebAppsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WebAppsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'web_apps'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_run_action_repetitions(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunActionRepetitionsOperations` - * 2023-01-01: :class:`WorkflowRunActionRepetitionsOperations` - * 2023-12-01: :class:`WorkflowRunActionRepetitionsOperations` - * 2024-04-01: :class:`WorkflowRunActionRepetitionsOperations` + * 2022-09-01: :class:`WorkflowRunActionRepetitionsOperations` + * 2023-01-01: :class:`WorkflowRunActionRepetitionsOperations` + * 2024-04-01: :class:`WorkflowRunActionRepetitionsOperations` """ - api_version = self._get_api_version('workflow_run_action_repetitions') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_run_action_repetitions") + if api_version == "2022-09-01": from .v2022_09_01.operations import WorkflowRunActionRepetitionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WorkflowRunActionRepetitionsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WorkflowRunActionRepetitionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WorkflowRunActionRepetitionsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'workflow_run_action_repetitions'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'workflow_run_action_repetitions'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_run_action_repetitions_request_histories(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` - * 2023-01-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` - * 2023-12-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` - * 2024-04-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` + * 2022-09-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` + * 2023-01-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` + * 2024-04-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` """ - api_version = self._get_api_version('workflow_run_action_repetitions_request_histories') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_run_action_repetitions_request_histories") + if api_version == "2022-09-01": from .v2022_09_01.operations import WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'workflow_run_action_repetitions_request_histories'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'workflow_run_action_repetitions_request_histories'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_run_action_scope_repetitions(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunActionScopeRepetitionsOperations` - * 2023-01-01: :class:`WorkflowRunActionScopeRepetitionsOperations` - * 2023-12-01: :class:`WorkflowRunActionScopeRepetitionsOperations` - * 2024-04-01: :class:`WorkflowRunActionScopeRepetitionsOperations` + * 2022-09-01: :class:`WorkflowRunActionScopeRepetitionsOperations` + * 2023-01-01: :class:`WorkflowRunActionScopeRepetitionsOperations` + * 2024-04-01: :class:`WorkflowRunActionScopeRepetitionsOperations` """ - api_version = self._get_api_version('workflow_run_action_scope_repetitions') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_run_action_scope_repetitions") + if api_version == "2022-09-01": from .v2022_09_01.operations import WorkflowRunActionScopeRepetitionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WorkflowRunActionScopeRepetitionsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WorkflowRunActionScopeRepetitionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WorkflowRunActionScopeRepetitionsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'workflow_run_action_scope_repetitions'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'workflow_run_action_scope_repetitions'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_run_actions(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunActionsOperations` - * 2023-01-01: :class:`WorkflowRunActionsOperations` - * 2023-12-01: :class:`WorkflowRunActionsOperations` - * 2024-04-01: :class:`WorkflowRunActionsOperations` + * 2022-09-01: :class:`WorkflowRunActionsOperations` + * 2023-01-01: :class:`WorkflowRunActionsOperations` + * 2024-04-01: :class:`WorkflowRunActionsOperations` """ - api_version = self._get_api_version('workflow_run_actions') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_run_actions") + if api_version == "2022-09-01": from .v2022_09_01.operations import WorkflowRunActionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WorkflowRunActionsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WorkflowRunActionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WorkflowRunActionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflow_run_actions'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_runs(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunsOperations` - * 2023-01-01: :class:`WorkflowRunsOperations` - * 2023-12-01: :class:`WorkflowRunsOperations` - * 2024-04-01: :class:`WorkflowRunsOperations` + * 2022-09-01: :class:`WorkflowRunsOperations` + * 2023-01-01: :class:`WorkflowRunsOperations` + * 2024-04-01: :class:`WorkflowRunsOperations` """ - api_version = self._get_api_version('workflow_runs') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_runs") + if api_version == "2022-09-01": from .v2022_09_01.operations import WorkflowRunsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WorkflowRunsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WorkflowRunsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WorkflowRunsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflow_runs'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_trigger_histories(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowTriggerHistoriesOperations` - * 2023-01-01: :class:`WorkflowTriggerHistoriesOperations` - * 2023-12-01: :class:`WorkflowTriggerHistoriesOperations` - * 2024-04-01: :class:`WorkflowTriggerHistoriesOperations` + * 2022-09-01: :class:`WorkflowTriggerHistoriesOperations` + * 2023-01-01: :class:`WorkflowTriggerHistoriesOperations` + * 2024-04-01: :class:`WorkflowTriggerHistoriesOperations` """ - api_version = self._get_api_version('workflow_trigger_histories') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_trigger_histories") + if api_version == "2022-09-01": from .v2022_09_01.operations import WorkflowTriggerHistoriesOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WorkflowTriggerHistoriesOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WorkflowTriggerHistoriesOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WorkflowTriggerHistoriesOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'workflow_trigger_histories'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'workflow_trigger_histories'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_triggers(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowTriggersOperations` - * 2023-01-01: :class:`WorkflowTriggersOperations` - * 2023-12-01: :class:`WorkflowTriggersOperations` - * 2024-04-01: :class:`WorkflowTriggersOperations` + * 2022-09-01: :class:`WorkflowTriggersOperations` + * 2023-01-01: :class:`WorkflowTriggersOperations` + * 2024-04-01: :class:`WorkflowTriggersOperations` """ - api_version = self._get_api_version('workflow_triggers') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_triggers") + if api_version == "2022-09-01": from .v2022_09_01.operations import WorkflowTriggersOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WorkflowTriggersOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WorkflowTriggersOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WorkflowTriggersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflow_triggers'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_versions(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowVersionsOperations` - * 2023-01-01: :class:`WorkflowVersionsOperations` - * 2023-12-01: :class:`WorkflowVersionsOperations` - * 2024-04-01: :class:`WorkflowVersionsOperations` + * 2022-09-01: :class:`WorkflowVersionsOperations` + * 2023-01-01: :class:`WorkflowVersionsOperations` + * 2024-04-01: :class:`WorkflowVersionsOperations` """ - api_version = self._get_api_version('workflow_versions') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_versions") + if api_version == "2022-09-01": from .v2022_09_01.operations import WorkflowVersionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WorkflowVersionsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WorkflowVersionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WorkflowVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflow_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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflows(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowsOperations` - * 2023-01-01: :class:`WorkflowsOperations` - * 2023-12-01: :class:`WorkflowsOperations` - * 2024-04-01: :class:`WorkflowsOperations` + * 2022-09-01: :class:`WorkflowsOperations` + * 2023-01-01: :class:`WorkflowsOperations` + * 2024-04-01: :class:`WorkflowsOperations` """ - api_version = self._get_api_version('workflows') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflows") + if api_version == "2022-09-01": from .v2022_09_01.operations import WorkflowsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from .v2023_01_01.operations import WorkflowsOperations as OperationClass - elif api_version == '2023-12-01': - from .v2023_12_01.operations import WorkflowsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from .v2024_04_01.operations import WorkflowsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflows'".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)), 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() + def __enter__(self): self._client.__enter__() return self + def __exit__(self, *exc_details): self._client.__exit__(*exc_details) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/__init__.py index fc106a4f3d78..69d2fd6fad25 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/__init__.py @@ -7,4 +7,5 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -__all__ = ['WebSiteManagementClient'] + +__all__ = ["WebSiteManagementClient"] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_configuration.py index 1607b11f8966..40e8a9ad2994 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_configuration.py @@ -19,6 +19,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class WebSiteManagementClientConfiguration: """Configuration for WebSiteManagementClient. @@ -31,12 +32,7 @@ class WebSiteManagementClientConfiguration: :type subscription_id: str """ - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -44,23 +40,22 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-web/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "azure-mgmt-web/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py index b6aea57949f1..9654539b57b5 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py @@ -21,7 +21,7 @@ from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object class WebSiteManagementClientOperationsMixin(object): @@ -56,32 +56,16 @@ async def check_name_availability( :rtype: ~azure.mgmt.web.v2024_04_01.models.ResourceNameAvailability :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('check_name_availability') - if api_version == '2016-03-01': + api_version = self._get_api_version("check_name_availability") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'check_name_availability'".format(api_version)) @@ -94,10 +78,7 @@ async def check_name_availability( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return await mixin_instance.check_name_availability(name, type, is_fqdn, environment_id, **kwargs) - async def get_publishing_user( - self, - **kwargs: Any - ) -> _models.User: + async def get_publishing_user(self, **kwargs: Any) -> _models.User: """Gets publishing user. Description for Gets publishing user. @@ -106,32 +87,16 @@ async def get_publishing_user( :rtype: ~azure.mgmt.web.v2024_04_01.models.User :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('get_publishing_user') - if api_version == '2016-03-01': + api_version = self._get_api_version("get_publishing_user") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_publishing_user'".format(api_version)) @@ -144,11 +109,7 @@ async def get_publishing_user( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return await mixin_instance.get_publishing_user(**kwargs) - async def get_source_control( - self, - source_control_type: str, - **kwargs: Any - ) -> _models.SourceControl: + async def get_source_control(self, source_control_type: str, **kwargs: Any) -> _models.SourceControl: """Gets source control token. Description for Gets source control token. @@ -159,32 +120,16 @@ async def get_source_control( :rtype: ~azure.mgmt.web.v2024_04_01.models.SourceControl :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('get_source_control') - if api_version == '2016-03-01': + api_version = self._get_api_version("get_source_control") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_source_control'".format(api_version)) @@ -197,10 +142,7 @@ async def get_source_control( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return await mixin_instance.get_source_control(source_control_type, **kwargs) - async def get_subscription_deployment_locations( - self, - **kwargs: Any - ) -> _models.DeploymentLocations: + async def get_subscription_deployment_locations(self, **kwargs: Any) -> _models.DeploymentLocations: """Gets list of available geo regions plus ministamps. Description for Gets list of available geo regions plus ministamps. @@ -209,35 +151,21 @@ async def get_subscription_deployment_locations( :rtype: ~azure.mgmt.web.v2024_04_01.models.DeploymentLocations :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('get_subscription_deployment_locations') - if api_version == '2016-03-01': + api_version = self._get_api_version("get_subscription_deployment_locations") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: - raise ValueError("API version {} does not have operation 'get_subscription_deployment_locations'".format(api_version)) + raise ValueError( + "API version {} does not have operation 'get_subscription_deployment_locations'".format(api_version) + ) mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config @@ -247,10 +175,7 @@ async def get_subscription_deployment_locations( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return await mixin_instance.get_subscription_deployment_locations(**kwargs) - def list_ase_regions( - self, - **kwargs: Any - ) -> AsyncIterable["_models.AseRegion"]: + def list_ase_regions(self, **kwargs: Any) -> AsyncIterable["_models.AseRegion"]: """Get a list of available ASE regions and its supported Skus. Description for get a list of available ASE regions and its supported Skus. @@ -259,12 +184,10 @@ def list_ase_regions( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2024_04_01.models.AseRegion] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_ase_regions') - if api_version == '2023-01-01': + api_version = self._get_api_version("list_ase_regions") + if api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_ase_regions'".format(api_version)) @@ -278,10 +201,7 @@ def list_ase_regions( return mixin_instance.list_ase_regions(**kwargs) def list_billing_meters( - self, - billing_location: Optional[str] = None, - os_type: Optional[str] = None, - **kwargs: Any + self, billing_location: Optional[str] = None, os_type: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.BillingMeter"]: """Gets a list of meters for a given location. @@ -296,30 +216,14 @@ def list_billing_meters( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2024_04_01.models.BillingMeter] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_billing_meters') - if api_version == '2018-02-01': + api_version = self._get_api_version("list_billing_meters") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_billing_meters'".format(api_version)) @@ -333,9 +237,7 @@ def list_billing_meters( return mixin_instance.list_billing_meters(billing_location, os_type, **kwargs) def list_custom_host_name_sites( - self, - hostname: Optional[str] = None, - **kwargs: Any + self, hostname: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.CustomHostnameSites"]: """Get custom hostnames under this subscription. @@ -348,16 +250,12 @@ def list_custom_host_name_sites( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2024_04_01.models.CustomHostnameSites] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_custom_host_name_sites') - if api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("list_custom_host_name_sites") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_custom_host_name_sites'".format(api_version)) @@ -400,32 +298,16 @@ def list_geo_regions( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2024_04_01.models.GeoRegion] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_geo_regions') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_geo_regions") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_geo_regions'".format(api_version)) @@ -436,12 +318,11 @@ def list_geo_regions( mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_geo_regions(sku, linux_workers_enabled, xenon_workers_enabled, linux_dynamic_workers_enabled, **kwargs) + return mixin_instance.list_geo_regions( + sku, linux_workers_enabled, xenon_workers_enabled, linux_dynamic_workers_enabled, **kwargs + ) - def list_premier_add_on_offers( - self, - **kwargs: Any - ) -> AsyncIterable["_models.PremierAddOnOffer"]: + def list_premier_add_on_offers(self, **kwargs: Any) -> AsyncIterable["_models.PremierAddOnOffer"]: """List all premier add-on offers. Description for List all premier add-on offers. @@ -451,32 +332,16 @@ def list_premier_add_on_offers( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2024_04_01.models.PremierAddOnOffer] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_premier_add_on_offers') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_premier_add_on_offers") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_premier_add_on_offers'".format(api_version)) @@ -490,9 +355,7 @@ def list_premier_add_on_offers( return mixin_instance.list_premier_add_on_offers(**kwargs) def list_site_identifiers_assigned_to_host_name( # pylint: disable=name-too-long - self, - name_identifier: Union[_models.NameIdentifier, IO[bytes]], - **kwargs: Any + self, name_identifier: Union[_models.NameIdentifier, IO[bytes]], **kwargs: Any ) -> AsyncIterable["_models.Identifier"]: """List all apps that are assigned to a hostname. @@ -505,35 +368,23 @@ def list_site_identifiers_assigned_to_host_name( # pylint: disable=name-too-lon :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2024_04_01.models.Identifier] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_site_identifiers_assigned_to_host_name') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_site_identifiers_assigned_to_host_name") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: - raise ValueError("API version {} does not have operation 'list_site_identifiers_assigned_to_host_name'".format(api_version)) + raise ValueError( + "API version {} does not have operation 'list_site_identifiers_assigned_to_host_name'".format( + api_version + ) + ) mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config @@ -543,10 +394,7 @@ def list_site_identifiers_assigned_to_host_name( # pylint: disable=name-too-lon mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.list_site_identifiers_assigned_to_host_name(name_identifier, **kwargs) - async def list_skus( - self, - **kwargs: Any - ) -> _models.SkuInfos: + async def list_skus(self, **kwargs: Any) -> _models.SkuInfos: """List all SKUs. Description for List all SKUs. @@ -555,32 +403,16 @@ async def list_skus( :rtype: ~azure.mgmt.web.v2024_04_01.models.SkuInfos :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_skus') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_skus") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_skus'".format(api_version)) @@ -593,10 +425,7 @@ async def list_skus( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return await mixin_instance.list_skus(**kwargs) - def list_source_controls( - self, - **kwargs: Any - ) -> AsyncIterable["_models.SourceControl"]: + def list_source_controls(self, **kwargs: Any) -> AsyncIterable["_models.SourceControl"]: """Gets the source controls available for Azure websites. Description for Gets the source controls available for Azure websites. @@ -606,32 +435,16 @@ def list_source_controls( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2024_04_01.models.SourceControl] :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('list_source_controls') - if api_version == '2016-03-01': + api_version = self._get_api_version("list_source_controls") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_source_controls'".format(api_version)) @@ -664,32 +477,16 @@ async def move( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('move') - if api_version == '2016-03-01': + api_version = self._get_api_version("move") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'move'".format(api_version)) @@ -702,11 +499,7 @@ async def move( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return await mixin_instance.move(resource_group_name, move_resource_envelope, **kwargs) - async def update_publishing_user( - self, - user_details: Union[_models.User, IO[bytes]], - **kwargs: Any - ) -> _models.User: + async def update_publishing_user(self, user_details: Union[_models.User, IO[bytes]], **kwargs: Any) -> _models.User: """Updates publishing user. Description for Updates publishing user. @@ -718,32 +511,16 @@ async def update_publishing_user( :rtype: ~azure.mgmt.web.v2024_04_01.models.User :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('update_publishing_user') - if api_version == '2016-03-01': + api_version = self._get_api_version("update_publishing_user") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_publishing_user'".format(api_version)) @@ -757,10 +534,7 @@ async def update_publishing_user( return await mixin_instance.update_publishing_user(user_details, **kwargs) async def update_source_control( - self, - source_control_type: str, - request_message: Union[_models.SourceControl, IO[bytes]], - **kwargs: Any + self, source_control_type: str, request_message: Union[_models.SourceControl, IO[bytes]], **kwargs: Any ) -> _models.SourceControl: """Updates source control token. @@ -775,32 +549,16 @@ async def update_source_control( :rtype: ~azure.mgmt.web.v2024_04_01.models.SourceControl :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('update_source_control') - if api_version == '2016-03-01': + api_version = self._get_api_version("update_source_control") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_source_control'".format(api_version)) @@ -814,10 +572,7 @@ async def update_source_control( return await mixin_instance.update_source_control(source_control_type, request_message, **kwargs) async def validate( - self, - resource_group_name: str, - validate_request: Union[_models.ValidateRequest, IO[bytes]], - **kwargs: Any + self, resource_group_name: str, validate_request: Union[_models.ValidateRequest, IO[bytes]], **kwargs: Any ) -> _models.ValidateResponse: """Validate if a resource can be created. @@ -832,32 +587,16 @@ async def validate( :rtype: ~azure.mgmt.web.v2024_04_01.models.ValidateResponse :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('validate') - if api_version == '2016-03-01': + api_version = self._get_api_version("validate") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate'".format(api_version)) @@ -890,8 +629,8 @@ async def validate_container_settings( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('validate_container_settings') - if api_version == '2018-02-01': + api_version = self._get_api_version("validate_container_settings") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate_container_settings'".format(api_version)) @@ -902,7 +641,9 @@ async def validate_container_settings( mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.validate_container_settings(resource_group_name, validate_container_settings_request, **kwargs) + return await mixin_instance.validate_container_settings( + resource_group_name, validate_container_settings_request, **kwargs + ) async def validate_move( self, @@ -924,32 +665,16 @@ async def validate_move( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('validate_move') - if api_version == '2016-03-01': + api_version = self._get_api_version("validate_move") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate_move'".format(api_version)) @@ -963,9 +688,7 @@ async def validate_move( return await mixin_instance.validate_move(resource_group_name, move_resource_envelope, **kwargs) async def verify_hosting_environment_vnet( - self, - parameters: Union[_models.VnetParameters, IO[bytes]], - **kwargs: Any + self, parameters: Union[_models.VnetParameters, IO[bytes]], **kwargs: Any ) -> _models.VnetValidationFailureDetails: """Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. @@ -980,35 +703,21 @@ async def verify_hosting_environment_vnet( :rtype: ~azure.mgmt.web.v2024_04_01.models.VnetValidationFailureDetails :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = self._get_api_version('verify_hosting_environment_vnet') - if api_version == '2016-03-01': + api_version = self._get_api_version("verify_hosting_environment_vnet") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: - raise ValueError("API version {} does not have operation 'verify_hosting_environment_vnet'".format(api_version)) + raise ValueError( + "API version {} does not have operation 'verify_hosting_environment_vnet'".format(api_version) + ) mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py index 302cd90e5175..3c9ce7907d27 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py @@ -26,6 +26,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -33,6 +34,7 @@ def __init__(self, *args, **kwargs): """ pass + class WebSiteManagementClient(WebSiteManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): """WebSite Management Client. @@ -57,15 +59,17 @@ class WebSiteManagementClient(WebSiteManagementClientOperationsMixin, MultiApiCl :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2024-04-01' + DEFAULT_API_VERSION = "2024-04-01" _PROFILE_TAG = "azure.mgmt.web.WebSiteManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - 'billing_meters': '2016-03-01', - 'validate_container_settings': '2018-02-01', - }}, - _PROFILE_TAG + " latest" + LATEST_PROFILE = ProfileDefinition( + { + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + "billing_meters": "2016-03-01", + "validate_container_settings": "2018-02-01", + } + }, + _PROFILE_TAG + " latest", ) def __init__( @@ -78,7 +82,7 @@ def __init__( **kwargs: Any ) -> None: if api_version: - kwargs.setdefault('api_version', api_version) + kwargs.setdefault("api_version", api_version) self._config = WebSiteManagementClientConfiguration(credential, subscription_id, **kwargs) _policies = kwargs.pop("policies", None) if _policies is None: @@ -99,10 +103,7 @@ def __init__( self._config.http_logging_policy, ] self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - super(WebSiteManagementClient, self).__init__( - api_version=api_version, - profile=profile - ) + super(WebSiteManagementClient, self).__init__(api_version=api_version, profile=profile) @classmethod def _models_dict(cls, api_version): @@ -112,78 +113,31 @@ def _models_dict(cls, api_version): def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: - * 2015-04-01: :mod:`v2015_04_01.models` - * 2015-08-01: :mod:`v2015_08_01.models` - * 2016-03-01: :mod:`v2016_03_01.models` - * 2016-08-01: :mod:`v2016_08_01.models` - * 2016-09-01: :mod:`v2016_09_01.models` - * 2018-02-01: :mod:`v2018_02_01.models` - * 2018-11-01: :mod:`v2018_11_01.models` - * 2019-08-01: :mod:`v2019_08_01.models` - * 2020-06-01: :mod:`v2020_06_01.models` - * 2020-09-01: :mod:`v2020_09_01.models` - * 2020-12-01: :mod:`v2020_12_01.models` - * 2021-01-01: :mod:`v2021_01_01.models` - * 2021-01-15: :mod:`v2021_01_15.models` - * 2021-03-01: :mod:`v2021_03_01.models` - * 2022-09-01: :mod:`v2022_09_01.models` - * 2023-01-01: :mod:`v2023_01_01.models` - * 2023-12-01: :mod:`v2023_12_01.models` - * 2024-04-01: :mod:`v2024_04_01.models` + * 2016-03-01: :mod:`v2016_03_01.models` + * 2018-02-01: :mod:`v2018_02_01.models` + * 2022-09-01: :mod:`v2022_09_01.models` + * 2023-01-01: :mod:`v2023_01_01.models` + * 2024-04-01: :mod:`v2024_04_01.models` """ - if api_version == '2015-04-01': - from ..v2015_04_01 import models - return models - elif api_version == '2015-08-01': - from ..v2015_08_01 import models - return models - elif api_version == '2016-03-01': + if api_version == "2016-03-01": from ..v2016_03_01 import models + return models - elif api_version == '2016-08-01': - from ..v2016_08_01 import models - return models - elif api_version == '2016-09-01': - from ..v2016_09_01 import models - return models - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01 import models + return models - elif api_version == '2018-11-01': - from ..v2018_11_01 import models - return models - elif api_version == '2019-08-01': - from ..v2019_08_01 import models - return models - elif api_version == '2020-06-01': - from ..v2020_06_01 import models - return models - elif api_version == '2020-09-01': - from ..v2020_09_01 import models - return models - elif api_version == '2020-12-01': - from ..v2020_12_01 import models - return models - elif api_version == '2021-01-01': - from ..v2021_01_01 import models - return models - elif api_version == '2021-01-15': - from ..v2021_01_15 import models - return models - elif api_version == '2021-03-01': - from ..v2021_03_01 import models - return models - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01 import models + return models - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01 import models + return models - elif api_version == '2023-12-01': - from ..v2023_12_01 import models - return models - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @@ -191,1148 +145,899 @@ def models(cls, api_version=DEFAULT_API_VERSION): def app_service_certificate_orders(self): """Instance depends on the API version: - * 2015-08-01: :class:`AppServiceCertificateOrdersOperations` - * 2018-02-01: :class:`AppServiceCertificateOrdersOperations` - * 2019-08-01: :class:`AppServiceCertificateOrdersOperations` - * 2020-06-01: :class:`AppServiceCertificateOrdersOperations` - * 2020-09-01: :class:`AppServiceCertificateOrdersOperations` - * 2020-12-01: :class:`AppServiceCertificateOrdersOperations` - * 2021-01-01: :class:`AppServiceCertificateOrdersOperations` - * 2021-01-15: :class:`AppServiceCertificateOrdersOperations` - * 2021-03-01: :class:`AppServiceCertificateOrdersOperations` - * 2022-09-01: :class:`AppServiceCertificateOrdersOperations` - * 2023-01-01: :class:`AppServiceCertificateOrdersOperations` - * 2023-12-01: :class:`AppServiceCertificateOrdersOperations` - * 2024-04-01: :class:`AppServiceCertificateOrdersOperations` + * 2018-02-01: :class:`AppServiceCertificateOrdersOperations` + * 2022-09-01: :class:`AppServiceCertificateOrdersOperations` + * 2023-01-01: :class:`AppServiceCertificateOrdersOperations` + * 2024-04-01: :class:`AppServiceCertificateOrdersOperations` """ - api_version = self._get_api_version('app_service_certificate_orders') - if api_version == '2015-08-01': - from ..v2015_08_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("app_service_certificate_orders") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'app_service_certificate_orders'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'app_service_certificate_orders'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def app_service_environments(self): """Instance depends on the API version: - * 2016-09-01: :class:`AppServiceEnvironmentsOperations` - * 2018-02-01: :class:`AppServiceEnvironmentsOperations` - * 2019-08-01: :class:`AppServiceEnvironmentsOperations` - * 2020-06-01: :class:`AppServiceEnvironmentsOperations` - * 2020-09-01: :class:`AppServiceEnvironmentsOperations` - * 2020-12-01: :class:`AppServiceEnvironmentsOperations` - * 2021-01-01: :class:`AppServiceEnvironmentsOperations` - * 2021-01-15: :class:`AppServiceEnvironmentsOperations` - * 2021-03-01: :class:`AppServiceEnvironmentsOperations` - * 2022-09-01: :class:`AppServiceEnvironmentsOperations` - * 2023-01-01: :class:`AppServiceEnvironmentsOperations` - * 2023-12-01: :class:`AppServiceEnvironmentsOperations` - * 2024-04-01: :class:`AppServiceEnvironmentsOperations` + * 2018-02-01: :class:`AppServiceEnvironmentsOperations` + * 2022-09-01: :class:`AppServiceEnvironmentsOperations` + * 2023-01-01: :class:`AppServiceEnvironmentsOperations` + * 2024-04-01: :class:`AppServiceEnvironmentsOperations` """ - api_version = self._get_api_version('app_service_environments') - if api_version == '2016-09-01': - from ..v2016_09_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("app_service_environments") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'app_service_environments'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'app_service_environments'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def app_service_plans(self): """Instance depends on the API version: - * 2016-09-01: :class:`AppServicePlansOperations` - * 2018-02-01: :class:`AppServicePlansOperations` - * 2019-08-01: :class:`AppServicePlansOperations` - * 2020-06-01: :class:`AppServicePlansOperations` - * 2020-09-01: :class:`AppServicePlansOperations` - * 2020-12-01: :class:`AppServicePlansOperations` - * 2021-01-01: :class:`AppServicePlansOperations` - * 2021-01-15: :class:`AppServicePlansOperations` - * 2021-03-01: :class:`AppServicePlansOperations` - * 2022-09-01: :class:`AppServicePlansOperations` - * 2023-01-01: :class:`AppServicePlansOperations` - * 2023-12-01: :class:`AppServicePlansOperations` - * 2024-04-01: :class:`AppServicePlansOperations` + * 2018-02-01: :class:`AppServicePlansOperations` + * 2022-09-01: :class:`AppServicePlansOperations` + * 2023-01-01: :class:`AppServicePlansOperations` + * 2024-04-01: :class:`AppServicePlansOperations` """ - api_version = self._get_api_version('app_service_plans') - if api_version == '2016-09-01': - from ..v2016_09_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("app_service_plans") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import AppServicePlansOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import AppServicePlansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_plans'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def billing_meters(self): """Instance depends on the API version: - * 2016-03-01: :class:`BillingMetersOperations` + * 2016-03-01: :class:`BillingMetersOperations` """ - api_version = self._get_api_version('billing_meters') - if api_version == '2016-03-01': + api_version = self._get_api_version("billing_meters") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import BillingMetersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'billing_meters'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def certificate_orders_diagnostics(self): """Instance depends on the API version: - * 2020-12-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2021-01-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2021-01-15: :class:`CertificateOrdersDiagnosticsOperations` - * 2021-03-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2022-09-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2023-01-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2023-12-01: :class:`CertificateOrdersDiagnosticsOperations` - * 2024-04-01: :class:`CertificateOrdersDiagnosticsOperations` + * 2022-09-01: :class:`CertificateOrdersDiagnosticsOperations` + * 2023-01-01: :class:`CertificateOrdersDiagnosticsOperations` + * 2024-04-01: :class:`CertificateOrdersDiagnosticsOperations` """ - api_version = self._get_api_version('certificate_orders_diagnostics') - if api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("certificate_orders_diagnostics") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'certificate_orders_diagnostics'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'certificate_orders_diagnostics'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def certificate_registration_provider(self): """Instance depends on the API version: - * 2015-08-01: :class:`CertificateRegistrationProviderOperations` - * 2018-02-01: :class:`CertificateRegistrationProviderOperations` - * 2019-08-01: :class:`CertificateRegistrationProviderOperations` - * 2020-06-01: :class:`CertificateRegistrationProviderOperations` - * 2020-09-01: :class:`CertificateRegistrationProviderOperations` - * 2020-12-01: :class:`CertificateRegistrationProviderOperations` - * 2021-01-01: :class:`CertificateRegistrationProviderOperations` - * 2021-01-15: :class:`CertificateRegistrationProviderOperations` - * 2021-03-01: :class:`CertificateRegistrationProviderOperations` - * 2022-09-01: :class:`CertificateRegistrationProviderOperations` - * 2023-01-01: :class:`CertificateRegistrationProviderOperations` - * 2023-12-01: :class:`CertificateRegistrationProviderOperations` - * 2024-04-01: :class:`CertificateRegistrationProviderOperations` + * 2018-02-01: :class:`CertificateRegistrationProviderOperations` + * 2022-09-01: :class:`CertificateRegistrationProviderOperations` + * 2023-01-01: :class:`CertificateRegistrationProviderOperations` + * 2024-04-01: :class:`CertificateRegistrationProviderOperations` """ - api_version = self._get_api_version('certificate_registration_provider') - if api_version == '2015-08-01': - from ..v2015_08_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("certificate_registration_provider") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'certificate_registration_provider'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'certificate_registration_provider'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def certificates(self): """Instance depends on the API version: - * 2016-03-01: :class:`CertificatesOperations` - * 2018-02-01: :class:`CertificatesOperations` - * 2018-11-01: :class:`CertificatesOperations` - * 2019-08-01: :class:`CertificatesOperations` - * 2020-06-01: :class:`CertificatesOperations` - * 2020-09-01: :class:`CertificatesOperations` - * 2020-12-01: :class:`CertificatesOperations` - * 2021-01-01: :class:`CertificatesOperations` - * 2021-01-15: :class:`CertificatesOperations` - * 2021-03-01: :class:`CertificatesOperations` - * 2022-09-01: :class:`CertificatesOperations` - * 2023-01-01: :class:`CertificatesOperations` - * 2023-12-01: :class:`CertificatesOperations` - * 2024-04-01: :class:`CertificatesOperations` + * 2016-03-01: :class:`CertificatesOperations` + * 2018-02-01: :class:`CertificatesOperations` + * 2022-09-01: :class:`CertificatesOperations` + * 2023-01-01: :class:`CertificatesOperations` + * 2024-04-01: :class:`CertificatesOperations` """ - api_version = self._get_api_version('certificates') - if api_version == '2016-03-01': + api_version = self._get_api_version("certificates") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2018-11-01': - from ..v2018_11_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import CertificatesOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import CertificatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificates'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def container_apps(self): """Instance depends on the API version: - * 2021-03-01: :class:`ContainerAppsOperations` - * 2022-09-01: :class:`ContainerAppsOperations` - * 2023-01-01: :class:`ContainerAppsOperations` - * 2023-12-01: :class:`ContainerAppsOperations` - * 2024-04-01: :class:`ContainerAppsOperations` + * 2022-09-01: :class:`ContainerAppsOperations` + * 2023-01-01: :class:`ContainerAppsOperations` + * 2024-04-01: :class:`ContainerAppsOperations` """ - api_version = self._get_api_version('container_apps') - if api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import ContainerAppsOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("container_apps") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import ContainerAppsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import ContainerAppsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import ContainerAppsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import ContainerAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'container_apps'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def container_apps_revisions(self): """Instance depends on the API version: - * 2021-03-01: :class:`ContainerAppsRevisionsOperations` - * 2022-09-01: :class:`ContainerAppsRevisionsOperations` - * 2023-01-01: :class:`ContainerAppsRevisionsOperations` - * 2023-12-01: :class:`ContainerAppsRevisionsOperations` - * 2024-04-01: :class:`ContainerAppsRevisionsOperations` + * 2022-09-01: :class:`ContainerAppsRevisionsOperations` + * 2023-01-01: :class:`ContainerAppsRevisionsOperations` + * 2024-04-01: :class:`ContainerAppsRevisionsOperations` """ - api_version = self._get_api_version('container_apps_revisions') - if api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import ContainerAppsRevisionsOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("container_apps_revisions") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import ContainerAppsRevisionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import ContainerAppsRevisionsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import ContainerAppsRevisionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import ContainerAppsRevisionsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'container_apps_revisions'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'container_apps_revisions'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def deleted_web_apps(self): """Instance depends on the API version: - * 2016-03-01: :class:`DeletedWebAppsOperations` - * 2018-02-01: :class:`DeletedWebAppsOperations` - * 2019-08-01: :class:`DeletedWebAppsOperations` - * 2020-06-01: :class:`DeletedWebAppsOperations` - * 2020-09-01: :class:`DeletedWebAppsOperations` - * 2020-12-01: :class:`DeletedWebAppsOperations` - * 2021-01-01: :class:`DeletedWebAppsOperations` - * 2021-01-15: :class:`DeletedWebAppsOperations` - * 2021-03-01: :class:`DeletedWebAppsOperations` - * 2022-09-01: :class:`DeletedWebAppsOperations` - * 2023-01-01: :class:`DeletedWebAppsOperations` - * 2023-12-01: :class:`DeletedWebAppsOperations` - * 2024-04-01: :class:`DeletedWebAppsOperations` + * 2016-03-01: :class:`DeletedWebAppsOperations` + * 2018-02-01: :class:`DeletedWebAppsOperations` + * 2022-09-01: :class:`DeletedWebAppsOperations` + * 2023-01-01: :class:`DeletedWebAppsOperations` + * 2024-04-01: :class:`DeletedWebAppsOperations` """ - api_version = self._get_api_version('deleted_web_apps') - if api_version == '2016-03-01': + api_version = self._get_api_version("deleted_web_apps") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import DeletedWebAppsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import DeletedWebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deleted_web_apps'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def diagnostics(self): """Instance depends on the API version: - * 2016-03-01: :class:`DiagnosticsOperations` - * 2018-02-01: :class:`DiagnosticsOperations` - * 2019-08-01: :class:`DiagnosticsOperations` - * 2020-06-01: :class:`DiagnosticsOperations` - * 2020-09-01: :class:`DiagnosticsOperations` - * 2020-12-01: :class:`DiagnosticsOperations` - * 2021-01-01: :class:`DiagnosticsOperations` - * 2021-01-15: :class:`DiagnosticsOperations` - * 2021-03-01: :class:`DiagnosticsOperations` - * 2022-09-01: :class:`DiagnosticsOperations` - * 2023-01-01: :class:`DiagnosticsOperations` - * 2023-12-01: :class:`DiagnosticsOperations` - * 2024-04-01: :class:`DiagnosticsOperations` + * 2016-03-01: :class:`DiagnosticsOperations` + * 2018-02-01: :class:`DiagnosticsOperations` + * 2022-09-01: :class:`DiagnosticsOperations` + * 2023-01-01: :class:`DiagnosticsOperations` + * 2024-04-01: :class:`DiagnosticsOperations` """ - api_version = self._get_api_version('diagnostics') - if api_version == '2016-03-01': + api_version = self._get_api_version("diagnostics") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import DiagnosticsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import DiagnosticsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'diagnostics'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def domain_registration_provider(self): """Instance depends on the API version: - * 2015-04-01: :class:`DomainRegistrationProviderOperations` - * 2018-02-01: :class:`DomainRegistrationProviderOperations` - * 2019-08-01: :class:`DomainRegistrationProviderOperations` - * 2020-06-01: :class:`DomainRegistrationProviderOperations` - * 2020-09-01: :class:`DomainRegistrationProviderOperations` - * 2020-12-01: :class:`DomainRegistrationProviderOperations` - * 2021-01-01: :class:`DomainRegistrationProviderOperations` - * 2021-01-15: :class:`DomainRegistrationProviderOperations` - * 2021-03-01: :class:`DomainRegistrationProviderOperations` - * 2022-09-01: :class:`DomainRegistrationProviderOperations` - * 2023-01-01: :class:`DomainRegistrationProviderOperations` - * 2023-12-01: :class:`DomainRegistrationProviderOperations` - * 2024-04-01: :class:`DomainRegistrationProviderOperations` + * 2018-02-01: :class:`DomainRegistrationProviderOperations` + * 2022-09-01: :class:`DomainRegistrationProviderOperations` + * 2023-01-01: :class:`DomainRegistrationProviderOperations` + * 2024-04-01: :class:`DomainRegistrationProviderOperations` """ - api_version = self._get_api_version('domain_registration_provider') - if api_version == '2015-04-01': - from ..v2015_04_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("domain_registration_provider") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import DomainRegistrationProviderOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import DomainRegistrationProviderOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'domain_registration_provider'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'domain_registration_provider'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def domains(self): """Instance depends on the API version: - * 2015-04-01: :class:`DomainsOperations` - * 2018-02-01: :class:`DomainsOperations` - * 2019-08-01: :class:`DomainsOperations` - * 2020-06-01: :class:`DomainsOperations` - * 2020-09-01: :class:`DomainsOperations` - * 2020-12-01: :class:`DomainsOperations` - * 2021-01-01: :class:`DomainsOperations` - * 2021-01-15: :class:`DomainsOperations` - * 2021-03-01: :class:`DomainsOperations` - * 2022-09-01: :class:`DomainsOperations` - * 2023-01-01: :class:`DomainsOperations` - * 2023-12-01: :class:`DomainsOperations` - * 2024-04-01: :class:`DomainsOperations` + * 2018-02-01: :class:`DomainsOperations` + * 2022-09-01: :class:`DomainsOperations` + * 2023-01-01: :class:`DomainsOperations` + * 2024-04-01: :class:`DomainsOperations` """ - api_version = self._get_api_version('domains') - if api_version == '2015-04-01': - from ..v2015_04_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("domains") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import DomainsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import DomainsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import DomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domains'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def get_usages_in_location(self): """Instance depends on the API version: - * 2023-01-01: :class:`GetUsagesInLocationOperations` - * 2023-12-01: :class:`GetUsagesInLocationOperations` - * 2024-04-01: :class:`GetUsagesInLocationOperations` + * 2023-01-01: :class:`GetUsagesInLocationOperations` + * 2024-04-01: :class:`GetUsagesInLocationOperations` """ - api_version = self._get_api_version('get_usages_in_location') - if api_version == '2023-01-01': + api_version = self._get_api_version("get_usages_in_location") + if api_version == "2023-01-01": from ..v2023_01_01.aio.operations import GetUsagesInLocationOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import GetUsagesInLocationOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import GetUsagesInLocationOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'get_usages_in_location'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'get_usages_in_location'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def global_operations(self): """Instance depends on the API version: - * 2020-12-01: :class:`GlobalOperations` - * 2021-01-01: :class:`GlobalOperations` - * 2021-01-15: :class:`GlobalOperations` - * 2021-03-01: :class:`GlobalOperations` - * 2022-09-01: :class:`GlobalOperations` - * 2023-01-01: :class:`GlobalOperations` - * 2023-12-01: :class:`GlobalOperations` - * 2024-04-01: :class:`GlobalOperations` + * 2022-09-01: :class:`GlobalOperations` + * 2023-01-01: :class:`GlobalOperations` + * 2024-04-01: :class:`GlobalOperations` """ - api_version = self._get_api_version('global_operations') - if api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import GlobalOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import GlobalOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import GlobalOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import GlobalOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("global_operations") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import GlobalOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import GlobalOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import GlobalOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import GlobalOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'global_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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def kube_environments(self): """Instance depends on the API version: - * 2021-01-01: :class:`KubeEnvironmentsOperations` - * 2021-01-15: :class:`KubeEnvironmentsOperations` - * 2021-03-01: :class:`KubeEnvironmentsOperations` - * 2022-09-01: :class:`KubeEnvironmentsOperations` - * 2023-01-01: :class:`KubeEnvironmentsOperations` - * 2023-12-01: :class:`KubeEnvironmentsOperations` - * 2024-04-01: :class:`KubeEnvironmentsOperations` + * 2022-09-01: :class:`KubeEnvironmentsOperations` + * 2023-01-01: :class:`KubeEnvironmentsOperations` + * 2024-04-01: :class:`KubeEnvironmentsOperations` """ - api_version = self._get_api_version('kube_environments') - if api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("kube_environments") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import KubeEnvironmentsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import KubeEnvironmentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'kube_environments'".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)), 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(self): """Instance depends on the API version: - * 2016-03-01: :class:`ProviderOperations` - * 2018-02-01: :class:`ProviderOperations` - * 2019-08-01: :class:`ProviderOperations` - * 2020-06-01: :class:`ProviderOperations` - * 2020-09-01: :class:`ProviderOperations` - * 2020-12-01: :class:`ProviderOperations` - * 2021-01-01: :class:`ProviderOperations` - * 2021-01-15: :class:`ProviderOperations` - * 2021-03-01: :class:`ProviderOperations` - * 2022-09-01: :class:`ProviderOperations` - * 2023-01-01: :class:`ProviderOperations` - * 2023-12-01: :class:`ProviderOperations` - * 2024-04-01: :class:`ProviderOperations` + * 2016-03-01: :class:`ProviderOperations` + * 2018-02-01: :class:`ProviderOperations` + * 2022-09-01: :class:`ProviderOperations` + * 2023-01-01: :class:`ProviderOperations` + * 2024-04-01: :class:`ProviderOperations` """ - api_version = self._get_api_version('provider') - if api_version == '2016-03-01': + api_version = self._get_api_version("provider") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import ProviderOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import ProviderOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import ProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'provider'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def recommendations(self): """Instance depends on the API version: - * 2016-03-01: :class:`RecommendationsOperations` - * 2018-02-01: :class:`RecommendationsOperations` - * 2019-08-01: :class:`RecommendationsOperations` - * 2020-06-01: :class:`RecommendationsOperations` - * 2020-09-01: :class:`RecommendationsOperations` - * 2020-12-01: :class:`RecommendationsOperations` - * 2021-01-01: :class:`RecommendationsOperations` - * 2021-01-15: :class:`RecommendationsOperations` - * 2021-03-01: :class:`RecommendationsOperations` - * 2022-09-01: :class:`RecommendationsOperations` - * 2023-01-01: :class:`RecommendationsOperations` - * 2023-12-01: :class:`RecommendationsOperations` - * 2024-04-01: :class:`RecommendationsOperations` + * 2016-03-01: :class:`RecommendationsOperations` + * 2018-02-01: :class:`RecommendationsOperations` + * 2022-09-01: :class:`RecommendationsOperations` + * 2023-01-01: :class:`RecommendationsOperations` + * 2024-04-01: :class:`RecommendationsOperations` """ - api_version = self._get_api_version('recommendations') - if api_version == '2016-03-01': + api_version = self._get_api_version("recommendations") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import RecommendationsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import RecommendationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'recommendations'".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)), 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_health_metadata(self): """Instance depends on the API version: - * 2016-03-01: :class:`ResourceHealthMetadataOperations` - * 2018-02-01: :class:`ResourceHealthMetadataOperations` - * 2019-08-01: :class:`ResourceHealthMetadataOperations` - * 2020-06-01: :class:`ResourceHealthMetadataOperations` - * 2020-09-01: :class:`ResourceHealthMetadataOperations` - * 2020-12-01: :class:`ResourceHealthMetadataOperations` - * 2021-01-01: :class:`ResourceHealthMetadataOperations` - * 2021-01-15: :class:`ResourceHealthMetadataOperations` - * 2021-03-01: :class:`ResourceHealthMetadataOperations` - * 2022-09-01: :class:`ResourceHealthMetadataOperations` - * 2023-01-01: :class:`ResourceHealthMetadataOperations` - * 2023-12-01: :class:`ResourceHealthMetadataOperations` - * 2024-04-01: :class:`ResourceHealthMetadataOperations` + * 2016-03-01: :class:`ResourceHealthMetadataOperations` + * 2018-02-01: :class:`ResourceHealthMetadataOperations` + * 2022-09-01: :class:`ResourceHealthMetadataOperations` + * 2023-01-01: :class:`ResourceHealthMetadataOperations` + * 2024-04-01: :class:`ResourceHealthMetadataOperations` """ - api_version = self._get_api_version('resource_health_metadata') - if api_version == '2016-03-01': + api_version = self._get_api_version("resource_health_metadata") + if api_version == "2016-03-01": from ..v2016_03_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2018-02-01': + elif api_version == "2018-02-01": from ..v2018_02_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import ResourceHealthMetadataOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import ResourceHealthMetadataOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'resource_health_metadata'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'resource_health_metadata'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def static_sites(self): """Instance depends on the API version: - * 2019-08-01: :class:`StaticSitesOperations` - * 2020-06-01: :class:`StaticSitesOperations` - * 2020-09-01: :class:`StaticSitesOperations` - * 2020-12-01: :class:`StaticSitesOperations` - * 2021-01-01: :class:`StaticSitesOperations` - * 2021-01-15: :class:`StaticSitesOperations` - * 2021-03-01: :class:`StaticSitesOperations` - * 2022-09-01: :class:`StaticSitesOperations` - * 2023-01-01: :class:`StaticSitesOperations` - * 2023-12-01: :class:`StaticSitesOperations` - * 2024-04-01: :class:`StaticSitesOperations` + * 2022-09-01: :class:`StaticSitesOperations` + * 2023-01-01: :class:`StaticSitesOperations` + * 2024-04-01: :class:`StaticSitesOperations` """ - api_version = self._get_api_version('static_sites') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2022-09-01': + api_version = self._get_api_version("static_sites") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import StaticSitesOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import StaticSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'static_sites'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def top_level_domains(self): """Instance depends on the API version: - * 2015-04-01: :class:`TopLevelDomainsOperations` - * 2018-02-01: :class:`TopLevelDomainsOperations` - * 2019-08-01: :class:`TopLevelDomainsOperations` - * 2020-06-01: :class:`TopLevelDomainsOperations` - * 2020-09-01: :class:`TopLevelDomainsOperations` - * 2020-12-01: :class:`TopLevelDomainsOperations` - * 2021-01-01: :class:`TopLevelDomainsOperations` - * 2021-01-15: :class:`TopLevelDomainsOperations` - * 2021-03-01: :class:`TopLevelDomainsOperations` - * 2022-09-01: :class:`TopLevelDomainsOperations` - * 2023-01-01: :class:`TopLevelDomainsOperations` - * 2023-12-01: :class:`TopLevelDomainsOperations` - * 2024-04-01: :class:`TopLevelDomainsOperations` + * 2018-02-01: :class:`TopLevelDomainsOperations` + * 2022-09-01: :class:`TopLevelDomainsOperations` + * 2023-01-01: :class:`TopLevelDomainsOperations` + * 2024-04-01: :class:`TopLevelDomainsOperations` """ - api_version = self._get_api_version('top_level_domains') - if api_version == '2015-04-01': - from ..v2015_04_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("top_level_domains") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import TopLevelDomainsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import TopLevelDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'top_level_domains'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def web_apps(self): """Instance depends on the API version: - * 2016-08-01: :class:`WebAppsOperations` - * 2018-02-01: :class:`WebAppsOperations` - * 2019-08-01: :class:`WebAppsOperations` - * 2020-06-01: :class:`WebAppsOperations` - * 2020-09-01: :class:`WebAppsOperations` - * 2020-12-01: :class:`WebAppsOperations` - * 2021-01-01: :class:`WebAppsOperations` - * 2021-01-15: :class:`WebAppsOperations` - * 2021-03-01: :class:`WebAppsOperations` - * 2022-09-01: :class:`WebAppsOperations` - * 2023-01-01: :class:`WebAppsOperations` - * 2023-12-01: :class:`WebAppsOperations` - * 2024-04-01: :class:`WebAppsOperations` + * 2018-02-01: :class:`WebAppsOperations` + * 2022-09-01: :class:`WebAppsOperations` + * 2023-01-01: :class:`WebAppsOperations` + * 2024-04-01: :class:`WebAppsOperations` """ - api_version = self._get_api_version('web_apps') - if api_version == '2016-08-01': - from ..v2016_08_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2018-02-01': + api_version = self._get_api_version("web_apps") + if api_version == "2018-02-01": from ..v2018_02_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2020-06-01': - from ..v2020_06_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2020-09-01': - from ..v2020_09_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2020-12-01': - from ..v2020_12_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2021-01-01': - from ..v2021_01_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2021-01-15': - from ..v2021_01_15.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2021-03-01': - from ..v2021_03_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2022-09-01': + elif api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WebAppsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'web_apps'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_run_action_repetitions(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunActionRepetitionsOperations` - * 2023-01-01: :class:`WorkflowRunActionRepetitionsOperations` - * 2023-12-01: :class:`WorkflowRunActionRepetitionsOperations` - * 2024-04-01: :class:`WorkflowRunActionRepetitionsOperations` + * 2022-09-01: :class:`WorkflowRunActionRepetitionsOperations` + * 2023-01-01: :class:`WorkflowRunActionRepetitionsOperations` + * 2024-04-01: :class:`WorkflowRunActionRepetitionsOperations` """ - api_version = self._get_api_version('workflow_run_action_repetitions') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_run_action_repetitions") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WorkflowRunActionRepetitionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WorkflowRunActionRepetitionsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WorkflowRunActionRepetitionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WorkflowRunActionRepetitionsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'workflow_run_action_repetitions'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'workflow_run_action_repetitions'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_run_action_repetitions_request_histories(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` - * 2023-01-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` - * 2023-12-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` - * 2024-04-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` + * 2022-09-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` + * 2023-01-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` + * 2024-04-01: :class:`WorkflowRunActionRepetitionsRequestHistoriesOperations` """ - api_version = self._get_api_version('workflow_run_action_repetitions_request_histories') - if api_version == '2022-09-01': - from ..v2022_09_01.aio.operations import WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass - elif api_version == '2023-01-01': - from ..v2023_01_01.aio.operations import WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass - elif api_version == '2024-04-01': - from ..v2024_04_01.aio.operations import WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass + api_version = self._get_api_version("workflow_run_action_repetitions_request_histories") + if api_version == "2022-09-01": + from ..v2022_09_01.aio.operations import ( + WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass, + ) + elif api_version == "2023-01-01": + from ..v2023_01_01.aio.operations import ( + WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass, + ) + elif api_version == "2024-04-01": + from ..v2024_04_01.aio.operations import ( + WorkflowRunActionRepetitionsRequestHistoriesOperations as OperationClass, + ) else: - raise ValueError("API version {} does not have operation group 'workflow_run_action_repetitions_request_histories'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'workflow_run_action_repetitions_request_histories'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_run_action_scope_repetitions(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunActionScopeRepetitionsOperations` - * 2023-01-01: :class:`WorkflowRunActionScopeRepetitionsOperations` - * 2023-12-01: :class:`WorkflowRunActionScopeRepetitionsOperations` - * 2024-04-01: :class:`WorkflowRunActionScopeRepetitionsOperations` + * 2022-09-01: :class:`WorkflowRunActionScopeRepetitionsOperations` + * 2023-01-01: :class:`WorkflowRunActionScopeRepetitionsOperations` + * 2024-04-01: :class:`WorkflowRunActionScopeRepetitionsOperations` """ - api_version = self._get_api_version('workflow_run_action_scope_repetitions') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_run_action_scope_repetitions") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WorkflowRunActionScopeRepetitionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WorkflowRunActionScopeRepetitionsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WorkflowRunActionScopeRepetitionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WorkflowRunActionScopeRepetitionsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'workflow_run_action_scope_repetitions'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'workflow_run_action_scope_repetitions'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_run_actions(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunActionsOperations` - * 2023-01-01: :class:`WorkflowRunActionsOperations` - * 2023-12-01: :class:`WorkflowRunActionsOperations` - * 2024-04-01: :class:`WorkflowRunActionsOperations` + * 2022-09-01: :class:`WorkflowRunActionsOperations` + * 2023-01-01: :class:`WorkflowRunActionsOperations` + * 2024-04-01: :class:`WorkflowRunActionsOperations` """ - api_version = self._get_api_version('workflow_run_actions') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_run_actions") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WorkflowRunActionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WorkflowRunActionsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WorkflowRunActionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WorkflowRunActionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflow_run_actions'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_runs(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowRunsOperations` - * 2023-01-01: :class:`WorkflowRunsOperations` - * 2023-12-01: :class:`WorkflowRunsOperations` - * 2024-04-01: :class:`WorkflowRunsOperations` + * 2022-09-01: :class:`WorkflowRunsOperations` + * 2023-01-01: :class:`WorkflowRunsOperations` + * 2024-04-01: :class:`WorkflowRunsOperations` """ - api_version = self._get_api_version('workflow_runs') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_runs") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WorkflowRunsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WorkflowRunsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WorkflowRunsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WorkflowRunsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflow_runs'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_trigger_histories(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowTriggerHistoriesOperations` - * 2023-01-01: :class:`WorkflowTriggerHistoriesOperations` - * 2023-12-01: :class:`WorkflowTriggerHistoriesOperations` - * 2024-04-01: :class:`WorkflowTriggerHistoriesOperations` + * 2022-09-01: :class:`WorkflowTriggerHistoriesOperations` + * 2023-01-01: :class:`WorkflowTriggerHistoriesOperations` + * 2024-04-01: :class:`WorkflowTriggerHistoriesOperations` """ - api_version = self._get_api_version('workflow_trigger_histories') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_trigger_histories") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WorkflowTriggerHistoriesOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WorkflowTriggerHistoriesOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WorkflowTriggerHistoriesOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WorkflowTriggerHistoriesOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'workflow_trigger_histories'".format(api_version)) + raise ValueError( + "API version {} does not have operation group 'workflow_trigger_histories'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_triggers(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowTriggersOperations` - * 2023-01-01: :class:`WorkflowTriggersOperations` - * 2023-12-01: :class:`WorkflowTriggersOperations` - * 2024-04-01: :class:`WorkflowTriggersOperations` + * 2022-09-01: :class:`WorkflowTriggersOperations` + * 2023-01-01: :class:`WorkflowTriggersOperations` + * 2024-04-01: :class:`WorkflowTriggersOperations` """ - api_version = self._get_api_version('workflow_triggers') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_triggers") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WorkflowTriggersOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WorkflowTriggersOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WorkflowTriggersOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WorkflowTriggersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflow_triggers'".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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflow_versions(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowVersionsOperations` - * 2023-01-01: :class:`WorkflowVersionsOperations` - * 2023-12-01: :class:`WorkflowVersionsOperations` - * 2024-04-01: :class:`WorkflowVersionsOperations` + * 2022-09-01: :class:`WorkflowVersionsOperations` + * 2023-01-01: :class:`WorkflowVersionsOperations` + * 2024-04-01: :class:`WorkflowVersionsOperations` """ - api_version = self._get_api_version('workflow_versions') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflow_versions") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WorkflowVersionsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WorkflowVersionsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WorkflowVersionsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WorkflowVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflow_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)), api_version) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + api_version, + ) @property def workflows(self): """Instance depends on the API version: - * 2022-09-01: :class:`WorkflowsOperations` - * 2023-01-01: :class:`WorkflowsOperations` - * 2023-12-01: :class:`WorkflowsOperations` - * 2024-04-01: :class:`WorkflowsOperations` + * 2022-09-01: :class:`WorkflowsOperations` + * 2023-01-01: :class:`WorkflowsOperations` + * 2024-04-01: :class:`WorkflowsOperations` """ - api_version = self._get_api_version('workflows') - if api_version == '2022-09-01': + api_version = self._get_api_version("workflows") + if api_version == "2022-09-01": from ..v2022_09_01.aio.operations import WorkflowsOperations as OperationClass - elif api_version == '2023-01-01': + elif api_version == "2023-01-01": from ..v2023_01_01.aio.operations import WorkflowsOperations as OperationClass - elif api_version == '2023-12-01': - from ..v2023_12_01.aio.operations import WorkflowsOperations as OperationClass - elif api_version == '2024-04-01': + elif api_version == "2024-04-01": from ..v2024_04_01.aio.operations import WorkflowsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workflows'".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)), 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() + async def __aenter__(self): await self._client.__aenter__() return self + async def __aexit__(self, *exc_details): await self._client.__aexit__(*exc_details) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py index 9bd4c9b55137..142a0420b39b 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.0.0" +VERSION = "8.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py index 9bd4c9b55137..142a0420b39b 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.0.0" +VERSION = "8.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2022_09_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2022_09_01/_version.py index 9bd4c9b55137..142a0420b39b 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2022_09_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2022_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.0.0" +VERSION = "8.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2023_01_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2023_01_01/_version.py index 9bd4c9b55137..142a0420b39b 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2023_01_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2023_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.0.0" +VERSION = "8.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2024_04_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2024_04_01/_version.py index 9bd4c9b55137..142a0420b39b 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2024_04_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2024_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.0.0" +VERSION = "8.0.0" diff --git a/sdk/appservice/azure-mgmt-web/generated_samples/app_service_environments_create_or_update_worker_pool.py b/sdk/appservice/azure-mgmt-web/generated_samples/app_service_environments_create_or_update_worker_pool.py index 2f51bbdd1412..ee79577ad8a9 100644 --- a/sdk/appservice/azure-mgmt-web/generated_samples/app_service_environments_create_or_update_worker_pool.py +++ b/sdk/appservice/azure-mgmt-web/generated_samples/app_service_environments_create_or_update_worker_pool.py @@ -9,6 +9,7 @@ from azure.identity import DefaultAzureCredential from azure.mgmt.web import WebSiteManagementClient + """ # PREREQUISITES pip install azure-identity @@ -21,6 +22,8 @@ AZURE_CLIENT_SECRET. For more info about how to get the value, please see: https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ + + def main(): client = WebSiteManagementClient( credential=DefaultAzureCredential(), @@ -28,15 +31,14 @@ def main(): ) response = client.app_service_environments.update_worker_pool( - resource_group_name='test-rg', - name='test-ase', - worker_pool_name='0', - worker_pool_envelope={'properties': {'workerCount': 3, 'workerSize': 'Small'}}, + resource_group_name="test-rg", + name="test-ase", + worker_pool_name="0", + worker_pool_envelope={"properties": {"workerCount": 3, "workerSize": "Small"}}, ) print(response) + # x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2024-04-01/examples/AppServiceEnvironments_CreateOrUpdateWorkerPool.json if __name__ == "__main__": main() -= "__main__": - main() diff --git a/sdk/appservice/azure-mgmt-web/generated_samples/list_operations.py b/sdk/appservice/azure-mgmt-web/generated_samples/list_operations.py index 0a019644a0ce..849f45099c01 100644 --- a/sdk/appservice/azure-mgmt-web/generated_samples/list_operations.py +++ b/sdk/appservice/azure-mgmt-web/generated_samples/list_operations.py @@ -9,6 +9,7 @@ from azure.identity import DefaultAzureCredential from azure.mgmt.web import WebSiteManagementClient + """ # PREREQUISITES pip install azure-identity @@ -21,20 +22,19 @@ AZURE_CLIENT_SECRET. For more info about how to get the value, please see: https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ + + def main(): client = WebSiteManagementClient( credential=DefaultAzureCredential(), subscription_id="SUBSCRIPTION_ID", ) - response = client.provider.list_operations( - ) + response = client.provider.list_operations() for item in response: print(item) + # x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2024-04-01/examples/ListOperations.json if __name__ == "__main__": main() -__name__ == "__main__": - main() - main() diff --git a/sdk/appservice/azure-mgmt-web/generated_samples/list_workflows_configuration_connections.py b/sdk/appservice/azure-mgmt-web/generated_samples/list_workflows_configuration_connections.py index b598657c0c5b..bd9133a8d3a2 100644 --- a/sdk/appservice/azure-mgmt-web/generated_samples/list_workflows_configuration_connections.py +++ b/sdk/appservice/azure-mgmt-web/generated_samples/list_workflows_configuration_connections.py @@ -9,6 +9,7 @@ from azure.identity import DefaultAzureCredential from azure.mgmt.web import WebSiteManagementClient + """ # PREREQUISITES pip install azure-identity @@ -21,6 +22,8 @@ AZURE_CLIENT_SECRET. For more info about how to get the value, please see: https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ + + def main(): client = WebSiteManagementClient( credential=DefaultAzureCredential(), @@ -28,13 +31,12 @@ def main(): ) response = client.web_apps.list_workflows_connections( - resource_group_name='testrg123', - name='testsite2', + resource_group_name="testrg123", + name="testsite2", ) print(response) + # x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2024-04-01/examples/ListWorkflowsConfigurationConnections.json if __name__ == "__main__": main() -__ == "__main__": - main() diff --git a/sdk/appservice/azure-mgmt-web/generated_samples/start_web_site_network_trace_operation.py b/sdk/appservice/azure-mgmt-web/generated_samples/start_web_site_network_trace_operation.py index 66e20802c38c..a3abe794f444 100644 --- a/sdk/appservice/azure-mgmt-web/generated_samples/start_web_site_network_trace_operation.py +++ b/sdk/appservice/azure-mgmt-web/generated_samples/start_web_site_network_trace_operation.py @@ -9,6 +9,7 @@ from azure.identity import DefaultAzureCredential from azure.mgmt.web import WebSiteManagementClient + """ # PREREQUISITES pip install azure-identity @@ -21,6 +22,8 @@ AZURE_CLIENT_SECRET. For more info about how to get the value, please see: https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ + + def main(): client = WebSiteManagementClient( credential=DefaultAzureCredential(), @@ -28,15 +31,12 @@ def main(): ) response = client.web_apps.begin_start_network_trace( - resource_group_name='testrg123', - name='SampleApp', + resource_group_name="testrg123", + name="SampleApp", ).result() print(response) + # x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2024-04-01/examples/StartWebSiteNetworkTraceOperation.json if __name__ == "__main__": main() -ame__ == "__main__": - main() -ain__": - main() diff --git a/sdk/appservice/azure-mgmt-web/generated_samples/stop_web_site_network_trace.py b/sdk/appservice/azure-mgmt-web/generated_samples/stop_web_site_network_trace.py index efc402091e8f..96d736c55ae7 100644 --- a/sdk/appservice/azure-mgmt-web/generated_samples/stop_web_site_network_trace.py +++ b/sdk/appservice/azure-mgmt-web/generated_samples/stop_web_site_network_trace.py @@ -9,6 +9,7 @@ from azure.identity import DefaultAzureCredential from azure.mgmt.web import WebSiteManagementClient + """ # PREREQUISITES pip install azure-identity @@ -21,6 +22,8 @@ AZURE_CLIENT_SECRET. For more info about how to get the value, please see: https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ + + def main(): client = WebSiteManagementClient( credential=DefaultAzureCredential(), @@ -28,13 +31,11 @@ def main(): ) client.web_apps.stop_network_trace( - resource_group_name='testrg123', - name='SampleApp', + resource_group_name="testrg123", + name="SampleApp", ) + # x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2024-04-01/examples/StopWebSiteNetworkTrace.json if __name__ == "__main__": main() -ame__ == "__main__": - main() - main() diff --git a/sdk/appservice/azure-mgmt-web/setup.py b/sdk/appservice/azure-mgmt-web/setup.py index 35a589a46dfe..d39995f026b9 100644 --- a/sdk/appservice/azure-mgmt-web/setup.py +++ b/sdk/appservice/azure-mgmt-web/setup.py @@ -22,9 +22,11 @@ # Version extraction inspired from 'requests' with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), + ( + os.path.join(package_folder_path, "version.py") + if os.path.exists(os.path.join(package_folder_path, "version.py")) + else os.path.join(package_folder_path, "_version.py") + ), "r", ) as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) diff --git a/sdk/appservice/azure-mgmt-web/tests/conftest.py b/sdk/appservice/azure-mgmt-web/tests/conftest.py index 5bf74943ea0c..b3b7e51fa9e4 100644 --- a/sdk/appservice/azure-mgmt-web/tests/conftest.py +++ b/sdk/appservice/azure-mgmt-web/tests/conftest.py @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): websitemanagement_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") diff --git a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_app_service.py b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_app_service.py index 19b9fc5c954c..5dd58f2a17cd 100644 --- a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_app_service.py +++ b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_app_service.py @@ -1,10 +1,10 @@ # coding: utf-8 -#------------------------------------------------------------------------- +# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Current Operation Coverage: # AppServicePlans: 6/27 @@ -14,17 +14,16 @@ import azure.mgmt.web from devtools_testutils import AzureMgmtTestCase, RandomNameResourceGroupPreparer -AZURE_LOCATION = 'eastus' +AZURE_LOCATION = "eastus" + class MgmtWebSiteTest(AzureMgmtTestCase): def setUp(self): super(MgmtWebSiteTest, self).setUp() - self.mgmt_client = self.create_mgmt_client( - azure.mgmt.web.WebSiteManagementClient - ) + self.mgmt_client = self.create_mgmt_client(azure.mgmt.web.WebSiteManagementClient) - @unittest.skip('skip temporarily') + @unittest.skip("skip temporarily") @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) def test_app_service_plan(self, resource_group): @@ -33,47 +32,43 @@ def test_app_service_plan(self, resource_group): RESOURCE_GROUP = resource_group.name NAME = "myname" -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/put/Create Or Update App Service plan[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "kind": "app", - "location": AZURE_LOCATION, - "sku": { - "name": "P1", - "tier": "Premium", - "size": "P1", - "family": "P", - "capacity": "1" - } + "kind": "app", + "location": AZURE_LOCATION, + "sku": {"name": "P1", "tier": "Premium", "size": "P1", "family": "P", "capacity": "1"}, } - result = self.mgmt_client.app_service_plans.begin_create_or_update(resource_group_name=RESOURCE_GROUP, name=NAME, app_service_plan=BODY) + result = self.mgmt_client.app_service_plans.begin_create_or_update( + resource_group_name=RESOURCE_GROUP, name=NAME, app_service_plan=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/get/Get App Service plan[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.app_service_plans.get(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/get/List App Service plans by resource group[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.app_service_plans.list_by_resource_group(resource_group_name=RESOURCE_GROUP) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/get/List App Service plans[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.app_service_plans.list() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/patch/Patch Service plan[patch] -#-------------------------------------------------------------------------- - BODY = { - "kind": "app" - } - result = self.mgmt_client.app_service_plans.update(resource_group_name=RESOURCE_GROUP, name=NAME, app_service_plan=BODY) + # -------------------------------------------------------------------------- + BODY = {"kind": "app"} + result = self.mgmt_client.app_service_plans.update( + resource_group_name=RESOURCE_GROUP, name=NAME, app_service_plan=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/delete/Delete App Service plan[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.app_service_plans.delete(resource_group_name=RESOURCE_GROUP, name=NAME) diff --git a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_certificate.py b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_certificate.py index 389562515e95..8385ebfad92b 100644 --- a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_certificate.py +++ b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_certificate.py @@ -1,10 +1,10 @@ # coding: utf-8 -#------------------------------------------------------------------------- +# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Current Operation Coverage: # Certificates: 0/6 @@ -16,15 +16,14 @@ from devtools_testutils import AzureMgmtTestCase, RandomNameResourceGroupPreparer from devtools_testutils.fake_credentials import FAKE_LOGIN_PASSWORD -AZURE_LOCATION = 'eastus' +AZURE_LOCATION = "eastus" + class MgmtWebSiteTest(AzureMgmtTestCase): def setUp(self): super(MgmtWebSiteTest, self).setUp() - self.mgmt_client = self.create_mgmt_client( - azure.mgmt.web.WebSiteManagementClient - ) + self.mgmt_client = self.create_mgmt_client(azure.mgmt.web.WebSiteManagementClient) @unittest.skip("Operation returned an invalid status 'Not Found' when create certificate") @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -33,47 +32,47 @@ def test_certificate(self, resource_group): RESOURCE_GROUP = resource_group.name NAME = "myname" -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/put/Create Or Update Certificate[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "host_names": [ - "ServerCert" - ], - "password": FAKE_LOGIN_PASSWORD # this may not work -- check when tests are active + "location": AZURE_LOCATION, + "host_names": ["ServerCert"], + "password": FAKE_LOGIN_PASSWORD, # this may not work -- check when tests are active } - result = self.mgmt_client.certificates.create_or_update(resource_group_name=RESOURCE_GROUP, name=NAME, certificate_envelope=BODY) + result = self.mgmt_client.certificates.create_or_update( + resource_group_name=RESOURCE_GROUP, name=NAME, certificate_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/get/Get Certificate[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificates.get(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/get/List Certificates by resource group[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificates.list_by_resource_group(resource_group_name=RESOURCE_GROUP) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/get/List Certificates for subscription[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificates.list() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /CertificateRegistrationProvider/get/List operations[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificate_registration_provider.list_operations() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/patch/Patch Certificate[patch] -#-------------------------------------------------------------------------- - BODY = { - "password": FAKE_LOGIN_PASSWORD # this may not work -- check when tests are active - } - result = self.mgmt_client.certificates.update(resource_group_name=RESOURCE_GROUP, name=NAME, certificate_envelope=BODY) + # -------------------------------------------------------------------------- + BODY = {"password": FAKE_LOGIN_PASSWORD} # this may not work -- check when tests are active + result = self.mgmt_client.certificates.update( + resource_group_name=RESOURCE_GROUP, name=NAME, certificate_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/delete/Delete Certificate[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificates.delete(resource_group_name=RESOURCE_GROUP, name=NAME) diff --git a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_static_site.py b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_static_site.py index ee658e6a982b..c5a19f6e71c0 100644 --- a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_static_site.py +++ b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_static_site.py @@ -1,10 +1,10 @@ # coding: utf-8 -#------------------------------------------------------------------------- +# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Current Operation Coverage: # StaticSites: 12/26 @@ -14,17 +14,16 @@ import azure.mgmt.web from devtools_testutils import AzureMgmtTestCase, RandomNameResourceGroupPreparer -AZURE_LOCATION = 'eastus2' +AZURE_LOCATION = "eastus2" + class MgmtWebSiteTest(AzureMgmtTestCase): def setUp(self): super(MgmtWebSiteTest, self).setUp() - self.mgmt_client = self.create_mgmt_client( - azure.mgmt.web.WebSiteManagementClient - ) + self.mgmt_client = self.create_mgmt_client(azure.mgmt.web.WebSiteManagementClient) - @unittest.skip('skip temporarily') + @unittest.skip("skip temporarily") @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) def test_static_site(self, resource_group): @@ -35,174 +34,165 @@ def test_static_site(self, resource_group): PR_ID = "1" DOMAIN_NAME = "mydomain" -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/put/Create or update a static site[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "sku": { - "name": "Free", - # "tier": "Free" - }, - # "repository_url": "https://github.com/username/RepoName", - "repository_url": "https://github.com/00Kai0/html-docs-hello-world", - "branch": "master", - # "repository_token": "repoToken123", - "repository_token": GITHUB_TOKEN, - "build_properties": { - "app_location": "app", - "api_location": "api", - "app_artifact_location": "build" - } + "location": AZURE_LOCATION, + "sku": { + "name": "Free", + # "tier": "Free" + }, + # "repository_url": "https://github.com/username/RepoName", + "repository_url": "https://github.com/00Kai0/html-docs-hello-world", + "branch": "master", + # "repository_token": "repoToken123", + "repository_token": GITHUB_TOKEN, + "build_properties": {"app_location": "app", "api_location": "api", "app_artifact_location": "build"}, } - result = self.mgmt_client.static_sites.create_or_update_static_site(resource_group_name=RESOURCE_GROUP, name=NAME, static_site_envelope=BODY) + result = self.mgmt_client.static_sites.create_or_update_static_site( + resource_group_name=RESOURCE_GROUP, name=NAME, static_site_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/put/Creates or updates the function app settings of a static site.[put] -#-------------------------------------------------------------------------- - BODY = { - "properties": { - "setting1": "someval", - "setting2": "someval2" - } - } + # -------------------------------------------------------------------------- + BODY = {"properties": {"setting1": "someval", "setting2": "someval2"}} # result = self.mgmt_client.static_sites.create_or_update_static_site_function_app_settings(resource_group_name=RESOURCE_GROUP, name=NAME, app_settings=BODY) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/put/Create or update a custom domain for a static site[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.static_sites.create_or_update_static_site_custom_domain(resource_group_name=RESOURCE_GROUP, name=NAME, domain_name=DOMAIN_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/put/Creates or updates the function app settings of a static site build.[put] -#-------------------------------------------------------------------------- - BODY = { - "setting1": "someval", - "setting2": "someval2" - } + # -------------------------------------------------------------------------- + BODY = {"setting1": "someval", "setting2": "someval2"} # result = self.mgmt_client.static_sites.create_or_update_static_site_build_function_app_settings(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID, app_settings=BODY) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Gets the functions of a particular static site build[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.list_static_site_build_functions(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.list_static_site_build_functions( + resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get a static site build[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.static_sites.get_static_site_build(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/List custom domains for a static site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.list_static_site_custom_domains(resource_group_name=RESOURCE_GROUP, name=NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.list_static_site_custom_domains( + resource_group_name=RESOURCE_GROUP, name=NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Gets the functions of a static site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.list_static_site_functions(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get all builds for a static site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.get_static_site_builds(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get details for a static site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.get_static_site(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get static sites for a resource group[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.get_static_sites_by_resource_group(resource_group_name=RESOURCE_GROUP) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get all static sites in a subscription[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.list() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/patch/Create or update a user for a static site[patch] -#-------------------------------------------------------------------------- - BODY = { - "roles": "contributor" - } + # -------------------------------------------------------------------------- + BODY = {"roles": "contributor"} # result = self.mgmt_client.static_sites.update_static_site_user(resource_group_name=RESOURCE_GROUP, name=NAME, authprovider=AUTHPROVIDER, userid=USERID, static_site_user_envelope=BODY) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/List users for a static site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.static_sites.list_static_site_users(resource_group_name=RESOURCE_GROUP, name=NAME, authprovider=AUTHPROVIDER) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Get function app settings of a static site build[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.static_sites.list_static_site_build_function_app_settings(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Validate a custom domain for a static site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.static_sites.validate_custom_domain_can_be_added_to_static_site(resource_group_name=RESOURCE_GROUP, name=NAME, domain_name=DOMAIN_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Get function app settings of a static site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.static_sites.list_static_site_function_app_settings(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Create an invitation link for a user for a static site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "domain": "happy-sea-15afae3e.azurestaticwebsites.net", - "provider": "aad", - "user_details": "username", - "roles": "admin,contributor", - "num_hours_to_expiration": "1" + "domain": "happy-sea-15afae3e.azurestaticwebsites.net", + "provider": "aad", + "user_details": "username", + "roles": "admin,contributor", + "num_hours_to_expiration": "1", } # result = self.mgmt_client.static_sites.create_user_roles_invitation_link(resource_group_name=RESOURCE_GROUP, name=NAME, static_site_user_roles_invitation_envelope=BODY) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/List secrets for a static site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.list_static_site_secrets(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Reset the api key for a static site[post] -#-------------------------------------------------------------------------- - BODY = { - "should_update_repository": True, - "repository_token": GITHUB_TOKEN - } - result = self.mgmt_client.static_sites.reset_static_site_api_key(resource_group_name=RESOURCE_GROUP, name=NAME, reset_properties_envelope=BODY) + # -------------------------------------------------------------------------- + BODY = {"should_update_repository": True, "repository_token": GITHUB_TOKEN} + result = self.mgmt_client.static_sites.reset_static_site_api_key( + resource_group_name=RESOURCE_GROUP, name=NAME, reset_properties_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Detach a static site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.detach_static_site(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/patch/Patch a static site[patch] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = {} # result = self.mgmt_client.static_sites.update_static_site(resource_group_name=RESOURCE_GROUP, name=NAME, static_site_envelope=BODY) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/delete/Delete a user for a static site[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.static_sites.delete_static_site_user(resource_group_name=RESOURCE_GROUP, name=NAME, authprovider=AUTHPROVIDER, userid=USERID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/delete/Delete a custom domain for a static site[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.static_sites.delete_static_site_custom_domain(resource_group_name=RESOURCE_GROUP, name=NAME, domain_name=DOMAIN_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/delete/Delete a static site build[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.static_sites.delete_static_site_build(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/delete/Delete a static site[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.delete_static_site(resource_group_name=RESOURCE_GROUP, name=NAME) diff --git a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_web.py b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_web.py index 717360ffb356..b8a28f2f282b 100644 --- a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_web.py +++ b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_web.py @@ -1,10 +1,10 @@ # coding: utf-8 -#------------------------------------------------------------------------- +# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # TEST SCENARIO COVERAGE @@ -40,16 +40,15 @@ from devtools_testutils import AzureMgmtTestCase, RandomNameResourceGroupPreparer from devtools_testutils.fake_credentials import FAKE_LOGIN_PASSWORD -AZURE_LOCATION = 'eastus' +AZURE_LOCATION = "eastus" + class MgmtWebSiteTest(AzureMgmtTestCase): def setUp(self): super(MgmtWebSiteTest, self).setUp() - self.mgmt_client = self.create_mgmt_client( - azure.mgmt.web.WebSiteManagementClient - ) - + self.mgmt_client = self.create_mgmt_client(azure.mgmt.web.WebSiteManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) def test_web(self, resource_group): @@ -76,769 +75,995 @@ def test_web(self, resource_group): PR_ID = "myPrId" RESOURCE_HEALTH_METADATA_NAME = "myResourceHealthMetadata" -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/put/Create Or Update App Service plan[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "kind": "app", - "location": AZURE_LOCATION, - "sku": { - "name": "P1", - "tier": "Premium", - "size": "P1", - "family": "P", - "capacity": "1" - } + "kind": "app", + "location": AZURE_LOCATION, + "sku": {"name": "P1", "tier": "Premium", "size": "P1", "family": "P", "capacity": "1"}, } - result = self.mgmt_client.app_service_plans.begin_create_or_update(resource_group_name=RESOURCE_GROUP, name=NAME, app_service_plan=BODY) + result = self.mgmt_client.app_service_plans.begin_create_or_update( + resource_group_name=RESOURCE_GROUP, name=NAME, app_service_plan=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/put/Create or update a static site[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "sku": { - "name": "Basic", - "tier": "Basic" - }, - "repository_url": "https://github.com/username/RepoName", - "branch": "master", - "repository_token": "repoToken123", - "build_properties": { - "app_location": "app", - "api_location": "api", - "app_artifact_location": "build" - } + "location": AZURE_LOCATION, + "sku": {"name": "Basic", "tier": "Basic"}, + "repository_url": "https://github.com/username/RepoName", + "branch": "master", + "repository_token": "repoToken123", + "build_properties": {"app_location": "app", "api_location": "api", "app_artifact_location": "build"}, } - result = self.mgmt_client.static_sites.create_or_update_static_site(resource_group_name=RESOURCE_GROUP, name=NAME, static_site_envelope=BODY) + result = self.mgmt_client.static_sites.create_or_update_static_site( + resource_group_name=RESOURCE_GROUP, name=NAME, static_site_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/put/Create Or Update Certificate[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "host_names": [ - "ServerCert" - ], - "password": FAKE_LOGIN_PASSWORD # this may not work -- check when tests are active + "location": AZURE_LOCATION, + "host_names": ["ServerCert"], + "password": FAKE_LOGIN_PASSWORD, # this may not work -- check when tests are active } - result = self.mgmt_client.certificates.create_or_update(resource_group_name=RESOURCE_GROUP, name=NAME, certificate_envelope=BODY) + result = self.mgmt_client.certificates.create_or_update( + resource_group_name=RESOURCE_GROUP, name=NAME, certificate_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/put/Creates or updates the function app settings of a static site.[put] -#-------------------------------------------------------------------------- - BODY = { - "setting1": "someval", - "setting2": "someval2" - } - result = self.mgmt_client.static_sites.create_or_update_static_site_function_app_settings(resource_group_name=RESOURCE_GROUP, name=NAME, config_name=CONFIG_NAME, app_settings=BODY) + # -------------------------------------------------------------------------- + BODY = {"setting1": "someval", "setting2": "someval2"} + result = self.mgmt_client.static_sites.create_or_update_static_site_function_app_settings( + resource_group_name=RESOURCE_GROUP, name=NAME, config_name=CONFIG_NAME, app_settings=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/put/Create or update a custom domain for a static site[put] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.create_or_update_static_site_custom_domain(resource_group_name=RESOURCE_GROUP, name=NAME, domain_name=DOMAIN_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.create_or_update_static_site_custom_domain( + resource_group_name=RESOURCE_GROUP, name=NAME, domain_name=DOMAIN_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/put/Creates or updates the function app settings of a static site build.[put] -#-------------------------------------------------------------------------- - BODY = { - "setting1": "someval", - "setting2": "someval2" - } - result = self.mgmt_client.static_sites.create_or_update_static_site_build_function_app_settings(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID, config_name=CONFIG_NAME, app_settings=BODY) + # -------------------------------------------------------------------------- + BODY = {"setting1": "someval", "setting2": "someval2"} + result = self.mgmt_client.static_sites.create_or_update_static_site_build_function_app_settings( + resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID, config_name=CONFIG_NAME, app_settings=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/Approves or rejects a private endpoint connection for a site.[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "private_link_service_connection_state": { - "status": "Approved", - "description": "Approved by admin.", - "actions_required": "" - } + "private_link_service_connection_state": { + "status": "Approved", + "description": "Approved by admin.", + "actions_required": "", + } } - result = self.mgmt_client.web_apps.begin_approve_or_reject_private_endpoint_connection(resource_group_name=RESOURCE_GROUP, name=NAME, private_endpoint_connection_name=PRIVATE_ENDPOINT_CONNECTION_NAME, private_endpoint_wrapper=BODY) + result = self.mgmt_client.web_apps.begin_approve_or_reject_private_endpoint_connection( + resource_group_name=RESOURCE_GROUP, + name=NAME, + private_endpoint_connection_name=PRIVATE_ENDPOINT_CONNECTION_NAME, + private_endpoint_wrapper=BODY, + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/Update SCM Allowed[put] -#-------------------------------------------------------------------------- - BODY = { - "allow": True - } - result = self.mgmt_client.web_apps.update_scm_allowed(resource_group_name=RESOURCE_GROUP, name=NAME, basic_publishing_credentials_policy_name=BASIC_PUBLISHING_CREDENTIALS_POLICY_NAME, csm_publishing_access_policies_entity=BODY) + # -------------------------------------------------------------------------- + BODY = {"allow": True} + result = self.mgmt_client.web_apps.update_scm_allowed( + resource_group_name=RESOURCE_GROUP, + name=NAME, + basic_publishing_credentials_policy_name=BASIC_PUBLISHING_CREDENTIALS_POLICY_NAME, + csm_publishing_access_policies_entity=BODY, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/Update FTP Allowed[put] -#-------------------------------------------------------------------------- - BODY = { - "allow": True - } - result = self.mgmt_client.web_apps.update_ftp_allowed(resource_group_name=RESOURCE_GROUP, name=NAME, basic_publishing_credentials_policy_name=BASIC_PUBLISHING_CREDENTIALS_POLICY_NAME, csm_publishing_access_policies_entity=BODY) + # -------------------------------------------------------------------------- + BODY = {"allow": True} + result = self.mgmt_client.web_apps.update_ftp_allowed( + resource_group_name=RESOURCE_GROUP, + name=NAME, + basic_publishing_credentials_policy_name=BASIC_PUBLISHING_CREDENTIALS_POLICY_NAME, + csm_publishing_access_policies_entity=BODY, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get the current status of a network trace operation for a site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_network_trace_operation( + resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Detector[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_detector(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_detector( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + detector_name=DETECTOR_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Detector[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_detector(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_detector( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + detector_name=DETECTOR_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Analysis[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_analysis(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, analysis_name=ANALYSIS_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_analysis( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + analysis_name=ANALYSIS_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Analysis[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_analysis(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, analysis_name=ANALYSIS_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_analysis( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + analysis_name=ANALYSIS_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get FTP Allowed[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_ftp_allowed(resource_group_name=RESOURCE_GROUP, name=NAME, basic_publishing_credentials_policy_name=BASIC_PUBLISHING_CREDENTIALS_POLICY_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_ftp_allowed( + resource_group_name=RESOURCE_GROUP, + name=NAME, + basic_publishing_credentials_policy_name=BASIC_PUBLISHING_CREDENTIALS_POLICY_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get SCM Allowed[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_scm_allowed(resource_group_name=RESOURCE_GROUP, name=NAME, basic_publishing_credentials_policy_name=BASIC_PUBLISHING_CREDENTIALS_POLICY_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_scm_allowed( + resource_group_name=RESOURCE_GROUP, + name=NAME, + basic_publishing_credentials_policy_name=BASIC_PUBLISHING_CREDENTIALS_POLICY_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /ResourceHealthMetadata/get/Get ResourceHealthMetadata[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.resource_health_metadata.get_by_site(resource_group_name=RESOURCE_GROUP, name=NAME, resource_health_metadata_name=RESOURCE_HEALTH_METADATA_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.resource_health_metadata.get_by_site( + resource_group_name=RESOURCE_GROUP, name=NAME, resource_health_metadata_name=RESOURCE_HEALTH_METADATA_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get the current status of a network trace operation for a site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_network_trace_operation( + resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Detector[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_detector(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_detector( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + detector_name=DETECTOR_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Detector[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_detector(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_detector( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + detector_name=DETECTOR_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Analysis[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_analysis(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, analysis_name=ANALYSIS_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_analysis( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + analysis_name=ANALYSIS_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Analysis[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_analysis(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, analysis_name=ANALYSIS_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_analysis( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + analysis_name=ANALYSIS_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Detectors[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_detectors(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_detectors( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Slot Detectors[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_detectors(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_detectors( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Analyses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_analyses(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_analyses( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Slot Analyses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_analyses(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_analyses( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get the current status of a network trace operation for a site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_network_trace_operation( + resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get a private endpoint connection for a site.[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_private_endpoint_connection(resource_group_name=RESOURCE_GROUP, name=NAME, private_endpoint_connection_name=PRIVATE_ENDPOINT_CONNECTION_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_private_endpoint_connection( + resource_group_name=RESOURCE_GROUP, + name=NAME, + private_endpoint_connection_name=PRIVATE_ENDPOINT_CONNECTION_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Diagnostic Category[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_diagnostic_category(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_diagnostic_category( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Diagnostic Category[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_diagnostic_category(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_diagnostic_category( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get Azure Key Vault app setting reference[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_app_setting_key_vault_reference(resource_group_name=RESOURCE_GROUP, name=NAME, config_name=CONFIG_NAME, app_setting_key=APP_SETTING_KEY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_app_setting_key_vault_reference( + resource_group_name=RESOURCE_GROUP, name=NAME, config_name=CONFIG_NAME, app_setting_key=APP_SETTING_KEY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /ResourceHealthMetadata/get/Get ResourceHealthMetadata[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.resource_health_metadata.get_by_site(resource_group_name=RESOURCE_GROUP, name=NAME, resource_health_metadata_name=RESOURCE_HEALTH_METADATA_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.resource_health_metadata.get_by_site( + resource_group_name=RESOURCE_GROUP, name=NAME, resource_health_metadata_name=RESOURCE_HEALTH_METADATA_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Detectors[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_detectors(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_detectors( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Slot Detectors[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_detectors(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_detectors( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Analyses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_analyses(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_analyses( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Slot Analyses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_analyses(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_analyses( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Detector Response[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_detector_response(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_detector_response( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, detector_name=DETECTOR_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Detector Response[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_detector_response(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_detector_response( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, detector_name=DETECTOR_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get the current status of a network trace operation for a site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_network_trace_operation( + resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServiceEnvironments/get/Get Outbound Network Dependencies Endpoints[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.app_service_environments.get_outbound_network_dependencies_endpoints(resource_group_name=RESOURCE_GROUP, name=NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.app_service_environments.get_outbound_network_dependencies_endpoints( + resource_group_name=RESOURCE_GROUP, name=NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get NetworkTraces for a site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_network_traces(resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_network_traces( + resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServiceEnvironments/get/Get Inbound Network Dependencies Endpoints[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.app_service_environments.get_inbound_network_dependencies_endpoints(resource_group_name=RESOURCE_GROUP, name=NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.app_service_environments.get_inbound_network_dependencies_endpoints( + resource_group_name=RESOURCE_GROUP, name=NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get NetworkTraces for a site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_network_traces(resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_network_traces( + resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get site instance info[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_instance_info(resource_group_name=RESOURCE_GROUP, name=NAME, instance_id=INSTANCE_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_instance_info( + resource_group_name=RESOURCE_GROUP, name=NAME, instance_id=INSTANCE_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Service Environment Detector Responses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_hosting_environment_detector_responses(resource_group_name=RESOURCE_GROUP, name=NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_hosting_environment_detector_responses( + resource_group_name=RESOURCE_GROUP, name=NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Diagnostic Category[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_diagnostic_category(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_diagnostic_category( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Diagnostic Category[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_diagnostic_category(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_diagnostic_category( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /ResourceHealthMetadata/get/List ResourceHealthMetadata for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.resource_health_metadata.list_by_site(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get Azure Key Vault references for app settings[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_app_settings_key_vault_references(resource_group_name=RESOURCE_GROUP, name=NAME, config_name=CONFIG_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_app_settings_key_vault_references( + resource_group_name=RESOURCE_GROUP, name=NAME, config_name=CONFIG_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Detector Response[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_detector_response(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_detector_response( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, detector_name=DETECTOR_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Detector Response[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.get_site_detector_response(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.get_site_detector_response( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, detector_name=DETECTOR_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/List Publishing Credentials Policies[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_basic_publishing_credentials_policies(resource_group_name=RESOURCE_GROUP, name=NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_basic_publishing_credentials_policies( + resource_group_name=RESOURCE_GROUP, name=NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Gets the functions of a particular static site build[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.list_static_site_build_functions(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.list_static_site_build_functions( + resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Diagnostic Categories[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_diagnostic_categories(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_diagnostic_categories( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Slot Diagnostic Categories[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_diagnostic_categories(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_diagnostic_categories( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get NetworkTraces for a site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_network_traces(resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_network_traces( + resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Detector Responses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_detector_responses(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_detector_responses( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Detector Responses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_detector_responses(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_detector_responses( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get NetworkTraces for a site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_network_traces(resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_network_traces( + resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get site instance info[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_instance_info(resource_group_name=RESOURCE_GROUP, name=NAME, instance_id=INSTANCE_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_instance_info( + resource_group_name=RESOURCE_GROUP, name=NAME, instance_id=INSTANCE_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get a static site build[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.get_static_site_build(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.get_static_site_build( + resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Service Environment Detector Responses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_hosting_environment_detector_responses(resource_group_name=RESOURCE_GROUP, name=NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_hosting_environment_detector_responses( + resource_group_name=RESOURCE_GROUP, name=NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /ResourceHealthMetadata/get/List ResourceHealthMetadata for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.resource_health_metadata.list_by_site(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get private link resources of a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.get_private_link_resources(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/List custom domains for a static site[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.list_static_site_custom_domains(resource_group_name=RESOURCE_GROUP, name=NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.list_static_site_custom_domains( + resource_group_name=RESOURCE_GROUP, name=NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Diagnostic Categories[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_diagnostic_categories(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_diagnostic_categories( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/List App Slot Diagnostic Categories[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_diagnostic_categories(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_diagnostic_categories( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Gets the functions of a static site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.list_static_site_functions(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Detector Responses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_detector_responses(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_detector_responses( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/get/Get App Slot Detector Responses[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.list_site_detector_responses(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.list_site_detector_responses( + resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /DeletedWebApps/get/Get Deleted Web App by Location[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.deleted_web_apps.get_deleted_web_app_by_location(azure_location=AZURE_LOCATION, deleted_site_id=DELETED_SITE_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.deleted_web_apps.get_deleted_web_app_by_location( + azure_location=AZURE_LOCATION, deleted_site_id=DELETED_SITE_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get all builds for a static site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.get_static_site_builds(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/get/Get Certificate[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificates.get(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get details for a static site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.get_static_site(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/get/Get App Service plan[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.app_service_plans.get(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /ResourceHealthMetadata/get/List ResourceHealthMetadata for a resource group[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.resource_health_metadata.list_by_resource_group(resource_group_name=RESOURCE_GROUP) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/get/List Certificates by resource group[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificates.list_by_resource_group(resource_group_name=RESOURCE_GROUP) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get static sites for a resource group[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.get_static_sites_by_resource_group(resource_group_name=RESOURCE_GROUP) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/get/List App Service plans by resource group[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.app_service_plans.list_by_resource_group(resource_group_name=RESOURCE_GROUP) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /DeletedWebApps/get/List Deleted Web App by Location[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.deleted_web_apps.list_by_location(azure_location=AZURE_LOCATION) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /TopLevelDomains/get/Get Top Level Domain[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.top_level_domains.get(name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /TopLevelDomains/get/List Top Level Domains[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.top_level_domains.list() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /ResourceHealthMetadata/get/List ResourceHealthMetadata for a subscription[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.resource_health_metadata.list() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/get/List Certificates for subscription[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificates.list() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/get/Get all static sites in a subscription[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.list() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/get/List App Service plans[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.app_service_plans.list() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /CertificateRegistrationProvider/get/List operations[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificate_registration_provider.list_operations() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /DomainRegistrationProvider/get/List operations[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.domain_registration_provider.list_operations() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Provider/get/List operations[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.provider.list_operations() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/post/Execute site detector[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.execute_site_detector(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.execute_site_detector( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + detector_name=DETECTOR_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/post/Execute site slot detector[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.execute_site_detector(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.execute_site_detector( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + detector_name=DETECTOR_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/post/Execute site slot analysis[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.execute_site_analysis(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, analysis_name=ANALYSIS_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.execute_site_analysis( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + analysis_name=ANALYSIS_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/post/Execute site analysis[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.execute_site_analysis(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, analysis_name=ANALYSIS_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.execute_site_analysis( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + analysis_name=ANALYSIS_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/post/Execute site detector[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.execute_site_detector(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.execute_site_detector( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + detector_name=DETECTOR_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/post/Execute site slot detector[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.execute_site_detector(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, detector_name=DETECTOR_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.execute_site_detector( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + detector_name=DETECTOR_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/post/Execute site slot analysis[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.execute_site_analysis(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, analysis_name=ANALYSIS_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.execute_site_analysis( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + analysis_name=ANALYSIS_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Diagnostics/post/Execute site analysis[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.diagnostics.execute_site_analysis(resource_group_name=RESOURCE_GROUP, site_name=SITE_NAME, diagnostic_category=DIAGNOSTIC_CATEGORY, analysis_name=ANALYSIS_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.diagnostics.execute_site_analysis( + resource_group_name=RESOURCE_GROUP, + site_name=SITE_NAME, + diagnostic_category=DIAGNOSTIC_CATEGORY, + analysis_name=ANALYSIS_NAME, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/patch/Create or update a user for a static site[patch] -#-------------------------------------------------------------------------- - BODY = { - "roles": "contributor" - } - result = self.mgmt_client.static_sites.update_static_site_user(resource_group_name=RESOURCE_GROUP, name=NAME, authprovider=AUTHPROVIDER, userid=USERID, static_site_user_envelope=BODY) + # -------------------------------------------------------------------------- + BODY = {"roles": "contributor"} + result = self.mgmt_client.static_sites.update_static_site_user( + resource_group_name=RESOURCE_GROUP, + name=NAME, + authprovider=AUTHPROVIDER, + userid=USERID, + static_site_user_envelope=BODY, + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Start a new network trace operation for a site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME, duration_in_seconds="60") + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation( + resource_group_name=RESOURCE_GROUP, + name=NAME, + network_trace_name=NETWORK_TRACE_NAME, + duration_in_seconds="60", + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Stop a currently running network trace operation for a site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.stop_web_site_network_trace(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.stop_web_site_network_trace( + resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/List users for a static site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.list_static_site_users(resource_group_name=RESOURCE_GROUP, name=NAME, authprovider=AUTHPROVIDER) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.list_static_site_users( + resource_group_name=RESOURCE_GROUP, name=NAME, authprovider=AUTHPROVIDER + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Get function app settings of a static site build[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.list_static_site_build_function_app_settings(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.list_static_site_build_function_app_settings( + resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Validate a custom domain for a static site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.validate_custom_domain_can_be_added_to_static_site(resource_group_name=RESOURCE_GROUP, name=NAME, domain_name=DOMAIN_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.validate_custom_domain_can_be_added_to_static_site( + resource_group_name=RESOURCE_GROUP, name=NAME, domain_name=DOMAIN_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Start a new network trace operation for a site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME, duration_in_seconds="60") + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation( + resource_group_name=RESOURCE_GROUP, + name=NAME, + network_trace_name=NETWORK_TRACE_NAME, + duration_in_seconds="60", + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Stop a currently running network trace operation for a site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.stop_web_site_network_trace(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.stop_web_site_network_trace( + resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Start a new network trace operation for a site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME, duration_in_seconds="60") + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation( + resource_group_name=RESOURCE_GROUP, + name=NAME, + network_trace_name=NETWORK_TRACE_NAME, + duration_in_seconds="60", + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Stop a currently running network trace operation for a site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.stop_web_site_network_trace(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.stop_web_site_network_trace( + resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Domains/post/Renew an existing domain[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.domains.renew(resource_group_name=RESOURCE_GROUP, domain_name=DOMAIN_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Get function app settings of a static site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.list_static_site_function_app_settings(resource_group_name=RESOURCE_GROUP, name=NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.list_static_site_function_app_settings( + resource_group_name=RESOURCE_GROUP, name=NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/List backups[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.list_site_backups(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Create an invitation link for a user for a static site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "domain": "happy-sea-15afae3e.azurestaticwebsites.net", - "provider": "aad", - "user_details": "username", - "roles": "admin,contributor", - "num_hours_to_expiration": "1" + "domain": "happy-sea-15afae3e.azurestaticwebsites.net", + "provider": "aad", + "user_details": "username", + "roles": "admin,contributor", + "num_hours_to_expiration": "1", } - result = self.mgmt_client.static_sites.create_user_roles_invitation_link(resource_group_name=RESOURCE_GROUP, name=NAME, static_site_user_roles_invitation_envelope=BODY) + result = self.mgmt_client.static_sites.create_user_roles_invitation_link( + resource_group_name=RESOURCE_GROUP, name=NAME, static_site_user_roles_invitation_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Copy slot[post] -#-------------------------------------------------------------------------- - BODY = { - "target_slot": "staging", - "site_config": { - "number_of_workers": "1", - "http_logging_enabled": True - } - } - result = self.mgmt_client.web_apps.begin_copy_production_slot(resource_group_name=RESOURCE_GROUP, name=NAME, copy_slot_entity=BODY) + # -------------------------------------------------------------------------- + BODY = {"target_slot": "staging", "site_config": {"number_of_workers": "1", "http_logging_enabled": True}} + result = self.mgmt_client.web_apps.begin_copy_production_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, copy_slot_entity=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Start a new network trace operation for a site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME, duration_in_seconds="60") + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation( + resource_group_name=RESOURCE_GROUP, + name=NAME, + network_trace_name=NETWORK_TRACE_NAME, + duration_in_seconds="60", + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/List secrets for a static site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.list_static_site_secrets(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Reset the api key for a static site[post] -#-------------------------------------------------------------------------- - BODY = { - "should_update_repository": True, - "repository_token": "repoToken123" - } - result = self.mgmt_client.static_sites.reset_static_site_api_key(resource_group_name=RESOURCE_GROUP, name=NAME, reset_properties_envelope=BODY) + # -------------------------------------------------------------------------- + BODY = {"should_update_repository": True, "repository_token": "repoToken123"} + result = self.mgmt_client.static_sites.reset_static_site_api_key( + resource_group_name=RESOURCE_GROUP, name=NAME, reset_properties_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Stop a currently running network trace operation for a site[post] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.stop_web_site_network_trace(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.stop_web_site_network_trace( + resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/post/Detach a static site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.detach_static_site(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/List backups[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.list_site_backups(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Copy slot[post] -#-------------------------------------------------------------------------- - BODY = { - "target_slot": "staging", - "site_config": { - "number_of_workers": "1", - "http_logging_enabled": True - } - } - result = self.mgmt_client.web_apps.begin_copy_production_slot(resource_group_name=RESOURCE_GROUP, name=NAME, copy_slot_entity=BODY) + # -------------------------------------------------------------------------- + BODY = {"target_slot": "staging", "site_config": {"number_of_workers": "1", "http_logging_enabled": True}} + result = self.mgmt_client.web_apps.begin_copy_production_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, copy_slot_entity=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/patch/Patch Certificate[patch] -#-------------------------------------------------------------------------- - BODY = { - "password": FAKE_LOGIN_PASSWORD # this may not work -- check when tests are active - } - result = self.mgmt_client.certificates.update(resource_group_name=RESOURCE_GROUP, name=NAME, certificate_envelope=BODY) + # -------------------------------------------------------------------------- + BODY = {"password": FAKE_LOGIN_PASSWORD} # this may not work -- check when tests are active + result = self.mgmt_client.certificates.update( + resource_group_name=RESOURCE_GROUP, name=NAME, certificate_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/patch/Patch a static site[patch] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = {} - result = self.mgmt_client.static_sites.update_static_site(resource_group_name=RESOURCE_GROUP, name=NAME, static_site_envelope=BODY) + result = self.mgmt_client.static_sites.update_static_site( + resource_group_name=RESOURCE_GROUP, name=NAME, static_site_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/patch/Patch Service plan[patch] -#-------------------------------------------------------------------------- - BODY = { - "kind": "app" - } - result = self.mgmt_client.app_service_plans.update(resource_group_name=RESOURCE_GROUP, name=NAME, app_service_plan=BODY) + # -------------------------------------------------------------------------- + BODY = {"kind": "app"} + result = self.mgmt_client.app_service_plans.update( + resource_group_name=RESOURCE_GROUP, name=NAME, app_service_plan=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /TopLevelDomains/post/List Top Level Domain Agreements[post] -#-------------------------------------------------------------------------- - BODY = { - "include_privacy": True, - "for_transfer": False - } + # -------------------------------------------------------------------------- + BODY = {"include_privacy": True, "for_transfer": False} result = self.mgmt_client.top_level_domains.list_agreements(name=NAME, agreement_option=BODY) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # //post/VerifyHostingEnvironmentVnet[post] -#-------------------------------------------------------------------------- - BODY = { - "vnet_resource_group": "vNet123rg", - "vnet_name": "vNet123", - "vnet_subnet_name": "vNet123SubNet" - } + # -------------------------------------------------------------------------- + BODY = {"vnet_resource_group": "vNet123rg", "vnet_name": "vNet123", "vnet_subnet_name": "vNet123SubNet"} result = self.mgmt_client.verify_hosting_environment_vnet(parameters=BODY) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/delete/Delete a private endpoint connection for a site.[delete] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.begin_delete_private_endpoint_connection(resource_group_name=RESOURCE_GROUP, name=NAME, private_endpoint_connection_name=PRIVATE_ENDPOINT_CONNECTION_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.begin_delete_private_endpoint_connection( + resource_group_name=RESOURCE_GROUP, + name=NAME, + private_endpoint_connection_name=PRIVATE_ENDPOINT_CONNECTION_NAME, + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/delete/Delete a user for a static site[delete] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.delete_static_site_user(resource_group_name=RESOURCE_GROUP, name=NAME, authprovider=AUTHPROVIDER, userid=USERID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.delete_static_site_user( + resource_group_name=RESOURCE_GROUP, name=NAME, authprovider=AUTHPROVIDER, userid=USERID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/delete/Delete a custom domain for a static site[delete] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.delete_static_site_custom_domain(resource_group_name=RESOURCE_GROUP, name=NAME, domain_name=DOMAIN_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.delete_static_site_custom_domain( + resource_group_name=RESOURCE_GROUP, name=NAME, domain_name=DOMAIN_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/delete/Delete a static site build[delete] -#-------------------------------------------------------------------------- - result = self.mgmt_client.static_sites.delete_static_site_build(resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID) + # -------------------------------------------------------------------------- + result = self.mgmt_client.static_sites.delete_static_site_build( + resource_group_name=RESOURCE_GROUP, name=NAME, pr_id=PR_ID + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /Certificates/delete/Delete Certificate[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.certificates.delete(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /StaticSites/delete/Delete a static site[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.static_sites.delete_static_site(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/delete/Delete App Service plan[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.app_service_plans.delete(resource_group_name=RESOURCE_GROUP, name=NAME) -#------------------------------------------------------------------------------ -if __name__ == '__main__': +# ------------------------------------------------------------------------------ +if __name__ == "__main__": unittest.main() diff --git a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_web_app.py b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_web_app.py index dba604400703..bef1e493696e 100644 --- a/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_web_app.py +++ b/sdk/appservice/azure-mgmt-web/tests/disable_test_cli_mgmt_web_app.py @@ -1,10 +1,10 @@ # coding: utf-8 -#------------------------------------------------------------------------- +# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Current Operation Coverage: # WebApps: 31/372 @@ -14,17 +14,16 @@ import azure.mgmt.web from devtools_testutils import AzureMgmtTestCase, RandomNameResourceGroupPreparer -AZURE_LOCATION = 'eastus' +AZURE_LOCATION = "eastus" + class MgmtWebSiteTest(AzureMgmtTestCase): def setUp(self): super(MgmtWebSiteTest, self).setUp() - self.mgmt_client = self.create_mgmt_client( - azure.mgmt.web.WebSiteManagementClient - ) + self.mgmt_client = self.create_mgmt_client(azure.mgmt.web.WebSiteManagementClient) - @unittest.skip('skip temporarily') + @unittest.skip("skip temporarily") @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) def test_web_app_slot(self, resource_group): # covered: 15 @@ -37,312 +36,308 @@ def test_web_app_slot(self, resource_group): APP_SERVICE_PLAN_NAME = "myappserviceplan" SITE_SOURCE_CONTROL = "web" -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/put/Create Or Update App Service plan[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "sku": { - "name": "S1", - "tier": "STANDARD", - "capacity": "1" - }, - "per_site_scaling": False, - "is_xenon": False + "location": AZURE_LOCATION, + "sku": {"name": "S1", "tier": "STANDARD", "capacity": "1"}, + "per_site_scaling": False, + "is_xenon": False, } - result = self.mgmt_client.app_service_plans.begin_create_or_update(resource_group_name=RESOURCE_GROUP, name=APP_SERVICE_PLAN_NAME, app_service_plan=BODY) + result = self.mgmt_client.app_service_plans.begin_create_or_update( + resource_group_name=RESOURCE_GROUP, name=APP_SERVICE_PLAN_NAME, app_service_plan=BODY + ) service_farm = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/Create[put] -#-------------------------------------------------------------------------- - BODY = { - "location": AZURE_LOCATION, - "server_farm_id": service_farm.id, - "reserved": False, - "is_xenon": False, - "hyper_v": False, - "site_config": { - "net_framework_version":"v4.6", - "app_settings": [ - {"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "10.14"} - ], - "local_my_sql_enabled": False, - "http20_enabled": True - }, - "scm_site_also_stopped": False, - "https_only": False - } - result = self.mgmt_client.web_apps.begin_create_or_update(resource_group_name=RESOURCE_GROUP, name=NAME, site_envelope=BODY) - result = result.result() - -#-------------------------------------------------------------------------- - # /WebApps/put/CreateSlot[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "properties": { + "location": AZURE_LOCATION, "server_farm_id": service_farm.id, "reserved": False, "is_xenon": False, "hyper_v": False, "site_config": { - "net_framework_version": "v4.6", - "local_my_sql_enabled": False, - "http20_enabled": True + "net_framework_version": "v4.6", + "app_settings": [{"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "10.14"}], + "local_my_sql_enabled": False, + "http20_enabled": True, }, - "scm_site_also_stopped": False - } + "scm_site_also_stopped": False, + "https_only": False, } - result = self.mgmt_client.web_apps.begin_create_or_update_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_envelope=BODY) + result = self.mgmt_client.web_apps.begin_create_or_update( + resource_group_name=RESOURCE_GROUP, name=NAME, site_envelope=BODY + ) result = result.result() -#-------------------------------------------------------------------------- - # /WebApps/put/CreateConfigurationSlot[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- + # /WebApps/put/CreateSlot[put] + # -------------------------------------------------------------------------- BODY = { - "properties": { - "number_of_workers": 1, - "default_documents": [ - "Default.htm", - "Default.html", - "Default.asp", - "index.htm", - "index.html", - "iisstart.htm", - "default.aspx", - "index.php", - "hostingstart.html" - ], - "net_framework_version": "v3.5", - "php_version": "7.2", - "python_version": "3.4", - "node_version": "", - "power_shell_version": "", - "linux_fx_version": "", - "request_tracing_enabled": False, - "remote_debugging_enabled": False, - "http_logging_enabled": False, - "logs_directory_size_limit": 35, - "detailed_error_logging_enabled": False, - "publishing_username": "$webapp-config-test000002", - "scm_type": "None", - "use32_bit_worker_process": False, - "webSocketsEnabled": True, - "always_on": True, - "app_command_line": "", - "managed_pipeline_mode": "Integrated", - "virtual_applications": [ - { - "virtual_path": "/", - "physical_path": "site\\wwwroot", - "preload_enabled": True - } - ], - "load_balancing": "LeastRequests", - "experiments": { - "ramp_up_rules": [] + "location": AZURE_LOCATION, + "properties": { + "server_farm_id": service_farm.id, + "reserved": False, + "is_xenon": False, + "hyper_v": False, + "site_config": {"net_framework_version": "v4.6", "local_my_sql_enabled": False, "http20_enabled": True}, + "scm_site_also_stopped": False, }, - "auto_heal_enabled": True, - "vnet_name": "", - "local_my_sql_enabled": False, - "ip_security_restrictions": [ - { - "ip_address": "Any", - "action": "Allow", - "priority": 1, - "name": "Allow all", - "description": "Allow all access" - } - ], - "scm_ip_security_restrictions": [ - { - "ip_address": "Any", - "action": "Allow", - "priority": 1, - "name": "Allow all", - "description": "Allow all access" - } - ], - "scm_ip_security_restrictions_use_main": False, - "http20_enabled": True, - "min_tls_version": "1.0", - "ftps_state": "Disabled", - "preWarmedInstanceCount": 0 - } } - result = self.mgmt_client.web_apps.create_or_update_configuration_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_config=BODY) + result = self.mgmt_client.web_apps.begin_create_or_update_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_envelope=BODY + ) + result = result.result() + + # -------------------------------------------------------------------------- + # /WebApps/put/CreateConfigurationSlot[put] + # -------------------------------------------------------------------------- + BODY = { + "properties": { + "number_of_workers": 1, + "default_documents": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html", + ], + "net_framework_version": "v3.5", + "php_version": "7.2", + "python_version": "3.4", + "node_version": "", + "power_shell_version": "", + "linux_fx_version": "", + "request_tracing_enabled": False, + "remote_debugging_enabled": False, + "http_logging_enabled": False, + "logs_directory_size_limit": 35, + "detailed_error_logging_enabled": False, + "publishing_username": "$webapp-config-test000002", + "scm_type": "None", + "use32_bit_worker_process": False, + "webSocketsEnabled": True, + "always_on": True, + "app_command_line": "", + "managed_pipeline_mode": "Integrated", + "virtual_applications": [ + {"virtual_path": "/", "physical_path": "site\\wwwroot", "preload_enabled": True} + ], + "load_balancing": "LeastRequests", + "experiments": {"ramp_up_rules": []}, + "auto_heal_enabled": True, + "vnet_name": "", + "local_my_sql_enabled": False, + "ip_security_restrictions": [ + { + "ip_address": "Any", + "action": "Allow", + "priority": 1, + "name": "Allow all", + "description": "Allow all access", + } + ], + "scm_ip_security_restrictions": [ + { + "ip_address": "Any", + "action": "Allow", + "priority": 1, + "name": "Allow all", + "description": "Allow all access", + } + ], + "scm_ip_security_restrictions_use_main": False, + "http20_enabled": True, + "min_tls_version": "1.0", + "ftps_state": "Disabled", + "preWarmedInstanceCount": 0, + } + } + result = self.mgmt_client.web_apps.create_or_update_configuration_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_config=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/CreateSourceControlSlot[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "repo_url": "https://github.com/00Kai0/azure-site-test", - "branch": "staging", - "is_manual_integration": True, - "is_mercurial": False + "repo_url": "https://github.com/00Kai0/azure-site-test", + "branch": "staging", + "is_manual_integration": True, + "is_mercurial": False, } - result = self.mgmt_client.web_apps.begin_create_or_update_source_control_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_source_control=BODY) + result = self.mgmt_client.web_apps.begin_create_or_update_source_control_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_source_control=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/GetSlot[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.get_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/GetConfigurationSlot[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_configuration_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_configuration_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/GetSlot[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.list_slots(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/GetSourceControlSlot[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_source_control_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_source_control_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/patch/UpdateSlot[patch] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "properties": { - "server_farm_id": service_farm.id, - "reserved": False, - "is_xenon": False, - "hyper_v": False, - "site_config": { - "net_framework_version": "v4.6", - "local_my_sql_enabled": False, - "http20_enabled": True + "location": AZURE_LOCATION, + "properties": { + "server_farm_id": service_farm.id, + "reserved": False, + "is_xenon": False, + "hyper_v": False, + "site_config": {"net_framework_version": "v4.6", "local_my_sql_enabled": False, "http20_enabled": True}, + "scm_site_also_stopped": False, }, - "scm_site_also_stopped": False - } } - result = self.mgmt_client.web_apps.update_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_envelope=BODY) + result = self.mgmt_client.web_apps.update_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_envelope=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/patch/UpdateConfigurationSlot -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "properties": { - "number_of_workers": 1, - "default_documents": [ - "Default.htm", - "Default.html", - "Default.asp", - "index.htm", - "index.html", - "iisstart.htm", - "default.aspx", - "index.php", - "hostingstart.html" - ], - "net_framework_version": "v3.5", - "php_version": "7.2", - "python_version": "3.4", - "node_version": "", - "power_shell_version": "", - "linux_fx_version": "", - "request_tracing_enabled": False, - "remote_debugging_enabled": False, - "http_logging_enabled": False, - "logs_directory_size_limit": 35, - "detailed_error_logging_enabled": False, - "publishing_username": "$webapp-config-test000002", - "scm_type": "None", - "use32_bit_worker_process": False, - "webSocketsEnabled": True, - "always_on": True, - "app_command_line": "", - "managed_pipeline_mode": "Integrated", - "virtual_applications": [ - { - "virtual_path": "/", - "physical_path": "site\\wwwroot", - "preload_enabled": True - } - ], - "load_balancing": "LeastRequests", - "experiments": { - "ramp_up_rules": [] - }, - "auto_heal_enabled": True, - "vnet_name": "", - "local_my_sql_enabled": False, - "ip_security_restrictions": [ - { - "ip_address": "Any", - "action": "Allow", - "priority": 1, - "name": "Allow all", - "description": "Allow all access" - } - ], - "scm_ip_security_restrictions": [ - { - "ip_address": "Any", - "action": "Allow", - "priority": 1, - "name": "Allow all", - "description": "Allow all access" - } - ], - "scm_ip_security_restrictions_use_main": False, - "http20_enabled": True, - "min_tls_version": "1.0", - "ftps_state": "Disabled", - "preWarmedInstanceCount": 0 - } + "properties": { + "number_of_workers": 1, + "default_documents": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html", + ], + "net_framework_version": "v3.5", + "php_version": "7.2", + "python_version": "3.4", + "node_version": "", + "power_shell_version": "", + "linux_fx_version": "", + "request_tracing_enabled": False, + "remote_debugging_enabled": False, + "http_logging_enabled": False, + "logs_directory_size_limit": 35, + "detailed_error_logging_enabled": False, + "publishing_username": "$webapp-config-test000002", + "scm_type": "None", + "use32_bit_worker_process": False, + "webSocketsEnabled": True, + "always_on": True, + "app_command_line": "", + "managed_pipeline_mode": "Integrated", + "virtual_applications": [ + {"virtual_path": "/", "physical_path": "site\\wwwroot", "preload_enabled": True} + ], + "load_balancing": "LeastRequests", + "experiments": {"ramp_up_rules": []}, + "auto_heal_enabled": True, + "vnet_name": "", + "local_my_sql_enabled": False, + "ip_security_restrictions": [ + { + "ip_address": "Any", + "action": "Allow", + "priority": 1, + "name": "Allow all", + "description": "Allow all access", + } + ], + "scm_ip_security_restrictions": [ + { + "ip_address": "Any", + "action": "Allow", + "priority": 1, + "name": "Allow all", + "description": "Allow all access", + } + ], + "scm_ip_security_restrictions_use_main": False, + "http20_enabled": True, + "min_tls_version": "1.0", + "ftps_state": "Disabled", + "preWarmedInstanceCount": 0, + } } - result = self.mgmt_client.web_apps.update_configuration_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_config=BODY) + result = self.mgmt_client.web_apps.update_configuration_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_config=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/patch/UpdateSourceControlSlot[patch] -#-------------------------------------------------------------------------- - BODY ={ - "repo_url": "https://github.com/00Kai0/azure-site-test", - "branch": "staging", - "is_manual_integration": True, - "is_mercurial": False + # -------------------------------------------------------------------------- + BODY = { + "repo_url": "https://github.com/00Kai0/azure-site-test", + "branch": "staging", + "is_manual_integration": True, + "is_mercurial": False, } - result = self.mgmt_client.web_apps.update_source_control_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_source_control=BODY) + result = self.mgmt_client.web_apps.update_source_control_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME, site_source_control=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/StartSlot -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.start_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/RestartSlot -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.restart_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/StopSlot -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.stop_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/delete/DeleteSourceControlSlot[delete] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.delete_source_control_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.delete_source_control_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/delete/DeleteSlot[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.delete_slot(resource_group_name=RESOURCE_GROUP, name=NAME, slot=SLOT_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/delete/Delete -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.delete(resource_group_name=RESOURCE_GROUP, name=NAME) - @unittest.skip('skip temporarily') + @unittest.skip("skip temporarily") @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) def test_web_app(self, resource_group): # coverd: 16 @@ -353,291 +348,283 @@ def test_web_app(self, resource_group): NAME = "mysitexxyzz" APP_SERVICE_PLAN_NAME = "myappserviceplan" -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/put/Create Or Update App Service plan[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "sku": { - "name": "B1", - "tier": "BASIC", - "capacity": "1" - }, - "per_site_scaling": False, - "is_xenon": False + "location": AZURE_LOCATION, + "sku": {"name": "B1", "tier": "BASIC", "capacity": "1"}, + "per_site_scaling": False, + "is_xenon": False, } - result = self.mgmt_client.app_service_plans.begin_create_or_update(resource_group_name=RESOURCE_GROUP, name=APP_SERVICE_PLAN_NAME, app_service_plan=BODY) + result = self.mgmt_client.app_service_plans.begin_create_or_update( + resource_group_name=RESOURCE_GROUP, name=APP_SERVICE_PLAN_NAME, app_service_plan=BODY + ) service_farm = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/Create[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "server_farm_id": service_farm.id, - "reserved": False, - "is_xenon": False, - "hyper_v": False, - "site_config": { - "net_framework_version":"v4.6", - "app_settings": [ - {"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "10.14"} - ], - "local_my_sql_enabled": False, - "http20_enabled": True - }, - "scm_site_also_stopped": False, - "https_only": False + "location": AZURE_LOCATION, + "server_farm_id": service_farm.id, + "reserved": False, + "is_xenon": False, + "hyper_v": False, + "site_config": { + "net_framework_version": "v4.6", + "app_settings": [{"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "10.14"}], + "local_my_sql_enabled": False, + "http20_enabled": True, + }, + "scm_site_also_stopped": False, + "https_only": False, } - result = self.mgmt_client.web_apps.begin_create_or_update(resource_group_name=RESOURCE_GROUP, name=NAME, site_envelope=BODY) + result = self.mgmt_client.web_apps.begin_create_or_update( + resource_group_name=RESOURCE_GROUP, name=NAME, site_envelope=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/CreateConfig[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "properties": { - "number_of_workers": 1, - "default_documents": [ - "Default.htm", - "Default.html", - "Default.asp", - "index.htm", - "index.html", - "iisstart.htm", - "default.aspx", - "index.php", - "hostingstart.html" - ], - "net_framework_version": "v3.5", - "php_version": "7.2", - "python_version": "3.4", - "node_version": "", - "power_shell_version": "", - "linux_fx_version": "", - "request_tracing_enabled": False, - "remote_debugging_enabled": False, - "http_logging_enabled": False, - "logs_directory_size_limit": 35, - "detailed_error_logging_enabled": False, - "publishing_username": "$webapp-config-test000002", - "scm_type": "None", - "use32_bit_worker_process": False, - "webSocketsEnabled": True, - "always_on": True, - "app_command_line": "", - "managed_pipeline_mode": "Integrated", - "virtual_applications": [ - { - "virtual_path": "/", - "physical_path": "site\\wwwroot", - "preload_enabled": True - } - ], - "load_balancing": "LeastRequests", - "experiments": { - "ramp_up_rules": [] - }, - "auto_heal_enabled": True, - "vnet_name": "", - "local_my_sql_enabled": False, - "ip_security_restrictions": [ - { - "ip_address": "Any", - "action": "Allow", - "priority": 1, - "name": "Allow all", - "description": "Allow all access" - } - ], - "scm_ip_security_restrictions": [ - { - "ip_address": "Any", - "action": "Allow", - "priority": 1, - "name": "Allow all", - "description": "Allow all access" - } - ], - "scm_ip_security_restrictions_use_main": False, - "http20_enabled": True, - "min_tls_version": "1.0", - "ftps_state": "Disabled", - "preWarmedInstanceCount": 0 - } + "properties": { + "number_of_workers": 1, + "default_documents": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html", + ], + "net_framework_version": "v3.5", + "php_version": "7.2", + "python_version": "3.4", + "node_version": "", + "power_shell_version": "", + "linux_fx_version": "", + "request_tracing_enabled": False, + "remote_debugging_enabled": False, + "http_logging_enabled": False, + "logs_directory_size_limit": 35, + "detailed_error_logging_enabled": False, + "publishing_username": "$webapp-config-test000002", + "scm_type": "None", + "use32_bit_worker_process": False, + "webSocketsEnabled": True, + "always_on": True, + "app_command_line": "", + "managed_pipeline_mode": "Integrated", + "virtual_applications": [ + {"virtual_path": "/", "physical_path": "site\\wwwroot", "preload_enabled": True} + ], + "load_balancing": "LeastRequests", + "experiments": {"ramp_up_rules": []}, + "auto_heal_enabled": True, + "vnet_name": "", + "local_my_sql_enabled": False, + "ip_security_restrictions": [ + { + "ip_address": "Any", + "action": "Allow", + "priority": 1, + "name": "Allow all", + "description": "Allow all access", + } + ], + "scm_ip_security_restrictions": [ + { + "ip_address": "Any", + "action": "Allow", + "priority": 1, + "name": "Allow all", + "description": "Allow all access", + } + ], + "scm_ip_security_restrictions_use_main": False, + "http20_enabled": True, + "min_tls_version": "1.0", + "ftps_state": "Disabled", + "preWarmedInstanceCount": 0, + } } - result = self.mgmt_client.web_apps.create_or_update_configuration(resource_group_name=RESOURCE_GROUP, name=NAME, site_config=BODY) + result = self.mgmt_client.web_apps.create_or_update_configuration( + resource_group_name=RESOURCE_GROUP, name=NAME, site_config=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/CreateSourceControl[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "repo_url": "https://github.com/00Kai0/azure-site-test", - "branch": "staging", - "is_manual_integration": True, - "is_mercurial": False + "repo_url": "https://github.com/00Kai0/azure-site-test", + "branch": "staging", + "is_manual_integration": True, + "is_mercurial": False, } - result = self.mgmt_client.web_apps.begin_create_or_update_source_control(resource_group_name=RESOURCE_GROUP, name=NAME, site_source_control=BODY) + result = self.mgmt_client.web_apps.begin_create_or_update_source_control( + resource_group_name=RESOURCE_GROUP, name=NAME, site_source_control=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/GetConfig -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.get_configuration(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.get(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/GetSourceControl -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.get_source_control(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/List -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.list() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/ListConfig -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.list_configurations(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/patch/Update[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - # "serverFarmId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/webapp-linux-plan000002", - "server_farm_id": service_farm.id, - "reserved": False, - "is_xenon": False, - "hyper_v": False, - "site_config": { - "net_framework_version":"v4.6", - "app_settings": [ - {"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "10.14"} - ], - "local_my_sql_enabled": False, - "http20_enabled": True - }, - "scm_site_also_stopped": False, - "https_only": False + "location": AZURE_LOCATION, + # "serverFarmId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/webapp-linux-plan000002", + "server_farm_id": service_farm.id, + "reserved": False, + "is_xenon": False, + "hyper_v": False, + "site_config": { + "net_framework_version": "v4.6", + "app_settings": [{"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "10.14"}], + "local_my_sql_enabled": False, + "http20_enabled": True, + }, + "scm_site_also_stopped": False, + "https_only": False, } result = self.mgmt_client.web_apps.update(resource_group_name=RESOURCE_GROUP, name=NAME, site_envelope=BODY) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/patch/UpdateConfig[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "properties": { - "number_of_workers": 1, - "default_documents": [ - "Default.htm", - "Default.html", - "Default.asp", - "index.htm", - "index.html", - "iisstart.htm", - "default.aspx", - "index.php", - "hostingstart.html" - ], - "net_framework_version": "v3.5", - "php_version": "7.2", - "python_version": "3.4", - "node_version": "", - "power_shell_version": "", - "linux_fx_version": "", - "request_tracing_enabled": False, - "remote_debugging_enabled": False, - "http_logging_enabled": False, - "logs_directory_size_limit": 35, - "detailed_error_logging_enabled": False, - "publishing_username": "$webapp-config-test000002", - "scm_type": "None", - "use32_bit_worker_process": False, - "webSocketsEnabled": True, - "always_on": True, - "app_command_line": "", - "managed_pipeline_mode": "Integrated", - "virtual_applications": [ - { - "virtual_path": "/", - "physical_path": "site\\wwwroot", - "preload_enabled": True - } - ], - "load_balancing": "LeastRequests", - "experiments": { - "ramp_up_rules": [] - }, - "auto_heal_enabled": True, - "vnet_name": "", - "local_my_sql_enabled": False, - "ip_security_restrictions": [ - { - "ip_address": "Any", - "action": "Allow", - "priority": 1, - "name": "Allow all", - "description": "Allow all access" - } - ], - "scm_ip_security_restrictions": [ - { - "ip_address": "Any", - "action": "Allow", - "priority": 1, - "name": "Allow all", - "description": "Allow all access" - } - ], - "scm_ip_security_restrictions_use_main": False, - "http20_enabled": True, - "min_tls_version": "1.0", - "ftps_state": "Disabled", - "preWarmedInstanceCount": 0 - } + "properties": { + "number_of_workers": 1, + "default_documents": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html", + ], + "net_framework_version": "v3.5", + "php_version": "7.2", + "python_version": "3.4", + "node_version": "", + "power_shell_version": "", + "linux_fx_version": "", + "request_tracing_enabled": False, + "remote_debugging_enabled": False, + "http_logging_enabled": False, + "logs_directory_size_limit": 35, + "detailed_error_logging_enabled": False, + "publishing_username": "$webapp-config-test000002", + "scm_type": "None", + "use32_bit_worker_process": False, + "webSocketsEnabled": True, + "always_on": True, + "app_command_line": "", + "managed_pipeline_mode": "Integrated", + "virtual_applications": [ + {"virtual_path": "/", "physical_path": "site\\wwwroot", "preload_enabled": True} + ], + "load_balancing": "LeastRequests", + "experiments": {"ramp_up_rules": []}, + "auto_heal_enabled": True, + "vnet_name": "", + "local_my_sql_enabled": False, + "ip_security_restrictions": [ + { + "ip_address": "Any", + "action": "Allow", + "priority": 1, + "name": "Allow all", + "description": "Allow all access", + } + ], + "scm_ip_security_restrictions": [ + { + "ip_address": "Any", + "action": "Allow", + "priority": 1, + "name": "Allow all", + "description": "Allow all access", + } + ], + "scm_ip_security_restrictions_use_main": False, + "http20_enabled": True, + "min_tls_version": "1.0", + "ftps_state": "Disabled", + "preWarmedInstanceCount": 0, + } } - result = self.mgmt_client.web_apps.update_configuration(resource_group_name=RESOURCE_GROUP, name=NAME, site_config=BODY) + result = self.mgmt_client.web_apps.update_configuration( + resource_group_name=RESOURCE_GROUP, name=NAME, site_config=BODY + ) - #-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/patch/UpdateSourceControl[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "repo_url": "https://github.com/00Kai0/azure-site-test", - "branch": "staging", - "is_manual_integration": True, - "is_mercurial": False + "repo_url": "https://github.com/00Kai0/azure-site-test", + "branch": "staging", + "is_manual_integration": True, + "is_mercurial": False, } - result = self.mgmt_client.web_apps.update_source_control(resource_group_name=RESOURCE_GROUP, name=NAME, site_source_control=BODY) + result = self.mgmt_client.web_apps.update_source_control( + resource_group_name=RESOURCE_GROUP, name=NAME, site_source_control=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Start -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.start(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Restart -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.restart(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Stop -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.stop(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/delete/DeleteSourceControl -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.delete_source_control(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/delete/Delete -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.delete(resource_group_name=RESOURCE_GROUP, name=NAME) @unittest.skip("unavailable") @@ -650,248 +637,240 @@ def test_web_app_backup(self, resource_group): NAME = "mysitexxyzz" APP_SERVICE_PLAN_NAME = "myappserviceplan" -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /AppServicePlans/put/Create Or Update App Service plan[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - "sku": { - "name": "B1", - "tier": "BASIC", - "capacity": "1" - }, - "per_site_scaling": False, - "is_xenon": False + "location": AZURE_LOCATION, + "sku": {"name": "B1", "tier": "BASIC", "capacity": "1"}, + "per_site_scaling": False, + "is_xenon": False, } - result = self.mgmt_client.app_service_plans.begin_create_or_update(resource_group_name=RESOURCE_GROUP, name=APP_SERVICE_PLAN_NAME, app_service_plan=BODY) + result = self.mgmt_client.app_service_plans.begin_create_or_update( + resource_group_name=RESOURCE_GROUP, name=APP_SERVICE_PLAN_NAME, app_service_plan=BODY + ) service_farm = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/Create[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "location": AZURE_LOCATION, - # "serverFarmId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/webapp-linux-plan000002", - "server_farm_id": service_farm.id, - "reserved": False, - "is_xenon": False, - "hyper_v": False, - "site_config": { - "net_framework_version":"v4.6", - "app_settings": [ - {"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "10.14"} - ], - "local_my_sql_enabled": False, - "http20_enabled": True - }, - "scm_site_also_stopped": False, - "https_only": False + "location": AZURE_LOCATION, + # "serverFarmId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/webapp-linux-plan000002", + "server_farm_id": service_farm.id, + "reserved": False, + "is_xenon": False, + "hyper_v": False, + "site_config": { + "net_framework_version": "v4.6", + "app_settings": [{"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "10.14"}], + "local_my_sql_enabled": False, + "http20_enabled": True, + }, + "scm_site_also_stopped": False, + "https_only": False, } - result = self.mgmt_client.web_apps.begin_create_or_update(resource_group_name=RESOURCE_GROUP, name=NAME, site_envelope=BODY) + result = self.mgmt_client.web_apps.begin_create_or_update( + resource_group_name=RESOURCE_GROUP, name=NAME, site_envelope=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/Approves or rejects a private endpoint connection for a site.[put] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- BODY = { - "private_link_service_connection_state": { - "status": "Approved", - "description": "Approved by admin.", - "actions_required": "" - } + "private_link_service_connection_state": { + "status": "Approved", + "description": "Approved by admin.", + "actions_required": "", + } } # result = self.mgmt_client.web_apps.begin_approve_or_reject_private_endpoint_connection(resource_group_name=RESOURCE_GROUP, name=NAME, private_endpoint_connection_name=PRIVATE_ENDPOINT_CONNECTION_NAME, private_endpoint_wrapper=BODY) # result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/Update SCM Allowed[put] -#-------------------------------------------------------------------------- - BODY = { - "allow": True - } - result = self.mgmt_client.web_apps.update_scm_allowed(resource_group_name=RESOURCE_GROUP, name=NAME, csm_publishing_access_policies_entity=BODY) + # -------------------------------------------------------------------------- + BODY = {"allow": True} + result = self.mgmt_client.web_apps.update_scm_allowed( + resource_group_name=RESOURCE_GROUP, name=NAME, csm_publishing_access_policies_entity=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/put/Update FTP Allowed[put] -#-------------------------------------------------------------------------- - BODY = { - "allow": True - } - result = self.mgmt_client.web_apps.update_ftp_allowed(resource_group_name=RESOURCE_GROUP, name=NAME, csm_publishing_access_policies_entity=BODY) + # -------------------------------------------------------------------------- + BODY = {"allow": True} + result = self.mgmt_client.web_apps.update_ftp_allowed( + resource_group_name=RESOURCE_GROUP, name=NAME, csm_publishing_access_policies_entity=BODY + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get the current status of a network trace operation for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get FTP Allowed[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.get_ftp_allowed(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get SCM Allowed[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.get_scm_allowed(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get the current status of a network trace operation for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get the current status of a network trace operation for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get a private endpoint connection for a site.[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_private_endpoint_connection(resource_group_name=RESOURCE_GROUP, name=NAME, private_endpoint_connection_name=PRIVATE_ENDPOINT_CONNECTION_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get Azure Key Vault app setting reference[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_app_setting_key_vault_reference(resource_group_name=RESOURCE_GROUP, name=NAME, config_name=CONFIG_NAME, app_setting_key=APP_SETTING_KEY) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get the current status of a network trace operation for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get NetworkTraces for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_network_traces(resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get NetworkTraces for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_network_traces(resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get site instance info[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_instance_info(resource_group_name=RESOURCE_GROUP, name=NAME, instance_id=INSTANCE_ID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get Azure Key Vault references for app settings[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_app_settings_key_vault_references(resource_group_name=RESOURCE_GROUP, name=NAME, config_name=CONFIG_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/List Publishing Credentials Policies[get] -#-------------------------------------------------------------------------- - result = self.mgmt_client.web_apps.get_basic_publishing_credentials_policies(resource_group_name=RESOURCE_GROUP, name=NAME) + # -------------------------------------------------------------------------- + result = self.mgmt_client.web_apps.get_basic_publishing_credentials_policies( + resource_group_name=RESOURCE_GROUP, name=NAME + ) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get NetworkTraces for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_network_traces(resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get NetworkTraces for a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_network_traces(resource_group_name=RESOURCE_GROUP, name=NAME, operation_id=OPERATION_ID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get site instance info[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.get_instance_info(resource_group_name=RESOURCE_GROUP, name=NAME, instance_id=INSTANCE_ID) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/get/Get private link resources of a site[get] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.get_private_link_resources(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Start a new network trace operation for a site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME, duration_in_seconds="60") # result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Stop a currently running network trace operation for a site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.stop_web_site_network_trace(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Start a new network trace operation for a site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME, duration_in_seconds="60") # result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Stop a currently running network trace operation for a site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.stop_web_site_network_trace(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Start a new network trace operation for a site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME, duration_in_seconds="60") # result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Stop a currently running network trace operation for a site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.stop_web_site_network_trace(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/List backups[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.list_site_backups(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Copy slot[post] -#-------------------------------------------------------------------------- - BODY = { - "target_slot": "staging", - "site_config": { - "number_of_workers": "1", - "http_logging_enabled": True - } - } - result = self.mgmt_client.web_apps.begin_copy_production_slot(resource_group_name=RESOURCE_GROUP, name=NAME, copy_slot_entity=BODY) + # -------------------------------------------------------------------------- + BODY = {"target_slot": "staging", "site_config": {"number_of_workers": "1", "http_logging_enabled": True}} + result = self.mgmt_client.web_apps.begin_copy_production_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, copy_slot_entity=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Start a new network trace operation for a site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.begin_start_web_site_network_trace_operation(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME, duration_in_seconds="60") # result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Stop a currently running network trace operation for a site[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.stop_web_site_network_trace(resource_group_name=RESOURCE_GROUP, name=NAME, network_trace_name=NETWORK_TRACE_NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/List backups[post] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.list_site_backups(resource_group_name=RESOURCE_GROUP, name=NAME) -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/post/Copy slot[post] -#-------------------------------------------------------------------------- - BODY = { - "target_slot": "staging", - "site_config": { - "number_of_workers": "1", - "http_logging_enabled": True - } - } - result = self.mgmt_client.web_apps.begin_copy_production_slot(resource_group_name=RESOURCE_GROUP, name=NAME, copy_slot_entity=BODY) + # -------------------------------------------------------------------------- + BODY = {"target_slot": "staging", "site_config": {"number_of_workers": "1", "http_logging_enabled": True}} + result = self.mgmt_client.web_apps.begin_copy_production_slot( + resource_group_name=RESOURCE_GROUP, name=NAME, copy_slot_entity=BODY + ) result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/delete/Delete a private endpoint connection for a site.[delete] -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # result = self.mgmt_client.web_apps.begin_delete_private_endpoint_connection(resource_group_name=RESOURCE_GROUP, name=NAME, private_endpoint_connection_name=PRIVATE_ENDPOINT_CONNECTION_NAME) # result = result.result() -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- # /WebApps/delete/Delete -#-------------------------------------------------------------------------- + # -------------------------------------------------------------------------- result = self.mgmt_client.web_apps.begin_delete(resource_group_name=RESOURCE_GROUP, name=NAME) result = result.result() diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_certificate_orders_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_certificate_orders_operations_async_test.py new file mode 100644 index 000000000000..f0459946c1c8 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_certificate_orders_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementAppServiceCertificateOrdersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_app_service_certificate_orders_list(self, resource_group): + response = self.client.app_service_certificate_orders.list() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_app_service_certificate_orders_list_by_resource_group(self, resource_group): + response = self.client.app_service_certificate_orders.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_certificate_orders_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_certificate_orders_operations_test.py new file mode 100644 index 000000000000..0dc975f325ac --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_certificate_orders_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementAppServiceCertificateOrdersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_app_service_certificate_orders_list(self, resource_group): + response = self.client.app_service_certificate_orders.list() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_app_service_certificate_orders_list_by_resource_group(self, resource_group): + response = self.client.app_service_certificate_orders.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_environments_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_environments_operations_async_test.py new file mode 100644 index 000000000000..559844f467ce --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_environments_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementAppServiceEnvironmentsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_app_service_environments_list(self, resource_group): + response = self.client.app_service_environments.list() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_app_service_environments_list_by_resource_group(self, resource_group): + response = self.client.app_service_environments.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_environments_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_environments_operations_test.py new file mode 100644 index 000000000000..f6552e0bbc08 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_environments_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementAppServiceEnvironmentsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_app_service_environments_list(self, resource_group): + response = self.client.app_service_environments.list() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_app_service_environments_list_by_resource_group(self, resource_group): + response = self.client.app_service_environments.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_plans_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_plans_operations_async_test.py new file mode 100644 index 000000000000..586aa628556f --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_plans_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementAppServicePlansOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_app_service_plans_list(self, resource_group): + response = self.client.app_service_plans.list() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_app_service_plans_list_by_resource_group(self, resource_group): + response = self.client.app_service_plans.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_plans_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_plans_operations_test.py new file mode 100644 index 000000000000..ee320477e066 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_app_service_plans_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementAppServicePlansOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_app_service_plans_list(self, resource_group): + response = self.client.app_service_plans.list() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_app_service_plans_list_by_resource_group(self, resource_group): + response = self.client.app_service_plans.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_async_test.py new file mode 100644 index 000000000000..b89364c4de5e --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_async_test.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_get_publishing_user(self, resource_group): + response = await self.client.get_publishing_user() + + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_source_controls(self, resource_group): + response = self.client.list_source_controls() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_custom_host_name_sites(self, resource_group): + response = self.client.list_custom_host_name_sites() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_get_subscription_deployment_locations(self, resource_group): + response = await self.client.get_subscription_deployment_locations() + + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_ase_regions(self, resource_group): + response = self.client.list_ase_regions() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_geo_regions(self, resource_group): + response = self.client.list_geo_regions() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_skus(self, resource_group): + response = await self.client.list_skus() + + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificate_registration_provider_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificate_registration_provider_operations_async_test.py new file mode 100644 index 000000000000..2c0b13d87521 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificate_registration_provider_operations_async_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementCertificateRegistrationProviderOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_certificate_registration_provider_list_operations(self, resource_group): + response = self.client.certificate_registration_provider.list_operations() + result = [r async for r in response] + assert result diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificate_registration_provider_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificate_registration_provider_operations_test.py new file mode 100644 index 000000000000..9a94bebe6fe7 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificate_registration_provider_operations_test.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementCertificateRegistrationProviderOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_certificate_registration_provider_list_operations(self, resource_group): + response = self.client.certificate_registration_provider.list_operations() + result = [r for r in response] + assert result diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificates_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificates_operations_async_test.py new file mode 100644 index 000000000000..f336391f296d --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificates_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementCertificatesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_certificates_list(self, resource_group): + response = self.client.certificates.list() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_certificates_list_by_resource_group(self, resource_group): + response = self.client.certificates.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificates_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificates_operations_test.py new file mode 100644 index 000000000000..fe90f7335ea9 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_certificates_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementCertificatesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_certificates_list(self, resource_group): + response = self.client.certificates.list() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_certificates_list_by_resource_group(self, resource_group): + response = self.client.certificates.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_container_apps_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_container_apps_operations_async_test.py new file mode 100644 index 000000000000..601624c8ee3a --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_container_apps_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementContainerAppsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_container_apps_list_by_subscription(self, resource_group): + response = self.client.container_apps.list_by_subscription() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_container_apps_list_by_resource_group(self, resource_group): + response = self.client.container_apps.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_container_apps_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_container_apps_operations_test.py new file mode 100644 index 000000000000..bfe20c26bd8f --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_container_apps_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementContainerAppsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_container_apps_list_by_subscription(self, resource_group): + response = self.client.container_apps.list_by_subscription() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_container_apps_list_by_resource_group(self, resource_group): + response = self.client.container_apps.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_deleted_web_apps_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_deleted_web_apps_operations_async_test.py new file mode 100644 index 000000000000..28d8afd631d1 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_deleted_web_apps_operations_async_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementDeletedWebAppsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_deleted_web_apps_list(self, resource_group): + response = self.client.deleted_web_apps.list() + result = [r async for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_deleted_web_apps_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_deleted_web_apps_operations_test.py new file mode 100644 index 000000000000..8e1170daff2a --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_deleted_web_apps_operations_test.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementDeletedWebAppsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_deleted_web_apps_list(self, resource_group): + response = self.client.deleted_web_apps.list() + result = [r for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domain_registration_provider_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domain_registration_provider_operations_async_test.py new file mode 100644 index 000000000000..0dab6c397c80 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domain_registration_provider_operations_async_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementDomainRegistrationProviderOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_domain_registration_provider_list_operations(self, resource_group): + response = self.client.domain_registration_provider.list_operations() + result = [r async for r in response] + assert result diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domain_registration_provider_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domain_registration_provider_operations_test.py new file mode 100644 index 000000000000..00ff7027228b --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domain_registration_provider_operations_test.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementDomainRegistrationProviderOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_domain_registration_provider_list_operations(self, resource_group): + response = self.client.domain_registration_provider.list_operations() + result = [r for r in response] + assert result diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domains_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domains_operations_async_test.py new file mode 100644 index 000000000000..03e172d8ce41 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domains_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementDomainsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_domains_list(self, resource_group): + response = self.client.domains.list() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_domains_list_by_resource_group(self, resource_group): + response = self.client.domains.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domains_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domains_operations_test.py new file mode 100644 index 000000000000..4ba3e701e2c3 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_domains_operations_test.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementDomainsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_domains_list(self, resource_group): + response = self.client.domains.list() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_domains_list_by_resource_group(self, resource_group): + response = self.client.domains.list_by_resource_group(resource_group_name=resource_group.name) + result = [r for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_kube_environments_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_kube_environments_operations_async_test.py new file mode 100644 index 000000000000..a4647ed6003b --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_kube_environments_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementKubeEnvironmentsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_kube_environments_list_by_subscription(self, resource_group): + response = self.client.kube_environments.list_by_subscription() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_kube_environments_list_by_resource_group(self, resource_group): + response = self.client.kube_environments.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_kube_environments_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_kube_environments_operations_test.py new file mode 100644 index 000000000000..217e7790f41b --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_kube_environments_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementKubeEnvironmentsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_kube_environments_list_by_subscription(self, resource_group): + response = self.client.kube_environments.list_by_subscription() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_kube_environments_list_by_resource_group(self, resource_group): + response = self.client.kube_environments.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_provider_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_provider_operations_async_test.py new file mode 100644 index 000000000000..7f4dde32b0fe --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_provider_operations_async_test.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementProviderOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_provider_get_available_stacks(self, resource_group): + response = self.client.provider.get_available_stacks() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_provider_get_function_app_stacks(self, resource_group): + response = self.client.provider.get_function_app_stacks() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_provider_list_operations(self, resource_group): + response = self.client.provider.list_operations() + result = [r async for r in response] + assert result + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_provider_get_web_app_stacks(self, resource_group): + response = self.client.provider.get_web_app_stacks() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_provider_get_available_stacks_on_prem(self, resource_group): + response = self.client.provider.get_available_stacks_on_prem() + result = [r async for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_provider_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_provider_operations_test.py new file mode 100644 index 000000000000..61d682ec28c0 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_provider_operations_test.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementProviderOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_provider_get_available_stacks(self, resource_group): + response = self.client.provider.get_available_stacks() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_provider_get_function_app_stacks(self, resource_group): + response = self.client.provider.get_function_app_stacks() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_provider_list_operations(self, resource_group): + response = self.client.provider.list_operations() + result = [r for r in response] + assert result + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_provider_get_web_app_stacks(self, resource_group): + response = self.client.provider.get_web_app_stacks() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_provider_get_available_stacks_on_prem(self, resource_group): + response = self.client.provider.get_available_stacks_on_prem() + result = [r for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_recommendations_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_recommendations_operations_async_test.py new file mode 100644 index 000000000000..0f338d3d3074 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_recommendations_operations_async_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementRecommendationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_recommendations_list(self, resource_group): + response = self.client.recommendations.list() + result = [r async for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_recommendations_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_recommendations_operations_test.py new file mode 100644 index 000000000000..b78fd8b58dde --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_recommendations_operations_test.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementRecommendationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_recommendations_list(self, resource_group): + response = self.client.recommendations.list() + result = [r for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_resource_health_metadata_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_resource_health_metadata_operations_async_test.py new file mode 100644 index 000000000000..9ed0435feb33 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_resource_health_metadata_operations_async_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementResourceHealthMetadataOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_resource_health_metadata_list(self, resource_group): + response = self.client.resource_health_metadata.list() + result = [r async for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_resource_health_metadata_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_resource_health_metadata_operations_test.py new file mode 100644 index 000000000000..d3edc2291688 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_resource_health_metadata_operations_test.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementResourceHealthMetadataOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_resource_health_metadata_list(self, resource_group): + response = self.client.resource_health_metadata.list() + result = [r for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_static_sites_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_static_sites_operations_async_test.py new file mode 100644 index 000000000000..19c2ff016792 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_static_sites_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementStaticSitesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_static_sites_list(self, resource_group): + response = self.client.static_sites.list() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_static_sites_get_static_sites_by_resource_group(self, resource_group): + response = self.client.static_sites.get_static_sites_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_static_sites_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_static_sites_operations_test.py new file mode 100644 index 000000000000..c1ad797e3100 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_static_sites_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementStaticSitesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_static_sites_list(self, resource_group): + response = self.client.static_sites.list() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_static_sites_get_static_sites_by_resource_group(self, resource_group): + response = self.client.static_sites.get_static_sites_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_test.py new file mode 100644 index 000000000000..8c3d3681d773 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_test.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagement(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get_publishing_user(self, resource_group): + response = self.client.get_publishing_user() + + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_source_controls(self, resource_group): + response = self.client.list_source_controls() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_billing_meters(self, resource_group): + response = self.client.list_billing_meters() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_custom_host_name_sites(self, resource_group): + response = self.client.list_custom_host_name_sites() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get_subscription_deployment_locations(self, resource_group): + response = self.client.get_subscription_deployment_locations() + + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_ase_regions(self, resource_group): + response = self.client.list_ase_regions() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_geo_regions(self, resource_group): + response = self.client.list_geo_regions() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_skus(self, resource_group): + response = self.client.list_skus() + + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_top_level_domains_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_top_level_domains_operations_async_test.py new file mode 100644 index 000000000000..a4a64399acde --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_top_level_domains_operations_async_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web.aio import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementTopLevelDomainsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_top_level_domains_list(self, resource_group): + response = self.client.top_level_domains.list() + result = [r async for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_top_level_domains_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_top_level_domains_operations_test.py new file mode 100644 index 000000000000..a7110bff019d --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_top_level_domains_operations_test.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.web import WebSiteManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestWebSiteManagementTopLevelDomainsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(WebSiteManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_top_level_domains_list(self, resource_group): + response = self.client.top_level_domains.list() + result = [r for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_web_apps_operations_async_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_web_apps_operations_async_test.py index f7b3b5ce1ea5..032bf60a30eb 100644 --- a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_web_apps_operations_async_test.py +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_web_apps_operations_async_test.py @@ -24,8 +24,13 @@ def setup_method(self, method): async def test_list_by_resource_group(self, resource_group): response = self.client.web_apps.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2023-12-01", ) result = [r async for r in response] assert result == [] - \ No newline at end of file + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_web_apps_list(self, resource_group): + response = self.client.web_apps.list() + result = [r async for r in response] + assert response diff --git a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_web_apps_operations_test.py b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_web_apps_operations_test.py index eb9ba3209e62..aeb3dd82d938 100644 --- a/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_web_apps_operations_test.py +++ b/sdk/appservice/azure-mgmt-web/tests/test_web_site_management_web_apps_operations_test.py @@ -23,8 +23,13 @@ def setup_method(self, method): def test_list_by_resource_group(self, resource_group): response = self.client.web_apps.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2023-12-01", ) result = [r for r in response] assert result == [] - \ No newline at end of file + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_web_apps_list(self, resource_group): + response = self.client.web_apps.list() + result = [r for r in response] + assert response From 10f4aaeb78d6e7a152c29858e6386aab940a363a Mon Sep 17 00:00:00 2001 From: kdestin <101366538+kdestin@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:38:36 -0500 Subject: [PATCH 24/29] fix: Loosen psutil version requirement (#39354) --- sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py index 61739c223870..59a573accfdc 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py @@ -88,7 +88,7 @@ "msrest>=0.6.10", "opentelemetry-api~=1.26", "opentelemetry-sdk~=1.26", - "psutil~=5.9", + "psutil>=5.9,<7", ], entry_points={ "opentelemetry_traces_exporter": [ From 74d3c06aff3c932c39c69a01f724a5d17313710d Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Thu, 23 Jan 2025 11:04:18 -0800 Subject: [PATCH 25/29] Enable sample type checking for cosmos (#39334) This is already passing so enabling in CI so we can continue to validate samples with mypy --- sdk/cosmos/azure-cosmos/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/pyproject.toml b/sdk/cosmos/azure-cosmos/pyproject.toml index 2c328e283124..068860a980d6 100644 --- a/sdk/cosmos/azure-cosmos/pyproject.toml +++ b/sdk/cosmos/azure-cosmos/pyproject.toml @@ -1,5 +1,4 @@ [tool.azure-sdk-build] mypy = true pyright = false -type_check_samples = false pylint = true From d30dd29efb89432a2b493ebd04710507bf2c69c0 Mon Sep 17 00:00:00 2001 From: Waqas Javed <7674577+w-javed@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:30:55 -0800 Subject: [PATCH 26/29] update change log --- sdk/evaluation/azure-ai-evaluation/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md index d1fd368e980e..b4de53343b39 100644 --- a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md +++ b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md @@ -3,7 +3,7 @@ ## 1.2.0 (01-23-2024) ### Features Added -- CSV files are now supported as data file inputs with `evaluate()` API. The CSV file should have a header row with column names that match the `data` and `target` fields in the `evaluate()` method and the filename should be passed as the `data` parameter. +- CSV files are now supported as data file inputs with `evaluate()` API. The CSV file should have a header row with column names that match the `data` and `target` fields in the `evaluate()` method and the filename should be passed as the `data` parameter. Column name 'Conversation' in CSV file is not supported. ### Breaking Changes - In release 1.1.0, Multimodal image support was added in `ContentSafetyEvaluator`, `ViolenceEvaluator`, `SexualEvaluator`, `SelfHarmEvaluator`, `HateUnfairnessEvaluator` and `ProtectedMaterialEvaluator`. Hence, `ContentSafetyMultimodalEvaluator`, `ViolenceMultimodalEvaluator`, `SexualMultimodalEvaluator`, `SelfHarmMultimodalEvaluator`, `HateUnfairnessMultimodalEvaluator` and `ProtectedMaterialMultimodalEvaluator` will be removed in next release azure-ai-evaluation:1.3.0. From 00368ea23fbbfeb6b93b3d16f8e776db2048a870 Mon Sep 17 00:00:00 2001 From: Waqas Javed <7674577+w-javed@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:36:30 -0800 Subject: [PATCH 27/29] change date format --- sdk/evaluation/azure-ai-evaluation/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md index b4de53343b39..da0ab62719bf 100644 --- a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md +++ b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.2.0 (01-23-2024) +## 1.2.0 (2024-01-24) ### Features Added - CSV files are now supported as data file inputs with `evaluate()` API. The CSV file should have a header row with column names that match the `data` and `target` fields in the `evaluate()` method and the filename should be passed as the `data` parameter. Column name 'Conversation' in CSV file is not supported. From b3d6401ec0c31ca1c9e68e5c10ef13c25384e830 Mon Sep 17 00:00:00 2001 From: Waqas Javed <7674577+w-javed@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:17:49 -0800 Subject: [PATCH 28/29] change date format --- sdk/evaluation/azure-ai-evaluation/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md index da0ab62719bf..8abe3d3a32b4 100644 --- a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md +++ b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md @@ -1,12 +1,12 @@ # Release History -## 1.2.0 (2024-01-24) +## 1.2.0 (2025-01-24) ### Features Added -- CSV files are now supported as data file inputs with `evaluate()` API. The CSV file should have a header row with column names that match the `data` and `target` fields in the `evaluate()` method and the filename should be passed as the `data` parameter. Column name 'Conversation' in CSV file is not supported. +- CSV files are now supported as data file inputs with `evaluate()` API. The CSV file should have a header row with column names that match the `data` and `target` fields in the `evaluate()` method and the filename should be passed as the `data` parameter. Column name 'Conversation' in CSV file is not fully supported yet. ### Breaking Changes -- In release 1.1.0, Multimodal image support was added in `ContentSafetyEvaluator`, `ViolenceEvaluator`, `SexualEvaluator`, `SelfHarmEvaluator`, `HateUnfairnessEvaluator` and `ProtectedMaterialEvaluator`. Hence, `ContentSafetyMultimodalEvaluator`, `ViolenceMultimodalEvaluator`, `SexualMultimodalEvaluator`, `SelfHarmMultimodalEvaluator`, `HateUnfairnessMultimodalEvaluator` and `ProtectedMaterialMultimodalEvaluator` will be removed in next release azure-ai-evaluation:1.3.0. +- `ViolenceMultimodalEvaluator`, `SexualMultimodalEvaluator`, `SelfHarmMultimodalEvaluator`, `HateUnfairnessMultimodalEvaluator` and `ProtectedMaterialMultimodalEvaluator` will be removed in next release. ### Bugs Fixed - Removed `[remote]` extra. This is no longer needed when tracking results in Azure AI Studio. From f7018cdada2cf1fb3a590077b136fe1a6f7b0655 Mon Sep 17 00:00:00 2001 From: Waqas Javed <7674577+w-javed@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:40:50 -0800 Subject: [PATCH 29/29] change date format --- sdk/evaluation/azure-ai-evaluation/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md index 8abe3d3a32b4..6c2b354d1f4f 100644 --- a/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md +++ b/sdk/evaluation/azure-ai-evaluation/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.2.0 (2025-01-24) +## 1.2.0 (2025-01-27) ### Features Added - CSV files are now supported as data file inputs with `evaluate()` API. The CSV file should have a header row with column names that match the `data` and `target` fields in the `evaluate()` method and the filename should be passed as the `data` parameter. Column name 'Conversation' in CSV file is not fully supported yet.