From e8c5b7878174ebf487f86282f9475b9f58085634 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 19 May 2026 07:18:42 +0000 Subject: [PATCH] Configurations: 'specification/edge/Microsoft.Edge.ConfigurationManager.Management/tspconfig.yaml', API Version: 2025-06-01, SDK Release Type: beta, and CommitSHA: 'b373ded4a6c77a9f541ca8f020fd2072db632751' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6318756 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 39 + .../MANIFEST.in | 8 +- .../README.md | 4 +- .../_metadata.json | 7 +- .../apiview-properties.json | 23 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../mgmt/workloadorchestration/_client.py | 25 +- .../workloadorchestration/_configuration.py | 11 +- .../mgmt/workloadorchestration/_patch.py | 3 +- .../_utils/model_base.py | 445 +++- .../_utils/serialization.py | 49 +- .../mgmt/workloadorchestration/_version.py | 2 +- .../mgmt/workloadorchestration/aio/_client.py | 25 +- .../aio/_configuration.py | 11 +- .../mgmt/workloadorchestration/aio/_patch.py | 3 +- .../aio/operations/_operations.py | 1869 ++++++++++++--- .../aio/operations/_patch.py | 3 +- .../workloadorchestration/models/__init__.py | 28 + .../workloadorchestration/models/_enums.py | 70 +- .../workloadorchestration/models/_models.py | 596 ++++- .../workloadorchestration/models/_patch.py | 3 +- .../operations/_operations.py | 2107 ++++++++++++----- .../operations/_patch.py | 3 +- ...rsions_create_or_update_maximum_set_gen.py | 2 +- ..._schema_versions_delete_maximum_set_gen.py | 2 +- ...mic_schema_versions_get_maximum_set_gen.py | 2 +- ..._schema_versions_update_maximum_set_gen.py | 2 +- ...rences_create_or_update_maximum_set_gen.py | 43 + ...chema_references_delete_maximum_set_gen.py | 41 + .../schema_references_get_maximum_set_gen.py | 4 +- ..._list_by_resource_group_maximum_set_gen.py | 2 +- ...chema_references_update_maximum_set_gen.py | 43 + ...ration_mgmt_config_templates_operations.py | 25 +- ..._mgmt_config_templates_operations_async.py | 25 +- ..._orchestration_mgmt_contexts_operations.py | 13 - ...stration_mgmt_contexts_operations_async.py | 13 - ...chestration_mgmt_diagnostics_operations.py | 19 +- ...ation_mgmt_diagnostics_operations_async.py | 19 +- ...mgmt_dynamic_schema_versions_operations.py | 8 +- ...ynamic_schema_versions_operations_async.py | 8 +- ...ation_mgmt_schema_references_operations.py | 63 + ...mgmt_schema_references_operations_async.py | 67 + ...d_orchestration_mgmt_schemas_operations.py | 18 +- ...estration_mgmt_schemas_operations_async.py | 18 +- ...tion_mgmt_solution_templates_operations.py | 16 +- ...gmt_solution_templates_operations_async.py | 16 +- ...orchestration_mgmt_solutions_operations.py | 23 +- ...tration_mgmt_solutions_operations_async.py | 23 +- ...d_orchestration_mgmt_targets_operations.py | 29 +- ...estration_mgmt_targets_operations_async.py | 33 +- .../pyproject.toml | 81 + .../sdk_packaging.toml | 12 - .../azure-mgmt-workloadorchestration/setup.py | 82 - .../tsp-location.yaml | 2 +- 55 files changed, 4513 insertions(+), 1579 deletions(-) create mode 100644 sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_create_or_update_maximum_set_gen.py create mode 100644 sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_delete_maximum_set_gen.py create mode 100644 sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_update_maximum_set_gen.py delete mode 100644 sdk/workloadorchestration/azure-mgmt-workloadorchestration/sdk_packaging.toml delete mode 100644 sdk/workloadorchestration/azure-mgmt-workloadorchestration/setup.py diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/CHANGELOG.md b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/CHANGELOG.md index c2a90f959a62..883afc748d89 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/CHANGELOG.md +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/CHANGELOG.md @@ -1,5 +1,44 @@ # Release History +## 1.0.0b2 (2026-05-19) + +### Features Added + + - Client `WorkloadOrchestrationMgmtClient` added parameter `cloud_setting` in method `__init__` + - Model `ConfigTemplateProperties` added property `unique_identifier` + - Model `SolutionTemplateProperties` added property `unique_identifier` + - Added model `ConfigTemplateUpdate` + - Added model `ConfigTemplateUpdateProperties` + - Added model `ContextUpdate` + - Added model `ContextUpdateProperties` + - Added model `DiagnosticUpdate` + - Added model `DiagnosticUpdateProperties` + - Added model `SchemaUpdate` + - Added model `SchemaUpdateProperties` + - Added model `SolutionTemplateUpdate` + - Added model `SolutionTemplateUpdateProperties` + - Added model `SolutionUpdate` + - Added model `SolutionUpdateProperties` + - Added model `TargetUpdate` + - Added model `TargetUpdateProperties` + - Model `SchemaReferencesOperations` added method `begin_create_or_update` + - Model `SchemaReferencesOperations` added method `begin_delete` + +### Breaking Changes + + - Method `DynamicSchemaVersionsOperations.begin_create_or_update` inserted a `positional_or_keyword` parameter `dynamic_schema_version_name` + - Method `DynamicSchemaVersionsOperations.begin_create_or_update` deleted or renamed its parameter `schema_version_name` of kind `positional_or_keyword` + - Method `DynamicSchemaVersionsOperations.begin_delete` inserted a `positional_or_keyword` parameter `dynamic_schema_version_name` + - Method `DynamicSchemaVersionsOperations.begin_delete` deleted or renamed its parameter `schema_version_name` of kind `positional_or_keyword` + - Method `DynamicSchemaVersionsOperations.get` inserted a `positional_or_keyword` parameter `dynamic_schema_version_name` + - Method `DynamicSchemaVersionsOperations.get` deleted or renamed its parameter `schema_version_name` of kind `positional_or_keyword` + - Method `DynamicSchemaVersionsOperations.update` inserted a `positional_or_keyword` parameter `dynamic_schema_version_name` + - Method `DynamicSchemaVersionsOperations.update` deleted or renamed its parameter `schema_version_name` of kind `positional_or_keyword` + - Method `DynamicSchemaVersionsOperations.get` re-ordered its parameters from `['self', 'resource_group_name', 'schema_name', 'dynamic_schema_name', 'schema_version_name', 'kwargs']` to `['self', 'resource_group_name', 'schema_name', 'dynamic_schema_name', 'dynamic_schema_version_name', 'kwargs']` + - Method `DynamicSchemaVersionsOperations.begin_create_or_update` re-ordered its parameters from `['self', 'resource_group_name', 'schema_name', 'dynamic_schema_name', 'schema_version_name', 'resource', 'kwargs']` to `['self', 'resource_group_name', 'schema_name', 'dynamic_schema_name', 'dynamic_schema_version_name', 'resource', 'kwargs']` + - Method `DynamicSchemaVersionsOperations.update` re-ordered its parameters from `['self', 'resource_group_name', 'schema_name', 'dynamic_schema_name', 'schema_version_name', 'properties', 'kwargs']` to `['self', 'resource_group_name', 'schema_name', 'dynamic_schema_name', 'dynamic_schema_version_name', 'properties', 'kwargs']` + - Method `DynamicSchemaVersionsOperations.begin_delete` re-ordered its parameters from `['self', 'resource_group_name', 'schema_name', 'dynamic_schema_name', 'schema_version_name', 'kwargs']` to `['self', 'resource_group_name', 'schema_name', 'dynamic_schema_name', 'dynamic_schema_version_name', 'kwargs']` + ## 1.0.0b1 (2025-08-18) ### Other Changes diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/MANIFEST.in b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/MANIFEST.in index 11fb694bfde5..4abef84d1581 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/MANIFEST.in +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/MANIFEST.in @@ -1,7 +1,7 @@ -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/workloadorchestration/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/README.md b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/README.md index a06021f54a27..e6dce5d94b03 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/README.md +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Workloadorchestration Management Client Library. -This package has been tested with Python 3.9+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.9+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/_metadata.json b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/_metadata.json index 86ef81dac517..e23f6e83b32b 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/_metadata.json +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/_metadata.json @@ -1,7 +1,10 @@ { "apiVersion": "2025-06-01", - "commit": "802f22a25fa6938c226d518cd89e61a98201831f", + "apiVersions": { + "Microsoft.Edge": "2025-06-01" + }, + "commit": "b373ded4a6c77a9f541ca8f020fd2072db632751", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/edge/Microsoft.Edge.ConfigurationManager.Management", - "emitterVersion": "0.47.0" + "emitterVersion": "0.62.1" } \ No newline at end of file diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/apiview-properties.json b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/apiview-properties.json index 704b06296ae6..a6bf92dc2709 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/apiview-properties.json +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/apiview-properties.json @@ -12,12 +12,16 @@ "azure.mgmt.workloadorchestration.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", "azure.mgmt.workloadorchestration.models.ConfigTemplate": "Microsoft.Edge.ConfigTemplate", "azure.mgmt.workloadorchestration.models.ConfigTemplateProperties": "Microsoft.Edge.ConfigTemplateProperties", + "azure.mgmt.workloadorchestration.models.ConfigTemplateUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.workloadorchestration.models.ConfigTemplateUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", "azure.mgmt.workloadorchestration.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", "azure.mgmt.workloadorchestration.models.ConfigTemplateVersion": "Microsoft.Edge.ConfigTemplateVersion", "azure.mgmt.workloadorchestration.models.ConfigTemplateVersionProperties": "Microsoft.Edge.ConfigTemplateVersionProperties", "azure.mgmt.workloadorchestration.models.ConfigTemplateVersionWithUpdateType": "Microsoft.Edge.ConfigTemplateVersionWithUpdateType", "azure.mgmt.workloadorchestration.models.Context": "Microsoft.Edge.Context", "azure.mgmt.workloadorchestration.models.ContextProperties": "Microsoft.Edge.ContextProperties", + "azure.mgmt.workloadorchestration.models.ContextUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.workloadorchestration.models.ContextUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", "azure.mgmt.workloadorchestration.models.JobParameterBase": "Microsoft.Edge.JobParameterBase", "azure.mgmt.workloadorchestration.models.DeployJobParameter": "Microsoft.Edge.DeployJobParameter", "azure.mgmt.workloadorchestration.models.JobStepStatisticsBase": "Microsoft.Edge.JobStepStatisticsBase", @@ -25,6 +29,8 @@ "azure.mgmt.workloadorchestration.models.DeploymentStatus": "Microsoft.Edge.DeploymentStatus", "azure.mgmt.workloadorchestration.models.Diagnostic": "Microsoft.Edge.Diagnostic", "azure.mgmt.workloadorchestration.models.DiagnosticProperties": "Microsoft.Edge.DiagnosticProperties", + "azure.mgmt.workloadorchestration.models.DiagnosticUpdate": "Microsoft.Edge.DiagnosticUpdate", + "azure.mgmt.workloadorchestration.models.DiagnosticUpdateProperties": "Microsoft.Edge.DiagnosticUpdateProperties", "azure.mgmt.workloadorchestration.models.DynamicSchema": "Microsoft.Edge.DynamicSchema", "azure.mgmt.workloadorchestration.models.DynamicSchemaProperties": "Microsoft.Edge.DynamicSchemaProperties", "azure.mgmt.workloadorchestration.models.DynamicSchemaVersion": "Microsoft.Edge.DynamicSchemaVersion", @@ -54,6 +60,8 @@ "azure.mgmt.workloadorchestration.models.SchemaProperties": "Microsoft.Edge.SchemaProperties", "azure.mgmt.workloadorchestration.models.SchemaReference": "Microsoft.Edge.SchemaReference", "azure.mgmt.workloadorchestration.models.SchemaReferenceProperties": "Microsoft.Edge.SchemaReferenceProperties", + "azure.mgmt.workloadorchestration.models.SchemaUpdate": "Microsoft.Edge.SchemaUpdate", + "azure.mgmt.workloadorchestration.models.SchemaUpdateProperties": "Microsoft.Edge.SchemaUpdateProperties", "azure.mgmt.workloadorchestration.models.SchemaVersion": "Microsoft.Edge.SchemaVersion", "azure.mgmt.workloadorchestration.models.SchemaVersionProperties": "Microsoft.Edge.SchemaVersionProperties", "azure.mgmt.workloadorchestration.models.SchemaVersionWithUpdateType": "Microsoft.Edge.SchemaVersionWithUpdateType", @@ -66,9 +74,13 @@ "azure.mgmt.workloadorchestration.models.SolutionTemplate": "Microsoft.Edge.SolutionTemplate", "azure.mgmt.workloadorchestration.models.SolutionTemplateParameter": "Microsoft.Edge.SolutionTemplateParameter", "azure.mgmt.workloadorchestration.models.SolutionTemplateProperties": "Microsoft.Edge.SolutionTemplateProperties", + "azure.mgmt.workloadorchestration.models.SolutionTemplateUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.workloadorchestration.models.SolutionTemplateUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", "azure.mgmt.workloadorchestration.models.SolutionTemplateVersion": "Microsoft.Edge.SolutionTemplateVersion", "azure.mgmt.workloadorchestration.models.SolutionTemplateVersionProperties": "Microsoft.Edge.SolutionTemplateVersionProperties", "azure.mgmt.workloadorchestration.models.SolutionTemplateVersionWithUpdateType": "Microsoft.Edge.SolutionTemplateVersionWithUpdateType", + "azure.mgmt.workloadorchestration.models.SolutionUpdate": "Microsoft.Edge.SolutionUpdate", + "azure.mgmt.workloadorchestration.models.SolutionUpdateProperties": "Microsoft.Edge.SolutionUpdateProperties", "azure.mgmt.workloadorchestration.models.SolutionVersion": "Microsoft.Edge.SolutionVersion", "azure.mgmt.workloadorchestration.models.SolutionVersionParameter": "Microsoft.Edge.SolutionVersionParameter", "azure.mgmt.workloadorchestration.models.SolutionVersionProperties": "Microsoft.Edge.SolutionVersionProperties", @@ -80,6 +92,8 @@ "azure.mgmt.workloadorchestration.models.TargetProperties": "Microsoft.Edge.TargetProperties", "azure.mgmt.workloadorchestration.models.TargetSnapshot": "Microsoft.Edge.TargetSnapshot", "azure.mgmt.workloadorchestration.models.TargetStatus": "Microsoft.Edge.TargetStatus", + "azure.mgmt.workloadorchestration.models.TargetUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.workloadorchestration.models.TargetUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", "azure.mgmt.workloadorchestration.models.TaskOption": "Microsoft.Edge.TaskOption", "azure.mgmt.workloadorchestration.models.TaskSpec": "Microsoft.Edge.TaskSpec", "azure.mgmt.workloadorchestration.models.UninstallSolutionParameter": "Microsoft.Edge.UninstallSolutionParameter", @@ -192,6 +206,12 @@ "azure.mgmt.workloadorchestration.aio.operations.DynamicSchemaVersionsOperations.list_by_dynamic_schema": "Microsoft.Edge.DynamicSchemaVersions.listByDynamicSchema", "azure.mgmt.workloadorchestration.operations.SchemaReferencesOperations.get": "Microsoft.Edge.SchemaReferences.get", "azure.mgmt.workloadorchestration.aio.operations.SchemaReferencesOperations.get": "Microsoft.Edge.SchemaReferences.get", + "azure.mgmt.workloadorchestration.operations.SchemaReferencesOperations.begin_create_or_update": "Microsoft.Edge.SchemaReferences.createOrUpdate", + "azure.mgmt.workloadorchestration.aio.operations.SchemaReferencesOperations.begin_create_or_update": "Microsoft.Edge.SchemaReferences.createOrUpdate", + "azure.mgmt.workloadorchestration.operations.SchemaReferencesOperations.update": "Microsoft.Edge.SchemaReferences.update", + "azure.mgmt.workloadorchestration.aio.operations.SchemaReferencesOperations.update": "Microsoft.Edge.SchemaReferences.update", + "azure.mgmt.workloadorchestration.operations.SchemaReferencesOperations.begin_delete": "Microsoft.Edge.SchemaReferences.delete", + "azure.mgmt.workloadorchestration.aio.operations.SchemaReferencesOperations.begin_delete": "Microsoft.Edge.SchemaReferences.delete", "azure.mgmt.workloadorchestration.operations.SchemaReferencesOperations.list_by_resource_group": "Microsoft.Edge.SchemaReferences.listByResourceGroup", "azure.mgmt.workloadorchestration.aio.operations.SchemaReferencesOperations.list_by_resource_group": "Microsoft.Edge.SchemaReferences.listByResourceGroup", "azure.mgmt.workloadorchestration.operations.SolutionsOperations.get": "Microsoft.Edge.Solutions.get", @@ -326,5 +346,6 @@ "azure.mgmt.workloadorchestration.aio.operations.SiteReferencesOperations.begin_delete": "Microsoft.Edge.SiteReferences.delete", "azure.mgmt.workloadorchestration.operations.SiteReferencesOperations.list_by_context": "Microsoft.Edge.SiteReferences.listByContext", "azure.mgmt.workloadorchestration.aio.operations.SiteReferencesOperations.list_by_context": "Microsoft.Edge.SiteReferences.listByContext" - } + }, + "CrossLanguageVersion": "63db1e866d8a" } \ No newline at end of file diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/__init__.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/__init__.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/__init__.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/__init__.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_client.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_client.py index bef75aa6f0cb..1b6795abf7bb 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_client.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -43,7 +43,13 @@ WorkflowsOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -107,7 +113,11 @@ class WorkloadOrchestrationMgmtClient: # pylint: disable=too-many-instance-attr :type subscription_id: str :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-06-01". + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-06-01" + and None. Default value is None. If not set, the operation's default API version will be used. 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 @@ -115,10 +125,16 @@ class WorkloadOrchestrationMgmtClient: # pylint: disable=too-many-instance-attr """ def __init__( - self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] @@ -127,6 +143,7 @@ def __init__( credential=credential, subscription_id=subscription_id, base_url=cast(str, base_url), + cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs ) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_configuration.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_configuration.py index c4aff0a6d879..db8a60291c15 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_configuration.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,6 +14,7 @@ from ._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -29,7 +30,11 @@ class WorkloadOrchestrationMgmtClientConfiguration: # pylint: disable=too-many- :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 "2025-06-01". + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-06-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,6 +44,7 @@ def __init__( credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: api_version: str = kwargs.pop("api_version", "2025-06-01") @@ -51,6 +57,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-workloadorchestration/{}".format(VERSION)) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_patch.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_patch.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_utils/model_base.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_utils/model_base.py index 49d5c7259389..4102784f9a85 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_utils/model_base.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_utils/model_base.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -23,19 +23,26 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -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 +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] TZ_UTC = timezone.utc _T = typing.TypeVar("_T") +_NONE_TYPE = type(None) def _timedelta_as_isostr(td: timedelta) -> str: @@ -170,6 +177,21 @@ def default(self, o): # pylint: disable=too-many-return-statements r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" ) +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: """Deserialize ISO-8601 formatted string into Datetime object. @@ -201,7 +223,7 @@ def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: 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 + return date_obj # type: ignore[no-any-return] def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: @@ -255,7 +277,7 @@ def _deserialize_time(attr: typing.Union[str, time]) -> time: """ if isinstance(attr, time): return attr - return isodate.parse_time(attr) + return isodate.parse_time(attr) # type: ignore[no-any-return] def _deserialize_bytes(attr): @@ -314,6 +336,8 @@ def _deserialize_int_as_str(attr): 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 annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore @@ -345,16 +369,46 @@ def _get_model(module_name: str, model_name: str): class _MyMutableMapping(MutableMapping[str, typing.Any]): - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + def __init__(self, data: 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: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized return self._data.__getitem__(key) def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass self._data.__setitem__(key, value) def __delitem__(self, key: str) -> None: @@ -425,7 +479,7 @@ def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.pop(key) return self._data.pop(key, default) - def popitem(self) -> typing.Tuple[str, typing.Any]: + def popitem(self) -> tuple[str, typing.Any]: """ Removes and returns some (key, value) pair :returns: The (key, value) pair. @@ -466,6 +520,8 @@ def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.setdefault(key, default) def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data try: other_model = self.__class__(other) except Exception: @@ -482,6 +538,8 @@ def _is_model(obj: typing.Any) -> bool: def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) return [_serialize(x, format) for x in o] if isinstance(o, dict): return {k: _serialize(v, format) for k, v in o.items()} @@ -513,9 +571,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m return o -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: +def _get_rest_field(attr_to_rest_field: 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: @@ -538,65 +594,16 @@ 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() + _calculated: 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 + dict_to_pass: dict[str, typing.Any] = {} + if args: 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) + dict_to_pass.update(self._init_from_xml(args[0])) 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()} @@ -613,8 +620,79 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + model_meta = getattr(self, "_xml", {}) + existed_attr_keys: list[str] = [] + + 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 = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -623,7 +701,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # 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 + attr_to_rest_field: 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 = { @@ -638,7 +716,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: 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._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -667,7 +745,7 @@ def _deserialize(cls, data, exist_discriminators): 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)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -680,7 +758,7 @@ def _deserialize(cls, data, exist_discriminators): mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict(self, *, exclude_readonly: bool = False) -> 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. @@ -740,7 +818,7 @@ def _deserialize_with_union(deserializers, obj): def _deserialize_dict( value_deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], + obj: dict[typing.Any, typing.Any], ): if obj is None: return obj @@ -750,7 +828,7 @@ def _deserialize_dict( def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: list[typing.Optional[typing.Callable]], module: typing.Optional[str], obj, ): @@ -759,6 +837,14 @@ def _deserialize_multiple_sequence( return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + def _deserialize_sequence( deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], @@ -768,17 +854,30 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: +def _sorted_annotations(types: list[typing.Any]) -> 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 +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -818,16 +917,18 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True 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 + next(a for a in annotation.__args__ if a is not _NONE_TYPE), 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 + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) except AttributeError: pass @@ -843,7 +944,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur return functools.partial(_deserialize_with_union, deserializers) try: - if annotation._name == "Dict": # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": value_deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[1], module, rf # pyright: ignore ) @@ -856,7 +960,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: if len(annotation.__args__) > 1: # pyright: ignore entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) @@ -905,16 +1012,20 @@ def _deserialize_with_callable( return float(value.text) if value.text else None if deserializer is bool: return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) 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) + return deserializer(value.text if isinstance(value, ET.Element) else value) except ValueError: # for unknown value, return raw value - return value + return value.text if isinstance(value, ET.Element) else value if isinstance(deserializer, type) and issubclass(deserializer, Model): return deserializer._deserialize(value, []) return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) @@ -940,14 +1051,14 @@ def _deserialize( def _failsafe_deserialize( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, 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: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -956,17 +1067,18 @@ def _failsafe_deserialize( def _failsafe_deserialize_xml( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, ) -> typing.Any: try: - return _deserialize_xml(deserializer, value) - except DeserializationError: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -974,11 +1086,11 @@ def __init__( 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, + visibility: typing.Optional[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, + xml: typing.Optional[dict[str, typing.Any]] = None, ): self._type = type self._rest_name_input = name @@ -986,6 +1098,7 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input @@ -993,7 +1106,11 @@ def __init__( @property def _class_type(self) -> typing.Any: - return getattr(self._type, "args", [None])[0] + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result @property def _rest_name(self) -> str: @@ -1004,14 +1121,40 @@ def _rest_name(self) -> str: 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) + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + if value is None: # we want to wipe out entries if users set attr to None try: @@ -1036,11 +1179,11 @@ 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, + visibility: typing.Optional[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, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField( name=name, @@ -1057,8 +1200,8 @@ 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, + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) @@ -1074,21 +1217,77 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: +) -> typing.Union[ET.Element, 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: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1110,7 +1309,9 @@ def _get_element( # 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 + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. 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") @@ -1122,12 +1323,7 @@ def _get_element( # 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)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1136,6 +1332,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1143,7 +1340,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1152,13 +1349,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(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")), + "ns": _items_ns, }, ) @@ -1168,10 +1368,11 @@ def _get_element( def _get_wrapped_element( v: typing.Any, exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], + meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None 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 + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1179,7 +1380,7 @@ def _get_wrapped_element( _get_element(v, exclude_readonly, meta, wrapped_element) else: wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element + return wrapped_element # type: ignore[no-any-return] def _get_primitive_type_value(v) -> str: @@ -1192,9 +1393,29 @@ def _get_primitive_type_value(v) -> str: return str(v) -def _create_xml_element(tag, prefix=None, ns=None): - if prefix and ns: +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1211,7 +1432,7 @@ def _deserialize_xml( 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] = {} + dict_result: dict[str, typing.Any] = {} for child in e: if dict_result.get(child.tag) is not None: if isinstance(dict_result[child.tag], list): @@ -1224,7 +1445,7 @@ def _convert_element(e: ET.Element): return dict_result # array case if len(e) > 0: - array_result: typing.List[typing.Any] = [] + array_result: list[typing.Any] = [] for child in e: array_result.append(_convert_element(child)) return array_result diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_utils/serialization.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_utils/serialization.py index eb86ea23c965..954bf7ebffa7 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_utils/serialization.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_utils/serialization.py @@ -21,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -31,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -41,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -229,12 +231,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} 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__) @@ -311,7 +313,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,7 +382,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -414,7 +416,7 @@ 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)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -528,7 +530,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -579,7 +581,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -789,7 +791,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -823,13 +825,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ 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 # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1184,7 +1193,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1386,7 +1395,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1759,7 +1768,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :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. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1785,7 +1794,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_version.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_version.py index be71c81bd282..bbcd28b4aa67 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_version.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/_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.0b2" diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_client.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_client.py index 0365ca6634aa..2ea48cdd60bd 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_client.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -43,7 +43,13 @@ WorkflowsOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -110,7 +116,11 @@ class WorkloadOrchestrationMgmtClient: # pylint: disable=too-many-instance-attr :type subscription_id: str :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-06-01". + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-06-01" + and None. Default value is None. If not set, the operation's default API version will be used. 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 @@ -118,10 +128,16 @@ class WorkloadOrchestrationMgmtClient: # pylint: disable=too-many-instance-attr """ def __init__( - self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] @@ -130,6 +146,7 @@ def __init__( credential=credential, subscription_id=subscription_id, base_url=cast(str, base_url), + cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs ) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_configuration.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_configuration.py index 6fa38c54f9ae..799987520f3d 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_configuration.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,6 +14,7 @@ from .._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -29,7 +30,11 @@ class WorkloadOrchestrationMgmtClientConfiguration: # pylint: disable=too-many- :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 "2025-06-01". + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-06-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,6 +44,7 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: api_version: str = kwargs.pop("api_version", "2025-06-01") @@ -51,6 +57,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-workloadorchestration/{}".format(VERSION)) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_patch.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_patch.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/operations/_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/operations/_operations.py index df06b8020cf4..c92edffa80ca 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/operations/_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -83,8 +83,11 @@ build_instances_update_request, build_jobs_get_request, build_jobs_list_by_target_request, + build_schema_references_create_or_update_request, + build_schema_references_delete_request, build_schema_references_get_request, build_schema_references_list_by_resource_group_request, + build_schema_references_update_request, build_schema_versions_create_or_update_request, build_schema_versions_delete_request, build_schema_versions_get_request, @@ -153,7 +156,7 @@ JSON = MutableMapping[str, Any] T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] class DynamicSchemasOperations: @@ -219,6 +222,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -233,11 +237,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.DynamicSchema, response.json()) @@ -291,6 +298,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -304,7 +312,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -314,7 +325,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -649,6 +660,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -663,11 +675,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.DynamicSchema, response.json()) @@ -706,6 +721,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -719,7 +735,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -727,7 +746,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -815,7 +834,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DynamicSchema]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.DynamicSchema]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -854,7 +873,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -867,7 +889,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.DynamicSchema], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.DynamicSchema], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -883,7 +908,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -949,6 +977,7 @@ async def get(self, resource_group_name: str, schema_name: str, **kwargs: Any) - } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -963,11 +992,14 @@ async def get(self, resource_group_name: str, schema_name: str, **kwargs: Any) - except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Schema, response.json()) @@ -1019,6 +1051,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1032,7 +1065,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1042,7 +1078,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1213,7 +1249,7 @@ async def update( self, resource_group_name: str, schema_name: str, - properties: _models.Schema, + properties: _models.SchemaUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -1226,7 +1262,7 @@ async def update( :param schema_name: The name of the Schema. Required. :type schema_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Schema + :type properties: ~azure.mgmt.workloadorchestration.models.SchemaUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1294,7 +1330,7 @@ async def update( self, resource_group_name: str, schema_name: str, - properties: Union[_models.Schema, JSON, IO[bytes]], + properties: Union[_models.SchemaUpdate, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schema: """update a Schema Resource. @@ -1305,8 +1341,8 @@ async def update( :param schema_name: The name of the Schema. Required. :type schema_name: str :param properties: The resource properties to be updated. Is one of the following types: - Schema, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Schema or JSON or IO[bytes] + SchemaUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SchemaUpdate or JSON or IO[bytes] :return: Schema. The Schema is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.Schema :raises ~azure.core.exceptions.HttpResponseError: @@ -1347,6 +1383,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1361,11 +1398,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Schema, response.json()) @@ -1401,6 +1441,7 @@ async def _delete_initial(self, resource_group_name: str, schema_name: str, **kw } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1414,7 +1455,10 @@ async def _delete_initial(self, resource_group_name: str, schema_name: str, **kw except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1422,7 +1466,7 @@ async def _delete_initial(self, resource_group_name: str, schema_name: str, **kw 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1529,6 +1573,7 @@ async def _create_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1542,7 +1587,10 @@ async def _create_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1550,7 +1598,7 @@ async def _create_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1692,14 +1740,10 @@ async def begin_create_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SchemaVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -1864,6 +1908,7 @@ async def remove_version( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1878,11 +1923,14 @@ async def remove_version( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.RemoveVersionResponse, response.json()) @@ -1906,7 +1954,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Schema]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Schema]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1944,7 +1992,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1957,7 +2008,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Schema], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Schema], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1973,7 +2027,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1992,7 +2049,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Schema" _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Schema]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Schema]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2029,7 +2086,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2042,7 +2102,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Schema], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Schema], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2058,7 +2121,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2129,6 +2195,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2143,11 +2210,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SchemaVersion, response.json()) @@ -2201,6 +2271,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2214,7 +2285,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2224,7 +2298,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2559,6 +2633,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2573,11 +2648,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SchemaVersion, response.json()) @@ -2616,6 +2694,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2629,7 +2708,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2637,7 +2719,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2725,7 +2807,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchemaVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SchemaVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2764,7 +2846,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2777,7 +2862,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SchemaVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SchemaVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2793,7 +2881,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2867,6 +2958,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2881,11 +2973,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionVersion, response.json()) @@ -2941,6 +3036,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2954,7 +3050,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2964,7 +3063,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3207,6 +3306,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3220,7 +3320,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3228,7 +3331,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3455,6 +3558,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3468,7 +3572,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3476,7 +3583,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3569,7 +3676,7 @@ def list_by_solution( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SolutionVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SolutionVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3609,7 +3716,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3622,7 +3732,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SolutionVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3638,7 +3751,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3703,6 +3819,7 @@ async def get(self, resource_uri: str, job_name: str, **kwargs: Any) -> _models. } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3717,11 +3834,14 @@ async def get(self, resource_uri: str, job_name: str, **kwargs: Any) -> _models. except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Job, response.json()) @@ -3744,7 +3864,7 @@ def list_by_target(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_m _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Job]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Job]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3781,7 +3901,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3794,7 +3917,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Job], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Job], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3810,7 +3936,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3876,6 +4005,7 @@ async def get(self, resource_group_name: str, target_name: str, **kwargs: Any) - } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3890,11 +4020,14 @@ async def get(self, resource_group_name: str, target_name: str, **kwargs: Any) - except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Target, response.json()) @@ -3946,6 +4079,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3959,7 +4093,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3969,7 +4106,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4139,7 +4276,7 @@ async def _update_initial( self, resource_group_name: str, target_name: str, - properties: Union[_models.Target, JSON, IO[bytes]], + properties: Union[_models.TargetUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -4178,6 +4315,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4191,7 +4329,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4199,7 +4340,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4211,7 +4352,7 @@ async def begin_update( self, resource_group_name: str, target_name: str, - properties: _models.Target, + properties: _models.TargetUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -4224,7 +4365,7 @@ async def begin_update( :param target_name: Name of the target. Required. :type target_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Target + :type properties: ~azure.mgmt.workloadorchestration.models.TargetUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4295,7 +4436,7 @@ async def begin_update( self, resource_group_name: str, target_name: str, - properties: Union[_models.Target, JSON, IO[bytes]], + properties: Union[_models.TargetUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Target]: """update a Target Resource. @@ -4306,8 +4447,8 @@ async def begin_update( :param target_name: Name of the target. Required. :type target_name: str :param properties: The resource properties to be updated. Is one of the following types: - Target, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Target or JSON or IO[bytes] + TargetUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.TargetUpdate or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns Target. The Target is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloadorchestration.models.Target] @@ -4395,6 +4536,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4408,7 +4550,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4416,7 +4561,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4500,7 +4645,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Target]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Target]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4538,7 +4683,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4551,7 +4699,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Target], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Target], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4567,7 +4718,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4586,7 +4740,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Target" _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Target]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Target]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4623,7 +4777,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4636,7 +4793,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Target], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Target], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4652,7 +4812,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4702,6 +4865,7 @@ async def _install_solution_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4715,14 +4879,17 @@ async def _install_solution_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4923,6 +5090,7 @@ async def _uninstall_solution_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4936,14 +5104,17 @@ async def _uninstall_solution_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5144,6 +5315,7 @@ async def _remove_revision_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5157,14 +5329,17 @@ async def _remove_revision_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5365,6 +5540,7 @@ async def _resolve_configuration_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5378,7 +5554,10 @@ async def _resolve_configuration_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5386,7 +5565,7 @@ async def _resolve_configuration_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5528,14 +5707,10 @@ async def begin_resolve_configuration( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.ResolvedConfiguration, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -5604,6 +5779,7 @@ async def _review_solution_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5617,7 +5793,10 @@ async def _review_solution_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5625,7 +5804,7 @@ async def _review_solution_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5767,14 +5946,10 @@ async def begin_review_solution_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SolutionVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -5843,6 +6018,7 @@ async def _publish_solution_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5856,7 +6032,10 @@ async def _publish_solution_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5864,7 +6043,7 @@ async def _publish_solution_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6006,14 +6185,10 @@ async def begin_publish_solution_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SolutionVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -6082,6 +6257,7 @@ async def _update_external_validation_status_initial( # pylint: disable=name-to } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6095,7 +6271,10 @@ async def _update_external_validation_status_initial( # pylint: disable=name-to except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -6103,7 +6282,7 @@ async def _update_external_validation_status_initial( # pylint: disable=name-to 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6245,14 +6424,10 @@ async def begin_update_external_validation_status( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SolutionVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -6304,7 +6479,7 @@ async def get( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, **kwargs: Any ) -> _models.DynamicSchemaVersion: """Get a Dynamic Schema Version Resource. @@ -6316,8 +6491,8 @@ async def get( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :return: DynamicSchemaVersion. The DynamicSchemaVersion is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6339,7 +6514,7 @@ async def get( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6350,6 +6525,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6364,11 +6540,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.DynamicSchemaVersion, response.json()) @@ -6382,7 +6561,7 @@ async def _create_or_update_initial( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: Union[_models.DynamicSchemaVersion, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: @@ -6411,7 +6590,7 @@ async def _create_or_update_initial( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6424,6 +6603,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6437,7 +6617,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -6447,7 +6630,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6460,7 +6643,7 @@ async def begin_create_or_update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: _models.DynamicSchemaVersion, *, content_type: str = "application/json", @@ -6475,8 +6658,8 @@ async def begin_create_or_update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param resource: Resource create parameters. Required. :type resource: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -6495,7 +6678,7 @@ async def begin_create_or_update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: JSON, *, content_type: str = "application/json", @@ -6510,8 +6693,8 @@ async def begin_create_or_update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param resource: Resource create parameters. Required. :type resource: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -6530,7 +6713,7 @@ async def begin_create_or_update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: IO[bytes], *, content_type: str = "application/json", @@ -6545,8 +6728,8 @@ async def begin_create_or_update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_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. @@ -6565,7 +6748,7 @@ async def begin_create_or_update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: Union[_models.DynamicSchemaVersion, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DynamicSchemaVersion]: @@ -6578,8 +6761,8 @@ async def begin_create_or_update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param resource: Resource create parameters. Is one of the following types: DynamicSchemaVersion, JSON, IO[bytes] Required. :type resource: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion or JSON or @@ -6603,7 +6786,7 @@ async def begin_create_or_update( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -6650,7 +6833,7 @@ async def update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, properties: _models.DynamicSchemaVersion, *, content_type: str = "application/json", @@ -6665,8 +6848,8 @@ async def update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param properties: The resource properties to be updated. Required. :type properties: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -6683,7 +6866,7 @@ async def update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, properties: JSON, *, content_type: str = "application/json", @@ -6698,8 +6881,8 @@ async def update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_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. @@ -6716,7 +6899,7 @@ async def update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, properties: IO[bytes], *, content_type: str = "application/json", @@ -6731,8 +6914,8 @@ async def update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_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. @@ -6749,7 +6932,7 @@ async def update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, properties: Union[_models.DynamicSchemaVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DynamicSchemaVersion: @@ -6762,8 +6945,8 @@ async def update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param properties: The resource properties to be updated. Is one of the following types: DynamicSchemaVersion, JSON, IO[bytes] Required. :type properties: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion or JSON or @@ -6797,7 +6980,7 @@ async def update( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6810,6 +6993,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6824,11 +7008,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.DynamicSchemaVersion, response.json()) @@ -6842,7 +7029,7 @@ async def _delete_initial( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -6862,7 +7049,7 @@ async def _delete_initial( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6873,6 +7060,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6886,7 +7074,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -6894,7 +7085,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6907,7 +7098,7 @@ async def begin_delete( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Delete a Dynamic Schema Version Resource. @@ -6919,8 +7110,8 @@ async def begin_delete( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -6937,7 +7128,7 @@ async def begin_delete( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -6992,7 +7183,7 @@ def list_by_dynamic_schema( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DynamicSchemaVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.DynamicSchemaVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7032,7 +7223,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7045,7 +7239,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.DynamicSchemaVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.DynamicSchemaVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -7061,7 +7258,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -7089,14 +7289,412 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> _models.SchemaReference: - """Get a Schema Reference Resource. + async def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> _models.SchemaReference: + """Get a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_name: str + :return: SchemaReference. The SchemaReference is compatible with MutableMapping + :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference + :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.SchemaReference] = kwargs.pop("cls", None) + + _request = build_schema_references_get_request( + resource_uri=resource_uri, + schema_reference_name=schema_reference_name, + 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) + + _decompress = kwargs.pop("decompress", True) + _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, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemaReference, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_uri: str, + schema_reference_name: str, + resource: Union[_models.SchemaReference, 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_schema_references_create_or_update_request( + resource_uri=resource_uri, + schema_reference_name=schema_reference_name, + 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) + + _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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + schema_reference_name: str, + resource: _models.SchemaReference, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SchemaReference]: + """Create or update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.workloadorchestration.models.SchemaReference + :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 SchemaReference. The SchemaReference is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloadorchestration.models.SchemaReference] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + schema_reference_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SchemaReference]: + """Create or update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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 SchemaReference. The SchemaReference is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloadorchestration.models.SchemaReference] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + schema_reference_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SchemaReference]: + """Create or update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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 SchemaReference. The SchemaReference is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloadorchestration.models.SchemaReference] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_uri: str, + schema_reference_name: str, + resource: Union[_models.SchemaReference, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SchemaReference]: + """Create or update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_name: str + :param resource: Resource create parameters. Is one of the following types: SchemaReference, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.workloadorchestration.models.SchemaReference or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns SchemaReference. The SchemaReference is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloadorchestration.models.SchemaReference] + :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.SchemaReference] = 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_uri=resource_uri, + schema_reference_name=schema_reference_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.SchemaReference, 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.SchemaReference].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SchemaReference]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_uri: str, + schema_reference_name: str, + properties: _models.SchemaReference, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemaReference: + """update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SchemaReference + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemaReference. The SchemaReference is compatible with MutableMapping + :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_uri: str, + schema_reference_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemaReference: + """update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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: SchemaReference. The SchemaReference is compatible with MutableMapping + :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_uri: str, + schema_reference_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemaReference: + """update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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: SchemaReference. The SchemaReference is compatible with MutableMapping + :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_uri: str, + schema_reference_name: str, + properties: Union[_models.SchemaReference, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SchemaReference: + """update a Schema Reference Resource. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. :type resource_uri: str :param schema_reference_name: The name of the SchemaReference. Required. :type schema_reference_name: str + :param properties: The resource properties to be updated. Is one of the following types: + SchemaReference, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SchemaReference or JSON or IO[bytes] :return: SchemaReference. The SchemaReference is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference :raises ~azure.core.exceptions.HttpResponseError: @@ -7109,15 +7707,25 @@ async def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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.SchemaReference] = kwargs.pop("cls", None) - _request = build_schema_references_get_request( + 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_schema_references_update_request( resource_uri=resource_uri, schema_reference_name=schema_reference_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7126,6 +7734,7 @@ async def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7140,11 +7749,14 @@ async def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SchemaReference, response.json()) @@ -7153,6 +7765,123 @@ async def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any return deserialized # type: ignore + async def _delete_initial( + self, resource_uri: str, schema_reference_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_schema_references_delete_request( + resource_uri=resource_uri, + schema_reference_name=schema_reference_name, + 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) + + _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 = _failsafe_deserialize( + _models.ErrorResponse, + 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.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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_uri=resource_uri, + schema_reference_name=schema_reference_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_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.SchemaReference"]: """List by specified resource group. @@ -7168,7 +7897,7 @@ def list_by_resource_group(self, resource_uri: str, **kwargs: Any) -> AsyncItemP _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchemaReference]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SchemaReference]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7205,7 +7934,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7218,7 +7950,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SchemaReference], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SchemaReference], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -7234,7 +7969,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -7305,6 +8043,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7319,11 +8058,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Solution, response.json()) @@ -7377,6 +8119,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7390,7 +8133,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -7400,7 +8146,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7584,7 +8330,7 @@ async def _update_initial( resource_group_name: str, target_name: str, solution_name: str, - properties: Union[_models.Solution, JSON, IO[bytes]], + properties: Union[_models.SolutionUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -7624,6 +8370,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7637,7 +8384,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -7645,7 +8395,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7658,7 +8408,7 @@ async def begin_update( resource_group_name: str, target_name: str, solution_name: str, - properties: _models.Solution, + properties: _models.SolutionUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -7673,7 +8423,7 @@ async def begin_update( :param solution_name: Name of the solution. Required. :type solution_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Solution + :type properties: ~azure.mgmt.workloadorchestration.models.SolutionUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7751,7 +8501,7 @@ async def begin_update( resource_group_name: str, target_name: str, solution_name: str, - properties: Union[_models.Solution, JSON, IO[bytes]], + properties: Union[_models.SolutionUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Solution]: """Update a Solution Resource. @@ -7764,8 +8514,8 @@ async def begin_update( :param solution_name: Name of the solution. Required. :type solution_name: str :param properties: The resource properties to be updated. Is one of the following types: - Solution, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Solution or JSON or IO[bytes] + SolutionUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SolutionUpdate or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns Solution. The Solution is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloadorchestration.models.Solution] @@ -7854,6 +8604,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7867,7 +8618,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -7875,7 +8629,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7963,7 +8717,7 @@ def list_by_target( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Solution]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Solution]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8002,7 +8756,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8015,7 +8772,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Solution], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Solution], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -8031,7 +8791,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -8102,6 +8865,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8116,11 +8880,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTemplateVersion, response.json()) @@ -8148,7 +8915,7 @@ def list_by_solution_template( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SolutionTemplateVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SolutionTemplateVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8187,7 +8954,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8200,7 +8970,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTemplateVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SolutionTemplateVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -8216,7 +8989,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -8268,6 +9044,7 @@ async def _bulk_deploy_solution_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8281,14 +9058,17 @@ async def _bulk_deploy_solution_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8504,6 +9284,7 @@ async def _bulk_publish_solution_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8517,14 +9298,17 @@ async def _bulk_publish_solution_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8756,6 +9540,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8770,11 +9555,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTemplate, response.json()) @@ -8826,6 +9614,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8839,7 +9628,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -8849,7 +9641,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9024,7 +9816,7 @@ async def update( self, resource_group_name: str, solution_template_name: str, - properties: _models.SolutionTemplate, + properties: _models.SolutionTemplateUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -9037,7 +9829,7 @@ async def update( :param solution_template_name: The name of the SolutionTemplate. Required. :type solution_template_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.SolutionTemplate + :type properties: ~azure.mgmt.workloadorchestration.models.SolutionTemplateUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9105,7 +9897,7 @@ async def update( self, resource_group_name: str, solution_template_name: str, - properties: Union[_models.SolutionTemplate, JSON, IO[bytes]], + properties: Union[_models.SolutionTemplateUpdate, JSON, IO[bytes]], **kwargs: Any ) -> _models.SolutionTemplate: """update a Solution Template Resource. @@ -9116,8 +9908,8 @@ async def update( :param solution_template_name: The name of the SolutionTemplate. Required. :type solution_template_name: str :param properties: The resource properties to be updated. Is one of the following types: - SolutionTemplate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.SolutionTemplate or JSON or + SolutionTemplateUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SolutionTemplateUpdate or JSON or IO[bytes] :return: SolutionTemplate. The SolutionTemplate is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.SolutionTemplate @@ -9159,6 +9951,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9173,11 +9966,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTemplate, response.json()) @@ -9229,6 +10025,7 @@ async def _create_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9242,7 +10039,10 @@ async def _create_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -9250,7 +10050,7 @@ async def _create_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9392,14 +10192,10 @@ async def begin_create_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SolutionTemplateVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -9468,6 +10264,7 @@ async def _remove_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9481,14 +10278,17 @@ async def _remove_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9674,6 +10474,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9687,7 +10488,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -9695,7 +10499,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9778,7 +10582,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SolutionTemplate]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SolutionTemplate]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9816,7 +10620,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9829,7 +10636,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTemplate], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SolutionTemplate], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -9845,7 +10655,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -9864,7 +10677,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Solutio _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SolutionTemplate]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SolutionTemplate]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9901,7 +10714,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9914,7 +10730,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTemplate], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SolutionTemplate], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -9930,7 +10749,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -10004,6 +10826,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10018,11 +10841,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Instance, response.json()) @@ -10078,6 +10904,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10091,7 +10918,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -10101,7 +10931,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -10340,6 +11170,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10353,7 +11184,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -10361,7 +11195,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -10584,6 +11418,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10597,7 +11432,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -10605,7 +11443,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -10698,7 +11536,7 @@ def list_by_solution( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Instance]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Instance]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10738,7 +11576,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10751,7 +11592,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Instance], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Instance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -10767,7 +11611,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -10850,6 +11697,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10864,11 +11712,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.InstanceHistory, response.json()) @@ -10900,7 +11751,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.InstanceHistory]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.InstanceHistory]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10941,7 +11792,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10954,7 +11808,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.InstanceHistory], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.InstanceHistory], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -10970,7 +11827,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -11036,6 +11896,7 @@ async def get(self, resource_group_name: str, config_template_name: str, **kwarg } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11050,11 +11911,14 @@ async def get(self, resource_group_name: str, config_template_name: str, **kwarg except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ConfigTemplate, response.json()) @@ -11106,6 +11970,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11119,7 +11984,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -11129,7 +11997,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -11304,7 +12172,7 @@ async def update( self, resource_group_name: str, config_template_name: str, - properties: _models.ConfigTemplate, + properties: _models.ConfigTemplateUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -11317,7 +12185,7 @@ async def update( :param config_template_name: The name of the ConfigTemplate. Required. :type config_template_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.ConfigTemplate + :type properties: ~azure.mgmt.workloadorchestration.models.ConfigTemplateUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11385,7 +12253,7 @@ async def update( self, resource_group_name: str, config_template_name: str, - properties: Union[_models.ConfigTemplate, JSON, IO[bytes]], + properties: Union[_models.ConfigTemplateUpdate, JSON, IO[bytes]], **kwargs: Any ) -> _models.ConfigTemplate: """update a Config Template Resource. @@ -11396,8 +12264,9 @@ async def update( :param config_template_name: The name of the ConfigTemplate. Required. :type config_template_name: str :param properties: The resource properties to be updated. Is one of the following types: - ConfigTemplate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.ConfigTemplate or JSON or IO[bytes] + ConfigTemplateUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.ConfigTemplateUpdate or JSON or + IO[bytes] :return: ConfigTemplate. The ConfigTemplate is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.ConfigTemplate :raises ~azure.core.exceptions.HttpResponseError: @@ -11438,6 +12307,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11452,11 +12322,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ConfigTemplate, response.json()) @@ -11508,6 +12381,7 @@ async def _create_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11521,7 +12395,10 @@ async def _create_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -11529,7 +12406,7 @@ async def _create_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -11671,14 +12548,10 @@ async def begin_create_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.ConfigTemplateVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -11843,6 +12716,7 @@ async def remove_version( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11857,11 +12731,14 @@ async def remove_version( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.RemoveVersionResponse, response.json()) @@ -11899,6 +12776,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11912,7 +12790,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -11920,7 +12801,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -12003,7 +12884,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ConfigTemplate]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ConfigTemplate]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12041,7 +12922,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -12054,7 +12938,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ConfigTemplate], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.ConfigTemplate], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -12070,7 +12957,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -12089,7 +12979,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.ConfigT _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ConfigTemplate]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ConfigTemplate]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12126,7 +13016,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -12139,7 +13032,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ConfigTemplate], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.ConfigTemplate], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -12155,7 +13051,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -12226,6 +13125,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12240,11 +13140,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ConfigTemplateVersion, response.json()) @@ -12272,7 +13175,7 @@ def list_by_config_template( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ConfigTemplateVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ConfigTemplateVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12311,7 +13214,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -12324,7 +13230,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ConfigTemplateVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.ConfigTemplateVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -12340,7 +13249,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -12411,6 +13323,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12425,11 +13338,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Workflow, response.json()) @@ -12483,6 +13399,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12496,7 +13413,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -12506,7 +13426,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -12730,6 +13650,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12743,7 +13664,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -12751,7 +13675,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -12960,6 +13884,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12973,7 +13898,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -12981,7 +13909,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -13069,7 +13997,7 @@ def list_by_context( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Workflow]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Workflow]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13108,7 +14036,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -13121,7 +14052,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Workflow], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Workflow], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -13137,7 +14071,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -13211,6 +14148,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -13225,11 +14163,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.WorkflowVersion, response.json()) @@ -13285,6 +14226,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -13298,7 +14240,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -13308,7 +14253,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -13551,6 +14496,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -13564,7 +14510,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -13572,7 +14521,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -13799,6 +14748,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -13812,7 +14762,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -13820,7 +14773,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -13913,7 +14866,7 @@ def list_by_workflow( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.WorkflowVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.WorkflowVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13953,7 +14906,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -13966,7 +14922,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.WorkflowVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.WorkflowVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -13982,7 +14941,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -14065,6 +15027,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14079,11 +15042,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Execution, response.json()) @@ -14141,6 +15107,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14154,7 +15121,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -14164,7 +15134,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -14418,6 +15388,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14431,7 +15402,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -14439,7 +15413,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -14682,6 +15656,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14695,7 +15670,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -14703,7 +15681,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -14807,7 +15785,7 @@ def list_by_workflow_version( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Execution]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Execution]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14848,7 +15826,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -14861,7 +15842,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Execution], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Execution], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -14877,7 +15861,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -14943,6 +15930,7 @@ async def get(self, resource_group_name: str, diagnostic_name: str, **kwargs: An } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14957,11 +15945,14 @@ async def get(self, resource_group_name: str, diagnostic_name: str, **kwargs: An except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Diagnostic, response.json()) @@ -15013,6 +16004,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15026,7 +16018,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -15036,7 +16031,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -15206,7 +16201,7 @@ async def _update_initial( self, resource_group_name: str, diagnostic_name: str, - properties: Union[_models.Diagnostic, JSON, IO[bytes]], + properties: Union[_models.DiagnosticUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -15245,6 +16240,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15258,7 +16254,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -15266,7 +16265,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -15278,7 +16277,7 @@ async def begin_update( self, resource_group_name: str, diagnostic_name: str, - properties: _models.Diagnostic, + properties: _models.DiagnosticUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -15291,7 +16290,7 @@ async def begin_update( :param diagnostic_name: Name of Diagnostic. Required. :type diagnostic_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Diagnostic + :type properties: ~azure.mgmt.workloadorchestration.models.DiagnosticUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15362,7 +16361,7 @@ async def begin_update( self, resource_group_name: str, diagnostic_name: str, - properties: Union[_models.Diagnostic, JSON, IO[bytes]], + properties: Union[_models.DiagnosticUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Diagnostic]: """Updates existing Diagnostic resource. @@ -15373,8 +16372,9 @@ async def begin_update( :param diagnostic_name: Name of Diagnostic. Required. :type diagnostic_name: str :param properties: The resource properties to be updated. Is one of the following types: - Diagnostic, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Diagnostic or JSON or IO[bytes] + DiagnosticUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.DiagnosticUpdate or JSON or + IO[bytes] :return: An instance of AsyncLROPoller that returns Diagnostic. The Diagnostic is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloadorchestration.models.Diagnostic] @@ -15461,6 +16461,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15474,7 +16475,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -15482,7 +16486,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -15561,7 +16565,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Diagnostic]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Diagnostic]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15599,7 +16603,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -15612,7 +16619,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Diagnostic], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Diagnostic], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -15628,7 +16638,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -15647,7 +16660,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Diagnos _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Diagnostic]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Diagnostic]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15684,7 +16697,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -15697,7 +16713,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Diagnostic], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Diagnostic], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -15713,7 +16732,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -15779,6 +16801,7 @@ async def get(self, resource_group_name: str, context_name: str, **kwargs: Any) } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15793,11 +16816,14 @@ async def get(self, resource_group_name: str, context_name: str, **kwargs: Any) except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Context, response.json()) @@ -15849,6 +16875,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15862,7 +16889,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -15872,7 +16902,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -16042,7 +17072,7 @@ async def _update_initial( self, resource_group_name: str, context_name: str, - properties: Union[_models.Context, JSON, IO[bytes]], + properties: Union[_models.ContextUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -16081,6 +17111,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16094,7 +17125,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -16102,7 +17136,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -16114,7 +17148,7 @@ async def begin_update( self, resource_group_name: str, context_name: str, - properties: _models.Context, + properties: _models.ContextUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -16127,7 +17161,7 @@ async def begin_update( :param context_name: The name of the Context. Required. :type context_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Context + :type properties: ~azure.mgmt.workloadorchestration.models.ContextUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16198,7 +17232,7 @@ async def begin_update( self, resource_group_name: str, context_name: str, - properties: Union[_models.Context, JSON, IO[bytes]], + properties: Union[_models.ContextUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Context]: """update an Context Resource. @@ -16209,8 +17243,8 @@ async def begin_update( :param context_name: The name of the Context. Required. :type context_name: str :param properties: The resource properties to be updated. Is one of the following types: - Context, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Context or JSON or IO[bytes] + ContextUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.ContextUpdate or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns Context. The Context is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloadorchestration.models.Context] @@ -16283,7 +17317,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Context]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Context]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -16321,7 +17355,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -16334,7 +17371,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Context], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Context], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -16350,7 +17390,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -16369,7 +17412,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Context _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Context]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Context]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -16406,7 +17449,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -16419,7 +17465,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Context], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Context], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -16435,7 +17484,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -16469,6 +17521,7 @@ async def _delete_initial(self, resource_group_name: str, context_name: str, **k } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16482,7 +17535,10 @@ async def _delete_initial(self, resource_group_name: str, context_name: str, **k except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -16490,7 +17546,7 @@ async def _delete_initial(self, resource_group_name: str, context_name: str, **k 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -16618,6 +17674,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16632,11 +17689,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SiteReference, response.json()) @@ -16690,6 +17750,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16703,7 +17764,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -16713,7 +17777,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -16941,6 +18005,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16954,7 +18019,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -16962,7 +18030,7 @@ async def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -17175,6 +18243,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -17188,7 +18257,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -17196,7 +18268,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -17284,7 +18356,7 @@ def list_by_context( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SiteReference]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SiteReference]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -17323,7 +18395,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -17336,7 +18411,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SiteReference], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SiteReference], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -17352,7 +18430,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/operations/_patch.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/operations/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/operations/_patch.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/aio/operations/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/__init__.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/__init__.py index 95325a8c745f..e02e2005525d 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/__init__.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/__init__.py @@ -23,16 +23,22 @@ ComponentStatus, ConfigTemplate, ConfigTemplateProperties, + ConfigTemplateUpdate, + ConfigTemplateUpdateProperties, ConfigTemplateVersion, ConfigTemplateVersionProperties, ConfigTemplateVersionWithUpdateType, Context, ContextProperties, + ContextUpdate, + ContextUpdateProperties, DeployJobParameter, DeployJobStepStatistics, DeploymentStatus, Diagnostic, DiagnosticProperties, + DiagnosticUpdate, + DiagnosticUpdateProperties, DynamicSchema, DynamicSchemaProperties, DynamicSchemaVersion, @@ -66,6 +72,8 @@ SchemaProperties, SchemaReference, SchemaReferenceProperties, + SchemaUpdate, + SchemaUpdateProperties, SchemaVersion, SchemaVersionProperties, SchemaVersionWithUpdateType, @@ -78,9 +86,13 @@ SolutionTemplate, SolutionTemplateParameter, SolutionTemplateProperties, + SolutionTemplateUpdate, + SolutionTemplateUpdateProperties, SolutionTemplateVersion, SolutionTemplateVersionProperties, SolutionTemplateVersionWithUpdateType, + SolutionUpdate, + SolutionUpdateProperties, SolutionVersion, SolutionVersionParameter, SolutionVersionProperties, @@ -92,6 +104,8 @@ TargetProperties, TargetSnapshot, TargetStatus, + TargetUpdate, + TargetUpdateProperties, TaskOption, TaskSpec, TrackedResource, @@ -135,16 +149,22 @@ "ComponentStatus", "ConfigTemplate", "ConfigTemplateProperties", + "ConfigTemplateUpdate", + "ConfigTemplateUpdateProperties", "ConfigTemplateVersion", "ConfigTemplateVersionProperties", "ConfigTemplateVersionWithUpdateType", "Context", "ContextProperties", + "ContextUpdate", + "ContextUpdateProperties", "DeployJobParameter", "DeployJobStepStatistics", "DeploymentStatus", "Diagnostic", "DiagnosticProperties", + "DiagnosticUpdate", + "DiagnosticUpdateProperties", "DynamicSchema", "DynamicSchemaProperties", "DynamicSchemaVersion", @@ -178,6 +198,8 @@ "SchemaProperties", "SchemaReference", "SchemaReferenceProperties", + "SchemaUpdate", + "SchemaUpdateProperties", "SchemaVersion", "SchemaVersionProperties", "SchemaVersionWithUpdateType", @@ -190,9 +212,13 @@ "SolutionTemplate", "SolutionTemplateParameter", "SolutionTemplateProperties", + "SolutionTemplateUpdate", + "SolutionTemplateUpdateProperties", "SolutionTemplateVersion", "SolutionTemplateVersionProperties", "SolutionTemplateVersionWithUpdateType", + "SolutionUpdate", + "SolutionUpdateProperties", "SolutionVersion", "SolutionVersionParameter", "SolutionVersionProperties", @@ -204,6 +230,8 @@ "TargetProperties", "TargetSnapshot", "TargetStatus", + "TargetUpdate", + "TargetUpdateProperties", "TaskOption", "TaskSpec", "TrackedResource", diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_enums.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_enums.py index d4768dfc549a..dc2a884f8fcf 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_enums.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_enums.py @@ -14,27 +14,27 @@ class ActiveState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Instance State.""" ACTIVE = "active" - """Instance is active""" + """Instance is active.""" INACTIVE = "inactive" - """Instance is inactive""" + """Instance is inactive.""" class ConfigurationModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Available configuration models.""" APPLICATION = "Application" - """Configuration model Application""" + """Configuration model Application.""" COMMON = "Common" - """Configuration model Common""" + """Configuration model Common.""" class ConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Available configuration types.""" SHARED = "Shared" - """Configuration type Shared""" + """Configuration type Shared.""" HIERARCHY = "Hierarchy" - """Configuration type Hierarchy""" + """Configuration type Hierarchy.""" class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -54,20 +54,20 @@ class ErrorActionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Error Action Mode.""" STOP_ON_ANY_FAILURE = "stopOnAnyFailure" - """Stop on any failure""" + """Stop on any failure.""" STOP_ON_N_FAILURES = "stopOnNFailures" - """Stop after N cumulative failures""" + """Stop after N cumulative failures.""" SILENTLY_CONTINUE = "silentlyContinue" - """Continue silently despite errors""" + """Continue silently despite errors.""" class ExtendedLocationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The supported ExtendedLocation types.""" EDGE_ZONE = "EdgeZone" - """Azure Edge Zones location type""" + """Azure Edge Zones location type.""" CUSTOM_LOCATION = "CustomLocation" - """Azure Custom Locations type""" + """Azure Custom Locations type.""" class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -98,7 +98,7 @@ class OrchestratorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Available Orchestrator types.""" TO = "TO" - """Default type""" + """Default type.""" class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -111,73 +111,73 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): CANCELED = "Canceled" """Resource creation was canceled.""" INITIALIZED = "Initialized" - """Resource Provisioning is initialized""" + """Resource Provisioning is initialized.""" INPROGRESS = "InProgress" - """Resource Provisioning is in progress""" + """Resource Provisioning is in progress.""" DELETING = "Deleting" - """Resource Provisioning is deleting""" + """Resource Provisioning is deleting.""" class ReconciliationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Defines a state of the reconciliation policy.""" INACTIVE = "inactive" - """Reconciliation is inactive""" + """Reconciliation is inactive.""" ACTIVE = "active" - """Reconciliation is active""" + """Reconciliation is active.""" class ResourceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Resource Type State.""" ACTIVE = "active" - """Resource is active""" + """Resource is active.""" INACTIVE = "inactive" - """Resource is inactive""" + """Resource is inactive.""" class State(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Solution Instance State.""" IN_REVIEW = "InReview" - """Solution Instance is in review""" + """Solution Instance is in review.""" UPGRADE_IN_REVIEW = "UpgradeInReview" - """Solution Instance upgrade is in review""" + """Solution Instance upgrade is in review.""" READY_TO_DEPLOY = "ReadyToDeploy" - """Solution Instance is ready to deploy""" + """Solution Instance is ready to deploy.""" READY_TO_UPGRADE = "ReadyToUpgrade" - """Solution Instance is ready to upgrade""" + """Solution Instance is ready to upgrade.""" DEPLOYING = "Deploying" - """Solution Instance is deploying""" + """Solution Instance is deploying.""" DEPLOYED = "Deployed" - """Solution Instance is deployed""" + """Solution Instance is deployed.""" FAILED = "Failed" - """Solution Instance failed to deploy""" + """Solution Instance failed to deploy.""" UNDEPLOYED = "Undeployed" - """Solution Instance is undeployed""" + """Solution Instance is undeployed.""" PENDING_EXTERNAL_VALIDATION = "PendingExternalValidation" - """Solution Instance is pending external validation""" + """Solution Instance is pending external validation.""" EXTERNAL_VALIDATION_FAILED = "ExternalValidationFailed" - """Solution Instance failed external validation""" + """Solution Instance failed external validation.""" STAGING = "Staging" - """Solution Instance is staging the images""" + """Solution Instance is staging the images.""" class UpdateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Denotes which part of the version number will be updated.""" MAJOR = "Major" - """Major version""" + """Major version.""" MINOR = "Minor" - """Minor version""" + """Minor version.""" PATCH = "Patch" - """Patch version""" + """Patch version.""" class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Solution Instance Validation Status.""" VALID = "Valid" - """Solution Instance is valid""" + """Solution Instance is valid.""" INVALID = "Invalid" - """Solution Instance is invalid""" + """Solution Instance is invalid.""" diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_models.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_models.py index aaace98a81c8..9d452233d1ba 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_models.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_models.py @@ -9,7 +9,7 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload from .._utils.model_base import Model as _Model, rest_discriminator, rest_field from ._enums import JobType @@ -67,7 +67,7 @@ class BulkDeploySolutionParameter(_Model): :vartype targets: list[~azure.mgmt.workloadorchestration.models.BulkDeployTargetDetails] """ - targets: List["_models.BulkDeployTargetDetails"] = rest_field( + targets: list["_models.BulkDeployTargetDetails"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Targets to which solution needs to be deployed. Required.""" @@ -76,7 +76,7 @@ class BulkDeploySolutionParameter(_Model): def __init__( self, *, - targets: List["_models.BulkDeployTargetDetails"], + targets: list["_models.BulkDeployTargetDetails"], ) -> None: ... @overload @@ -132,7 +132,7 @@ class BulkPublishSolutionParameter(_Model): list[~azure.mgmt.workloadorchestration.models.SolutionDependencyParameter] """ - targets: List["_models.BulkPublishTargetDetails"] = rest_field( + targets: list["_models.BulkPublishTargetDetails"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Targets to which solution needs to be published. Required.""" @@ -140,7 +140,7 @@ class BulkPublishSolutionParameter(_Model): name="solutionInstanceName", visibility=["read", "create", "update", "delete", "query"] ) """Name of the solution instance.""" - solution_dependencies: Optional[List["_models.SolutionDependencyParameter"]] = rest_field( + solution_dependencies: Optional[list["_models.SolutionDependencyParameter"]] = rest_field( name="solutionDependencies", visibility=["read", "create", "update", "delete", "query"] ) """Solution dependencies.""" @@ -149,9 +149,9 @@ class BulkPublishSolutionParameter(_Model): def __init__( self, *, - targets: List["_models.BulkPublishTargetDetails"], + targets: list["_models.BulkPublishTargetDetails"], solution_instance_name: Optional[str] = None, - solution_dependencies: Optional[List["_models.SolutionDependencyParameter"]] = None, + solution_dependencies: Optional[list["_models.SolutionDependencyParameter"]] = None, ) -> None: ... @overload @@ -201,7 +201,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Capability(_Model): - """Capability, to match in Solution Templates & Targets. + """Capability, to match in Solution Templates and Targets. :ivar name: Name of Capability. Required. :vartype name: str @@ -321,7 +321,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -331,7 +331,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -388,7 +388,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.ConfigTemplateProperties"] = None, ) -> None: ... @@ -406,6 +406,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ConfigTemplateProperties(_Model): """Config Template Properties. + :ivar unique_identifier: A unique identifier for the config template, generated by the system. + :vartype unique_identifier: str :ivar description: Description of config template. Required. :vartype description: str :ivar latest_version: Latest config template version. @@ -415,6 +417,8 @@ class ConfigTemplateProperties(_Model): :vartype provisioning_state: str or ~azure.mgmt.workloadorchestration.models.ProvisioningState """ + unique_identifier: Optional[str] = rest_field(name="uniqueIdentifier", visibility=["read"]) + """A unique identifier for the config template, generated by the system.""" description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Description of config template. Required.""" latest_version: Optional[str] = rest_field(name="latestVersion", visibility=["read"]) @@ -443,6 +447,69 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ConfigTemplateUpdate(_Model): + """The type used for update operations of the ConfigTemplate. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.workloadorchestration.models.ConfigTemplateUpdateProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.ConfigTemplateUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ConfigTemplateUpdateProperties"] = 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 ConfigTemplateUpdateProperties(_Model): + """The updatable properties of the ConfigTemplate. + + :ivar description: Description of config template. + :vartype description: str + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of config template.""" + + @overload + def __init__( + self, + *, + description: Optional[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 ProxyResource(Resource): """Proxy Resource. @@ -622,7 +689,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.ContextProperties"] = None, ) -> None: ... @@ -649,9 +716,9 @@ class ContextProperties(_Model): :vartype provisioning_state: str or ~azure.mgmt.workloadorchestration.models.ProvisioningState """ - capabilities: List["_models.Capability"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + capabilities: list["_models.Capability"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """List of Capabilities. Required.""" - hierarchies: List["_models.Hierarchy"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + hierarchies: list["_models.Hierarchy"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """List of Hierarchies. Required.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] @@ -663,8 +730,80 @@ class ContextProperties(_Model): def __init__( self, *, - capabilities: List["_models.Capability"], - hierarchies: List["_models.Hierarchy"], + capabilities: list["_models.Capability"], + hierarchies: list["_models.Hierarchy"], + ) -> 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 ContextUpdate(_Model): + """The type used for update operations of the Context. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.workloadorchestration.models.ContextUpdateProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.ContextUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ContextUpdateProperties"] = 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 ContextUpdateProperties(_Model): + """The updatable properties of the Context. + + :ivar capabilities: List of Capabilities. + :vartype capabilities: list[~azure.mgmt.workloadorchestration.models.Capability] + :ivar hierarchies: List of Hierarchies. + :vartype hierarchies: list[~azure.mgmt.workloadorchestration.models.Hierarchy] + """ + + capabilities: Optional[list["_models.Capability"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of Capabilities.""" + hierarchies: Optional[list["_models.Hierarchy"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of Hierarchies.""" + + @overload + def __init__( + self, + *, + capabilities: Optional[list["_models.Capability"]] = None, + hierarchies: Optional[list["_models.Hierarchy"]] = None, ) -> None: ... @overload @@ -689,7 +828,7 @@ class JobParameterBase(_Model): :vartype job_type: str or ~azure.mgmt.workloadorchestration.models.JobType """ - __mapping__: Dict[str, _Model] = {} + __mapping__: dict[str, _Model] = {} job_type: str = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) """Job type discriminator value. Required. Known values are: \"deploy\", \"staging\", and \"externalValidation\".""" @@ -742,7 +881,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, job_type=JobType.DEPLOY, **kwargs) + super().__init__(*args, **kwargs) + self.job_type = JobType.DEPLOY # type: ignore class JobStepStatisticsBase(_Model): @@ -756,7 +896,7 @@ class JobStepStatisticsBase(_Model): :vartype statistics_type: str or ~azure.mgmt.workloadorchestration.models.JobType """ - __mapping__: Dict[str, _Model] = {} + __mapping__: dict[str, _Model] = {} statistics_type: str = rest_discriminator( name="statisticsType", visibility=["read", "create", "update", "delete", "query"] ) @@ -826,7 +966,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, statistics_type=JobType.DEPLOY, **kwargs) + super().__init__(*args, **kwargs) + self.statistics_type = JobType.DEPLOY # type: ignore class DeploymentStatus(_Model): @@ -872,7 +1013,7 @@ class DeploymentStatus(_Model): """Status details.""" generation: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Deployment Generation.""" - target_statuses: Optional[List["_models.TargetStatus"]] = rest_field( + target_statuses: Optional[list["_models.TargetStatus"]] = rest_field( name="targetStatuses", visibility=["read", "create", "update", "delete", "query"] ) """Target resource statuses.""" @@ -888,7 +1029,7 @@ def __init__( status: Optional[str] = None, status_details: Optional[str] = None, generation: Optional[int] = None, - target_statuses: Optional[List["_models.TargetStatus"]] = None, + target_statuses: Optional[list["_models.TargetStatus"]] = None, ) -> None: ... @overload @@ -949,7 +1090,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.DiagnosticProperties"] = None, extended_location: Optional["_models.ExtendedLocation"] = None, ) -> None: ... @@ -980,6 +1121,45 @@ class DiagnosticProperties(_Model): \"Initialized\", \"InProgress\", and \"Deleting\".""" +class DiagnosticUpdate(_Model): + """The type used for update operations of the Diagnostic. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.workloadorchestration.models.DiagnosticUpdateProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: Optional["_models.DiagnosticUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.DiagnosticUpdateProperties"] = None, + 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 DiagnosticUpdateProperties(_Model): + """The updatable properties of the Diagnostic.""" + + class DynamicSchema(ProxyResource): """DynamicSchema Resource. @@ -1186,9 +1366,9 @@ class ErrorDetail(_Model): """The error message.""" target: Optional[str] = rest_field(visibility=["read"]) """The error target.""" - details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) """The error details.""" - additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( name="additionalInfo", visibility=["read"] ) """The error additional info.""" @@ -1297,7 +1477,7 @@ class ExecutionProperties(_Model): name="workflowVersionId", visibility=["read", "create", "update", "delete", "query"] ) """Workflow version of execution. Required.""" - specification: Optional[Dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + specification: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Execution specification.""" status: Optional["_models.ExecutionStatus"] = rest_field(visibility=["read"]) """Status of Execution.""" @@ -1312,7 +1492,7 @@ def __init__( self, *, workflow_version_id: str, - specification: Optional[Dict[str, Any]] = None, + specification: Optional[dict[str, Any]] = None, ) -> None: ... @overload @@ -1349,7 +1529,7 @@ class ExecutionStatus(_Model): name="statusMessage", visibility=["read", "create", "update", "delete", "query"] ) """status details.""" - stage_history: Optional[List["_models.StageStatus"]] = rest_field( + stage_history: Optional[list["_models.StageStatus"]] = rest_field( name="stageHistory", visibility=["read", "create", "update", "delete", "query"] ) """target resource statuses.""" @@ -1361,7 +1541,7 @@ def __init__( update_time: Optional[datetime.datetime] = None, status: Optional[int] = None, status_message: Optional[str] = None, - stage_history: Optional[List["_models.StageStatus"]] = None, + stage_history: Optional[list["_models.StageStatus"]] = None, ) -> None: ... @overload @@ -1843,7 +2023,7 @@ class JobProperties(_Model): name="correlationId", visibility=["read", "create", "update", "delete", "query"] ) """Correlation ID for tracking.""" - steps: Optional[List["_models.JobStep"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + steps: Optional[list["_models.JobStep"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Steps and substatuses for the job.""" triggered_by: Optional[str] = rest_field( name="triggeredBy", visibility=["read", "create", "update", "delete", "query"] @@ -1867,7 +2047,7 @@ def __init__( end_time: Optional[datetime.datetime] = None, job_parameter: Optional["_models.JobParameterBase"] = None, correlation_id: Optional[str] = None, - steps: Optional[List["_models.JobStep"]] = None, + steps: Optional[list["_models.JobStep"]] = None, triggered_by: Optional[str] = None, ) -> None: ... @@ -1923,7 +2103,7 @@ class JobStep(_Model): visibility=["read", "create", "update", "delete", "query"] ) """Statistics for the step.""" - steps: Optional[List["_models.JobStep"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + steps: Optional[list["_models.JobStep"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Nested substeps for this step.""" error_details: Optional["_models.ErrorDetail"] = rest_field(name="errorDetails", visibility=["read"]) """Error Details if any failure is there.""" @@ -1938,7 +2118,7 @@ def __init__( end_time: Optional[datetime.datetime] = None, message: Optional[str] = None, statistics: Optional["_models.JobStepStatisticsBase"] = None, - steps: Optional[List["_models.JobStep"]] = None, + steps: Optional[list["_models.JobStep"]] = None, ) -> None: ... @overload @@ -2123,7 +2303,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.SchemaProperties"] = None, ) -> None: ... @@ -2244,6 +2424,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class SchemaUpdate(_Model): + """The type used for update operations of the Schema. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.workloadorchestration.models.SchemaUpdateProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: Optional["_models.SchemaUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.SchemaUpdateProperties"] = None, + 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 SchemaUpdateProperties(_Model): + """The updatable properties of the Schema.""" + + class SchemaVersion(ProxyResource): """Schema Version Resource. @@ -2536,7 +2755,7 @@ class SolutionDependency(_Model): """Solution Template Version Id. Required.""" target_id: str = rest_field(name="targetId", visibility=["read", "create", "update", "delete", "query"]) """Target Id. Required.""" - dependencies: Optional[List["_models.SolutionDependency"]] = rest_field( + dependencies: Optional[list["_models.SolutionDependency"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Solution dependencies.""" @@ -2549,7 +2768,7 @@ def __init__( solution_template_version_id: str, target_id: str, solution_instance_name: Optional[str] = None, - dependencies: Optional[List["_models.SolutionDependency"]] = None, + dependencies: Optional[list["_models.SolutionDependency"]] = None, ) -> None: ... @overload @@ -2599,7 +2818,7 @@ class SolutionDependencyParameter(_Model): """Solution Instance Name.""" target_id: Optional[str] = rest_field(name="targetId", visibility=["read", "create", "update", "delete", "query"]) """Target Id.""" - dependencies: Optional[List["_models.SolutionDependencyParameter"]] = rest_field( + dependencies: Optional[list["_models.SolutionDependencyParameter"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Solution dependencies.""" @@ -2613,7 +2832,7 @@ def __init__( solution_template_version: Optional[str] = None, solution_instance_name: Optional[str] = None, target_id: Optional[str] = None, - dependencies: Optional[List["_models.SolutionDependencyParameter"]] = None, + dependencies: Optional[list["_models.SolutionDependencyParameter"]] = None, ) -> None: ... @overload @@ -2643,7 +2862,7 @@ class SolutionProperties(_Model): solution_template_id: Optional[str] = rest_field(name="solutionTemplateId", visibility=["read"]) """Solution template Id.""" - available_solution_template_versions: Optional[List["_models.AvailableSolutionTemplateVersion"]] = rest_field( + available_solution_template_versions: Optional[list["_models.AvailableSolutionTemplateVersion"]] = rest_field( name="availableSolutionTemplateVersions", visibility=["read"] ) """List of latest revisions for available solution template versions.""" @@ -2696,7 +2915,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.SolutionTemplateProperties"] = None, ) -> None: ... @@ -2731,7 +2950,7 @@ class SolutionTemplateParameter(_Model): name="solutionInstanceName", visibility=["read", "create", "update", "delete", "query"] ) """Solution Instance Name.""" - solution_dependencies: Optional[List["_models.SolutionDependencyParameter"]] = rest_field( + solution_dependencies: Optional[list["_models.SolutionDependencyParameter"]] = rest_field( name="solutionDependencies", visibility=["read", "create", "update", "delete", "query"] ) """Solution Dependencies.""" @@ -2742,7 +2961,7 @@ def __init__( *, solution_template_version_id: str, solution_instance_name: Optional[str] = None, - solution_dependencies: Optional[List["_models.SolutionDependencyParameter"]] = None, + solution_dependencies: Optional[list["_models.SolutionDependencyParameter"]] = None, ) -> None: ... @overload @@ -2759,6 +2978,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SolutionTemplateProperties(_Model): """Solution Template Properties. + :ivar unique_identifier: A unique identifier for the solution template, generated by the + system. + :vartype unique_identifier: str :ivar description: Description of Solution template. Required. :vartype description: str :ivar capabilities: List of capabilities. Required. @@ -2774,9 +2996,11 @@ class SolutionTemplateProperties(_Model): :vartype provisioning_state: str or ~azure.mgmt.workloadorchestration.models.ProvisioningState """ + unique_identifier: Optional[str] = rest_field(name="uniqueIdentifier", visibility=["read"]) + """A unique identifier for the solution template, generated by the system.""" description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Description of Solution template. Required.""" - capabilities: List[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + capabilities: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """List of capabilities. Required.""" latest_version: Optional[str] = rest_field(name="latestVersion", visibility=["read"]) """Latest solution template version.""" @@ -2799,7 +3023,89 @@ def __init__( self, *, description: str, - capabilities: List[str], + capabilities: list[str], + state: Optional[Union[str, "_models.ResourceState"]] = None, + enable_external_validation: Optional[bool] = 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 SolutionTemplateUpdate(_Model): + """The type used for update operations of the SolutionTemplate. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.workloadorchestration.models.SolutionTemplateUpdateProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.SolutionTemplateUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.SolutionTemplateUpdateProperties"] = 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 SolutionTemplateUpdateProperties(_Model): + """The updatable properties of the SolutionTemplate. + + :ivar description: Description of Solution template. + :vartype description: str + :ivar capabilities: List of capabilities. + :vartype capabilities: list[str] + :ivar state: State of resource. Known values are: "active" and "inactive". + :vartype state: str or ~azure.mgmt.workloadorchestration.models.ResourceState + :ivar enable_external_validation: Flag to enable external validation. + :vartype enable_external_validation: bool + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of Solution template.""" + capabilities: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of capabilities.""" + state: Optional[Union[str, "_models.ResourceState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """State of resource. Known values are: \"active\" and \"inactive\".""" + enable_external_validation: Optional[bool] = rest_field( + name="enableExternalValidation", visibility=["read", "create", "update", "delete", "query"] + ) + """Flag to enable external validation.""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + capabilities: Optional[list[str]] = None, state: Optional[Union[str, "_models.ResourceState"]] = None, enable_external_validation: Optional[bool] = None, ) -> None: ... @@ -2883,7 +3189,7 @@ class SolutionTemplateVersionProperties(_Model): configurations: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Config expressions for this solution version. Required.""" - specification: Dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + specification: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """App components spec. Required.""" orchestrator_type: Optional[Union[str, "_models.OrchestratorType"]] = rest_field( name="orchestratorType", visibility=["read", "create", "update", "delete", "query"] @@ -2900,7 +3206,7 @@ def __init__( self, *, configurations: str, - specification: Dict[str, Any], + specification: dict[str, Any], orchestrator_type: Optional[Union[str, "_models.OrchestratorType"]] = None, ) -> None: ... @@ -2958,6 +3264,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class SolutionUpdate(_Model): + """The type used for update operations of the Solution. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.workloadorchestration.models.SolutionUpdateProperties + """ + + properties: Optional["_models.SolutionUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.SolutionUpdateProperties"] = 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 SolutionUpdateProperties(_Model): + """The updatable properties of the Solution.""" + + class SolutionVersion(ProxyResource): """Solution Version Resource. It has the resolved configuration along with edge specification. @@ -3097,7 +3437,7 @@ class SolutionVersionProperties(_Model): """Resolved configuration values.""" target_level_configuration: Optional[str] = rest_field(name="targetLevelConfiguration", visibility=["read"]) """Configuration on the line level across all solution template versions.""" - specification: Dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + specification: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """App components spec. Required.""" review_id: Optional[str] = rest_field(name="reviewId", visibility=["read"]) """Review id of resolved config for this solution version.""" @@ -3109,7 +3449,7 @@ class SolutionVersionProperties(_Model): \"PendingExternalValidation\", \"ExternalValidationFailed\", and \"Staging\".""" solution_instance_name: Optional[str] = rest_field(name="solutionInstanceName", visibility=["read"]) """Solution instance name.""" - solution_dependencies: Optional[List["_models.SolutionDependency"]] = rest_field( + solution_dependencies: Optional[list["_models.SolutionDependency"]] = rest_field( name="solutionDependencies", visibility=["read"] ) """Solution Dependency Context.""" @@ -3130,7 +3470,7 @@ class SolutionVersionProperties(_Model): def __init__( self, *, - specification: Dict[str, Any], + specification: dict[str, Any], ) -> None: ... @overload @@ -3157,7 +3497,7 @@ class SolutionVersionSnapshot(_Model): name="solutionVersionId", visibility=["read", "create", "update", "delete", "query"] ) """Solution version of instance.""" - specification: Optional[Dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + specification: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """App components spec.""" @overload @@ -3165,7 +3505,7 @@ def __init__( self, *, solution_version_id: Optional[str] = None, - specification: Optional[Dict[str, Any]] = None, + specification: Optional[dict[str, Any]] = None, ) -> None: ... @overload @@ -3194,9 +3534,9 @@ class StageSpec(_Model): name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Name of Stage. Required.""" - specification: Optional[Dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + specification: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Stage specification.""" - tasks: Optional[List["_models.TaskSpec"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tasks: Optional[list["_models.TaskSpec"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """List of tasks in the stage.""" task_option: Optional["_models.TaskOption"] = rest_field( name="taskOption", visibility=["read", "create", "update", "delete", "query"] @@ -3208,8 +3548,8 @@ def __init__( self, *, name: str, - specification: Optional[Dict[str, Any]] = None, - tasks: Optional[List["_models.TaskSpec"]] = None, + specification: Optional[dict[str, Any]] = None, + tasks: Optional[list["_models.TaskSpec"]] = None, task_option: Optional["_models.TaskOption"] = None, ) -> None: ... @@ -3265,10 +3605,10 @@ class StageStatus(_Model): name="isActive", visibility=["read", "create", "update", "delete", "query"] ) """whether this stage is active or inactive. Known values are: \"active\" and \"inactive\".""" - inputs: Optional[Dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + inputs: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The inputs of the StageHistory, Inputs holds a key-value map of user-defined parameters for the initial stage.""" - outputs: Optional[Dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + outputs: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The outputs of the StageHistory, it is different as the different input stages.""" @overload @@ -3281,8 +3621,8 @@ def __init__( nextstage: Optional[str] = None, error_message: Optional[str] = None, is_active: Optional[Union[str, "_models.ActiveState"]] = None, - inputs: Optional[Dict[str, Any]] = None, - outputs: Optional[Dict[str, Any]] = None, + inputs: Optional[dict[str, Any]] = None, + outputs: Optional[dict[str, Any]] = None, ) -> None: ... @overload @@ -3410,7 +3750,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.TargetProperties"] = None, extended_location: Optional["_models.ExtendedLocation"] = None, ) -> None: ... @@ -3458,11 +3798,11 @@ class TargetProperties(_Model): """Display name of target. Required.""" context_id: str = rest_field(name="contextId", visibility=["read", "create", "update", "delete", "query"]) """ArmId of Context. Required.""" - target_specification: Dict[str, Any] = rest_field( + target_specification: dict[str, Any] = rest_field( name="targetSpecification", visibility=["read", "create", "update", "delete", "query"] ) """target spec. Required.""" - capabilities: List[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + capabilities: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """List of capabilities. Required.""" hierarchy_level: str = rest_field(name="hierarchyLevel", visibility=["read", "create", "update", "delete", "query"]) """Hierarchy Level. Required.""" @@ -3489,8 +3829,8 @@ def __init__( description: str, display_name: str, context_id: str, - target_specification: Dict[str, Any], - capabilities: List[str], + target_specification: dict[str, Any], + capabilities: list[str], hierarchy_level: str, solution_scope: Optional[str] = None, state: Optional[Union[str, "_models.ResourceState"]] = None, @@ -3520,7 +3860,7 @@ class TargetSnapshot(_Model): target_id: Optional[str] = rest_field(name="targetId", visibility=["read", "create", "update", "delete", "query"]) """Target of instance.""" - target_specification: Optional[Dict[str, Any]] = rest_field( + target_specification: Optional[dict[str, Any]] = rest_field( name="targetSpecification", visibility=["read", "create", "update", "delete", "query"] ) """target spec.""" @@ -3534,7 +3874,7 @@ def __init__( self, *, target_id: Optional[str] = None, - target_specification: Optional[Dict[str, Any]] = None, + target_specification: Optional[dict[str, Any]] = None, solution_scope: Optional[str] = None, ) -> None: ... @@ -3564,7 +3904,7 @@ class TargetStatus(_Model): """Target name.""" status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Target status.""" - component_statuses: Optional[List["_models.ComponentStatus"]] = rest_field( + component_statuses: Optional[list["_models.ComponentStatus"]] = rest_field( name="componentStatuses", visibility=["read", "create", "update", "delete", "query"] ) """Component statuses.""" @@ -3575,7 +3915,115 @@ def __init__( *, name: Optional[str] = None, status: Optional[str] = None, - component_statuses: Optional[List["_models.ComponentStatus"]] = None, + component_statuses: Optional[list["_models.ComponentStatus"]] = 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 TargetUpdate(_Model): + """The type used for update operations of the Target. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.workloadorchestration.models.TargetUpdateProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.TargetUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.TargetUpdateProperties"] = 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 TargetUpdateProperties(_Model): + """The updatable properties of the Target. + + :ivar description: Description of target. + :vartype description: str + :ivar display_name: Display name of target. + :vartype display_name: str + :ivar context_id: ArmId of Context. + :vartype context_id: str + :ivar target_specification: target spec. + :vartype target_specification: dict[str, any] + :ivar capabilities: List of capabilities. + :vartype capabilities: list[str] + :ivar hierarchy_level: Hierarchy Level. + :vartype hierarchy_level: str + :ivar solution_scope: Scope of the target resource. + :vartype solution_scope: str + :ivar state: State of resource. Known values are: "active" and "inactive". + :vartype state: str or ~azure.mgmt.workloadorchestration.models.ResourceState + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of target.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Display name of target.""" + context_id: Optional[str] = rest_field(name="contextId", visibility=["read", "create", "update", "delete", "query"]) + """ArmId of Context.""" + target_specification: Optional[dict[str, Any]] = rest_field( + name="targetSpecification", visibility=["read", "create", "update", "delete", "query"] + ) + """target spec.""" + capabilities: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of capabilities.""" + hierarchy_level: Optional[str] = rest_field( + name="hierarchyLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """Hierarchy Level.""" + solution_scope: Optional[str] = rest_field( + name="solutionScope", visibility=["read", "create", "update", "delete", "query"] + ) + """Scope of the target resource.""" + state: Optional[Union[str, "_models.ResourceState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """State of resource. Known values are: \"active\" and \"inactive\".""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + display_name: Optional[str] = None, + context_id: Optional[str] = None, + target_specification: Optional[dict[str, Any]] = None, + capabilities: Optional[list[str]] = None, + hierarchy_level: Optional[str] = None, + solution_scope: Optional[str] = None, + state: Optional[Union[str, "_models.ResourceState"]] = None, ) -> None: ... @overload @@ -3639,7 +4087,7 @@ class TaskSpec(_Model): """Name of Task. Required.""" target_id: Optional[str] = rest_field(name="targetId", visibility=["read", "create", "update", "delete", "query"]) """Target ARM id.""" - specification: Dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + specification: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Task specification. Required.""" @overload @@ -3647,7 +4095,7 @@ def __init__( self, *, name: str, - specification: Dict[str, Any], + specification: dict[str, Any], target_id: Optional[str] = None, ) -> None: ... @@ -3939,7 +4387,7 @@ class WorkflowVersionProperties(_Model): """Revision number of resolved config for this workflow version.""" configuration: Optional[str] = rest_field(visibility=["read"]) """Resolved configuration values.""" - stage_spec: List["_models.StageSpec"] = rest_field( + stage_spec: list["_models.StageSpec"] = rest_field( name="stageSpec", visibility=["read", "create", "update", "delete", "query"] ) """A list of stage specs. Required.""" @@ -3949,7 +4397,7 @@ class WorkflowVersionProperties(_Model): """State of workflow version. Known values are: \"InReview\", \"UpgradeInReview\", \"ReadyToDeploy\", \"ReadyToUpgrade\", \"Deploying\", \"Deployed\", \"Failed\", \"Undeployed\", \"PendingExternalValidation\", \"ExternalValidationFailed\", and \"Staging\".""" - specification: Optional[Dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + specification: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Execution specification.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] @@ -3961,8 +4409,8 @@ class WorkflowVersionProperties(_Model): def __init__( self, *, - stage_spec: List["_models.StageSpec"], - specification: Optional[Dict[str, Any]] = None, + stage_spec: list["_models.StageSpec"], + specification: Optional[dict[str, Any]] = None, ) -> None: ... @overload diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_patch.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_patch.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/models/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/operations/_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/operations/_operations.py index 242bb8c3ff0d..a9799ee7802c 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/operations/_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -39,7 +39,7 @@ JSON = MutableMapping[str, Any] T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -141,12 +141,9 @@ def build_dynamic_schemas_update_request( def build_dynamic_schemas_delete_request( resource_group_name: str, schema_name: str, dynamic_schema_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/dynamicSchemas/{dynamicSchemaName}" path_format_arguments = { @@ -161,10 +158,7 @@ def build_dynamic_schemas_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_dynamic_schemas_list_by_schema_request( # pylint: disable=name-too-long @@ -288,12 +282,9 @@ def build_schemas_update_request( def build_schemas_delete_request( resource_group_name: str, schema_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}" path_format_arguments = { @@ -307,10 +298,7 @@ def build_schemas_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_schemas_create_version_request( @@ -524,12 +512,9 @@ def build_schema_versions_update_request( def build_schema_versions_delete_request( resource_group_name: str, schema_name: str, schema_version_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/versions/{schemaVersionName}" path_format_arguments = { @@ -544,10 +529,7 @@ def build_schema_versions_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_schema_versions_list_by_schema_request( # pylint: disable=name-too-long @@ -697,12 +679,9 @@ def build_solution_versions_delete_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/targets/{targetName}/solutions/{solutionName}/versions/{solutionVersionName}" path_format_arguments = { @@ -718,10 +697,7 @@ def build_solution_versions_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_solution_versions_list_by_solution_request( # pylint: disable=name-too-long @@ -900,12 +876,9 @@ def build_targets_delete_request( force_delete: Optional[bool] = None, **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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/targets/{targetName}" path_format_arguments = { @@ -921,10 +894,7 @@ def build_targets_delete_request( if force_delete is not None: _params["forceDelete"] = _SERIALIZER.query("force_delete", force_delete, "bool") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_targets_list_by_resource_group_request( # pylint: disable=name-too-long @@ -988,8 +958,6 @@ def build_targets_install_solution_request( 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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/targets/{targetName}/installSolution" path_format_arguments = { @@ -1006,7 +974,6 @@ def build_targets_install_solution_request( # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -1019,8 +986,6 @@ def build_targets_uninstall_solution_request( 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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/targets/{targetName}/uninstallSolution" path_format_arguments = { @@ -1037,7 +1002,6 @@ def build_targets_uninstall_solution_request( # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -1050,8 +1014,6 @@ def build_targets_remove_revision_request( 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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/targets/{targetName}/removeRevision" path_format_arguments = { @@ -1068,7 +1030,6 @@ def build_targets_remove_revision_request( # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -1201,7 +1162,7 @@ def build_dynamic_schema_versions_get_request( # pylint: disable=name-too-long resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: @@ -1212,13 +1173,13 @@ def build_dynamic_schema_versions_get_request( # pylint: disable=name-too-long accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/dynamicSchemas/{dynamicSchemaName}/versions/{schemaVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/dynamicSchemas/{dynamicSchemaName}/versions/{dynamicSchemaVersionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), "dynamicSchemaName": _SERIALIZER.url("dynamic_schema_name", dynamic_schema_name, "str"), - "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), + "dynamicSchemaVersionName": _SERIALIZER.url("dynamic_schema_version_name", dynamic_schema_version_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1236,7 +1197,7 @@ def build_dynamic_schema_versions_create_or_update_request( # pylint: disable=n resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: @@ -1248,13 +1209,13 @@ def build_dynamic_schema_versions_create_or_update_request( # pylint: disable=n accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/dynamicSchemas/{dynamicSchemaName}/versions/{schemaVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/dynamicSchemas/{dynamicSchemaName}/versions/{dynamicSchemaVersionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), "dynamicSchemaName": _SERIALIZER.url("dynamic_schema_name", dynamic_schema_name, "str"), - "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), + "dynamicSchemaVersionName": _SERIALIZER.url("dynamic_schema_version_name", dynamic_schema_version_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1274,7 +1235,7 @@ def build_dynamic_schema_versions_update_request( # pylint: disable=name-too-lo resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: @@ -1286,13 +1247,13 @@ def build_dynamic_schema_versions_update_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/dynamicSchemas/{dynamicSchemaName}/versions/{schemaVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/dynamicSchemas/{dynamicSchemaName}/versions/{dynamicSchemaVersionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), "dynamicSchemaName": _SERIALIZER.url("dynamic_schema_name", dynamic_schema_name, "str"), - "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), + "dynamicSchemaVersionName": _SERIALIZER.url("dynamic_schema_version_name", dynamic_schema_version_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1312,24 +1273,21 @@ def build_dynamic_schema_versions_delete_request( # pylint: disable=name-too-lo resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/dynamicSchemas/{dynamicSchemaName}/versions/{schemaVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/schemas/{schemaName}/dynamicSchemas/{dynamicSchemaName}/versions/{dynamicSchemaVersionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), "dynamicSchemaName": _SERIALIZER.url("dynamic_schema_name", dynamic_schema_name, "str"), - "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), + "dynamicSchemaVersionName": _SERIALIZER.url("dynamic_schema_version_name", dynamic_schema_version_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1337,10 +1295,7 @@ def build_dynamic_schema_versions_delete_request( # pylint: disable=name-too-lo # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_dynamic_schema_versions_list_by_dynamic_schema_request( # pylint: disable=name-too-long @@ -1397,6 +1352,83 @@ def build_schema_references_get_request(resource_uri: str, schema_reference_name return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_schema_references_create_or_update_request( # pylint: disable=name-too-long + resource_uri: str, schema_reference_name: 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-06-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.Edge/schemaReferences/{schemaReferenceName}" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "schemaReferenceName": _SERIALIZER.url("schema_reference_name", schema_reference_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_schema_references_update_request(resource_uri: str, schema_reference_name: 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-06-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.Edge/schemaReferences/{schemaReferenceName}" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "schemaReferenceName": _SERIALIZER.url("schema_reference_name", schema_reference_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_schema_references_delete_request(resource_uri: str, schema_reference_name: str, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-06-01")) + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.Edge/schemaReferences/{schemaReferenceName}" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "schemaReferenceName": _SERIALIZER.url("schema_reference_name", schema_reference_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + def build_schema_references_list_by_resource_group_request( # pylint: disable=name-too-long resource_uri: str, **kwargs: Any ) -> HttpRequest: @@ -1519,12 +1551,9 @@ def build_solutions_update_request( def build_solutions_delete_request( resource_group_name: str, target_name: str, solution_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/targets/{targetName}/solutions/{solutionName}" path_format_arguments = { @@ -1539,10 +1568,7 @@ def build_solutions_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_solutions_list_by_target_request( @@ -1648,8 +1674,6 @@ def build_solution_template_versions_bulk_deploy_solution_request( # pylint: di 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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/solutionTemplates/{solutionTemplateName}/versions/{solutionTemplateVersionName}/bulkDeploySolution" path_format_arguments = { @@ -1669,7 +1693,6 @@ def build_solution_template_versions_bulk_deploy_solution_request( # pylint: di # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -1686,8 +1709,6 @@ def build_solution_template_versions_bulk_publish_solution_request( # pylint: d 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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/solutionTemplates/{solutionTemplateName}/versions/{solutionTemplateVersionName}/bulkPublishSolution" path_format_arguments = { @@ -1707,7 +1728,6 @@ def build_solution_template_versions_bulk_publish_solution_request( # pylint: d # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -1841,8 +1861,6 @@ def build_solution_templates_remove_version_request( # pylint: disable=name-too 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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/solutionTemplates/{solutionTemplateName}/removeVersion" path_format_arguments = { @@ -1859,7 +1877,6 @@ def build_solution_templates_remove_version_request( # pylint: disable=name-too # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -1867,12 +1884,9 @@ def build_solution_templates_remove_version_request( # pylint: disable=name-too def build_solution_templates_delete_request( resource_group_name: str, solution_template_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/solutionTemplates/{solutionTemplateName}" path_format_arguments = { @@ -1886,10 +1900,7 @@ def build_solution_templates_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_solution_templates_list_by_resource_group_request( # pylint: disable=name-too-long @@ -2066,12 +2077,9 @@ def build_instances_delete_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/targets/{targetName}/solutions/{solutionName}/instances/{instanceName}" path_format_arguments = { @@ -2087,10 +2095,7 @@ def build_instances_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_instances_list_by_solution_request( @@ -2349,12 +2354,9 @@ def build_config_templates_remove_version_request( # pylint: disable=name-too-l def build_config_templates_delete_request( resource_group_name: str, config_template_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/configTemplates/{configTemplateName}" path_format_arguments = { @@ -2368,10 +2370,7 @@ def build_config_templates_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_config_templates_list_by_resource_group_request( # pylint: disable=name-too-long @@ -2586,12 +2585,9 @@ def build_workflows_update_request( def build_workflows_delete_request( resource_group_name: str, context_name: str, workflow_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/contexts/{contextName}/workflows/{workflowName}" path_format_arguments = { @@ -2606,10 +2602,7 @@ def build_workflows_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_workflows_list_by_context_request( @@ -2759,12 +2752,9 @@ def build_workflow_versions_delete_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/contexts/{contextName}/workflows/{workflowName}/versions/{versionName}" path_format_arguments = { @@ -2780,10 +2770,7 @@ def build_workflow_versions_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_workflow_versions_list_by_workflow_request( # pylint: disable=name-too-long @@ -2941,12 +2928,9 @@ def build_executions_delete_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/contexts/{contextName}/workflows/{workflowName}/versions/{versionName}/executions/{executionName}" path_format_arguments = { @@ -2963,10 +2947,7 @@ def build_executions_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_executions_list_by_workflow_version_request( # pylint: disable=name-too-long @@ -3097,12 +3078,9 @@ def build_diagnostics_update_request( def build_diagnostics_delete_request( resource_group_name: str, diagnostic_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/diagnostics/{diagnosticName}" path_format_arguments = { @@ -3116,10 +3094,7 @@ def build_diagnostics_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_diagnostics_list_by_resource_group_request( # pylint: disable=name-too-long @@ -3321,12 +3296,9 @@ def build_contexts_list_by_subscription_request( # pylint: disable=name-too-lon def build_contexts_delete_request( resource_group_name: str, context_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/contexts/{contextName}" path_format_arguments = { @@ -3340,10 +3312,7 @@ def build_contexts_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_site_references_get_request( @@ -3442,12 +3411,9 @@ def build_site_references_update_request( def build_site_references_delete_request( resource_group_name: str, context_name: str, site_reference_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-06-01")) - accept = _headers.pop("Accept", "application/json") - # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/contexts/{contextName}/siteReferences/{siteReferenceName}" path_format_arguments = { @@ -3462,10 +3428,7 @@ def build_site_references_delete_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_site_references_list_by_context_request( # pylint: disable=name-too-long @@ -3559,6 +3522,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3573,11 +3537,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.DynamicSchema, response.json()) @@ -3631,6 +3598,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3644,7 +3612,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3654,7 +3625,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3985,6 +3956,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3999,11 +3971,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.DynamicSchema, response.json()) @@ -4042,6 +4017,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4055,7 +4031,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4063,7 +4042,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4150,7 +4129,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DynamicSchema]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.DynamicSchema]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4189,7 +4168,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4202,7 +4184,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.DynamicSchema], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.DynamicSchema], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4218,7 +4203,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4284,6 +4272,7 @@ def get(self, resource_group_name: str, schema_name: str, **kwargs: Any) -> _mod } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4298,11 +4287,14 @@ def get(self, resource_group_name: str, schema_name: str, **kwargs: Any) -> _mod except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Schema, response.json()) @@ -4354,6 +4346,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4367,7 +4360,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4377,7 +4373,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4548,7 +4544,7 @@ def update( self, resource_group_name: str, schema_name: str, - properties: _models.Schema, + properties: _models.SchemaUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -4561,7 +4557,7 @@ def update( :param schema_name: The name of the Schema. Required. :type schema_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Schema + :type properties: ~azure.mgmt.workloadorchestration.models.SchemaUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4629,7 +4625,7 @@ def update( self, resource_group_name: str, schema_name: str, - properties: Union[_models.Schema, JSON, IO[bytes]], + properties: Union[_models.SchemaUpdate, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schema: """update a Schema Resource. @@ -4640,8 +4636,8 @@ def update( :param schema_name: The name of the Schema. Required. :type schema_name: str :param properties: The resource properties to be updated. Is one of the following types: - Schema, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Schema or JSON or IO[bytes] + SchemaUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SchemaUpdate or JSON or IO[bytes] :return: Schema. The Schema is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.Schema :raises ~azure.core.exceptions.HttpResponseError: @@ -4682,6 +4678,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4696,11 +4693,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Schema, response.json()) @@ -4736,6 +4736,7 @@ def _delete_initial(self, resource_group_name: str, schema_name: str, **kwargs: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4749,7 +4750,10 @@ def _delete_initial(self, resource_group_name: str, schema_name: str, **kwargs: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4757,7 +4761,7 @@ def _delete_initial(self, resource_group_name: str, schema_name: str, **kwargs: 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4864,6 +4868,7 @@ def _create_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4877,7 +4882,10 @@ def _create_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4885,7 +4893,7 @@ def _create_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5023,14 +5031,10 @@ def begin_create_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SchemaVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -5195,6 +5199,7 @@ def remove_version( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5209,11 +5214,14 @@ def remove_version( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.RemoveVersionResponse, response.json()) @@ -5236,7 +5244,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Schema]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Schema]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5274,7 +5282,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5287,7 +5298,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Schema], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Schema], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5303,7 +5317,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5321,7 +5338,7 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Schema"]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Schema]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Schema]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5358,7 +5375,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5371,7 +5391,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Schema], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Schema], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5387,7 +5410,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5458,6 +5484,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5472,11 +5499,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SchemaVersion, response.json()) @@ -5530,6 +5560,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5543,7 +5574,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5553,7 +5587,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5884,6 +5918,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5898,11 +5933,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SchemaVersion, response.json()) @@ -5941,6 +5979,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5954,7 +5993,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5962,7 +6004,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6049,7 +6091,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchemaVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SchemaVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6088,7 +6130,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6101,7 +6146,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SchemaVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SchemaVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -6117,7 +6165,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -6191,6 +6242,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6205,11 +6257,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionVersion, response.json()) @@ -6265,6 +6320,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6278,7 +6334,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -6288,7 +6347,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6527,6 +6586,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6540,7 +6600,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -6548,7 +6611,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6771,6 +6834,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6784,7 +6848,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -6792,7 +6859,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6884,7 +6951,7 @@ def list_by_solution( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SolutionVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SolutionVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6924,7 +6991,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6937,7 +7007,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SolutionVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -6953,7 +7026,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -7018,6 +7094,7 @@ def get(self, resource_uri: str, job_name: str, **kwargs: Any) -> _models.Job: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7032,11 +7109,14 @@ def get(self, resource_uri: str, job_name: str, **kwargs: Any) -> _models.Job: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Job, response.json()) @@ -7059,7 +7139,7 @@ def list_by_target(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Job]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Job]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7096,7 +7176,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7109,7 +7192,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Job], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Job], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -7125,7 +7211,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -7191,6 +7280,7 @@ def get(self, resource_group_name: str, target_name: str, **kwargs: Any) -> _mod } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7205,11 +7295,14 @@ def get(self, resource_group_name: str, target_name: str, **kwargs: Any) -> _mod except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Target, response.json()) @@ -7261,6 +7354,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7274,7 +7368,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -7284,7 +7381,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7454,7 +7551,7 @@ def _update_initial( self, resource_group_name: str, target_name: str, - properties: Union[_models.Target, JSON, IO[bytes]], + properties: Union[_models.TargetUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -7493,6 +7590,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7506,7 +7604,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -7514,7 +7615,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7526,7 +7627,7 @@ def begin_update( self, resource_group_name: str, target_name: str, - properties: _models.Target, + properties: _models.TargetUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -7539,7 +7640,7 @@ def begin_update( :param target_name: Name of the target. Required. :type target_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Target + :type properties: ~azure.mgmt.workloadorchestration.models.TargetUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7610,7 +7711,7 @@ def begin_update( self, resource_group_name: str, target_name: str, - properties: Union[_models.Target, JSON, IO[bytes]], + properties: Union[_models.TargetUpdate, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Target]: """update a Target Resource. @@ -7621,8 +7722,8 @@ def begin_update( :param target_name: Name of the target. Required. :type target_name: str :param properties: The resource properties to be updated. Is one of the following types: - Target, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Target or JSON or IO[bytes] + TargetUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.TargetUpdate or JSON or IO[bytes] :return: An instance of LROPoller that returns Target. The Target is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloadorchestration.models.Target] @@ -7710,6 +7811,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7723,7 +7825,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -7731,7 +7836,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7814,7 +7919,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Target]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Target]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7852,7 +7957,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7865,7 +7973,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Target], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Target], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -7881,7 +7992,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -7899,7 +8013,7 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Target"]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Target]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Target]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7936,7 +8050,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7949,7 +8066,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Target], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Target], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -7965,7 +8085,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -8015,6 +8138,7 @@ def _install_solution_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8028,14 +8152,17 @@ def _install_solution_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8236,6 +8363,7 @@ def _uninstall_solution_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8249,14 +8377,17 @@ def _uninstall_solution_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8457,6 +8588,7 @@ def _remove_revision_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8470,14 +8602,17 @@ def _remove_revision_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8678,6 +8813,7 @@ def _resolve_configuration_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8691,7 +8827,10 @@ def _resolve_configuration_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -8699,7 +8838,7 @@ def _resolve_configuration_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8841,14 +8980,10 @@ def begin_resolve_configuration( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.ResolvedConfiguration, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -8917,6 +9052,7 @@ def _review_solution_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8930,7 +9066,10 @@ def _review_solution_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -8938,7 +9077,7 @@ def _review_solution_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9076,14 +9215,10 @@ def begin_review_solution_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SolutionVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -9152,6 +9287,7 @@ def _publish_solution_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9165,7 +9301,10 @@ def _publish_solution_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -9173,7 +9312,7 @@ def _publish_solution_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9311,14 +9450,10 @@ def begin_publish_solution_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SolutionVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -9387,6 +9522,7 @@ def _update_external_validation_status_initial( # pylint: disable=name-too-long } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9400,7 +9536,10 @@ def _update_external_validation_status_initial( # pylint: disable=name-too-long except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -9408,7 +9547,7 @@ def _update_external_validation_status_initial( # pylint: disable=name-too-long 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9546,14 +9685,10 @@ def begin_update_external_validation_status( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SolutionVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -9605,7 +9740,7 @@ def get( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, **kwargs: Any ) -> _models.DynamicSchemaVersion: """Get a Dynamic Schema Version Resource. @@ -9617,8 +9752,8 @@ def get( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :return: DynamicSchemaVersion. The DynamicSchemaVersion is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -9640,7 +9775,7 @@ def get( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9651,6 +9786,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9665,11 +9801,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.DynamicSchemaVersion, response.json()) @@ -9683,7 +9822,7 @@ def _create_or_update_initial( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: Union[_models.DynamicSchemaVersion, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: @@ -9712,7 +9851,7 @@ def _create_or_update_initial( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9725,6 +9864,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9738,7 +9878,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -9748,7 +9891,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -9761,7 +9904,7 @@ def begin_create_or_update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: _models.DynamicSchemaVersion, *, content_type: str = "application/json", @@ -9776,8 +9919,8 @@ def begin_create_or_update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param resource: Resource create parameters. Required. :type resource: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -9796,7 +9939,7 @@ def begin_create_or_update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: JSON, *, content_type: str = "application/json", @@ -9811,8 +9954,8 @@ def begin_create_or_update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param resource: Resource create parameters. Required. :type resource: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -9831,7 +9974,7 @@ def begin_create_or_update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: IO[bytes], *, content_type: str = "application/json", @@ -9846,8 +9989,8 @@ def begin_create_or_update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_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. @@ -9866,7 +10009,7 @@ def begin_create_or_update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, resource: Union[_models.DynamicSchemaVersion, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DynamicSchemaVersion]: @@ -9879,8 +10022,8 @@ def begin_create_or_update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param resource: Resource create parameters. Is one of the following types: DynamicSchemaVersion, JSON, IO[bytes] Required. :type resource: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion or JSON or @@ -9904,7 +10047,7 @@ def begin_create_or_update( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -9951,7 +10094,7 @@ def update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, properties: _models.DynamicSchemaVersion, *, content_type: str = "application/json", @@ -9966,8 +10109,8 @@ def update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param properties: The resource properties to be updated. Required. :type properties: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -9984,7 +10127,7 @@ def update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, properties: JSON, *, content_type: str = "application/json", @@ -9999,8 +10142,8 @@ def update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_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. @@ -10017,7 +10160,7 @@ def update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, properties: IO[bytes], *, content_type: str = "application/json", @@ -10032,8 +10175,8 @@ def update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_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. @@ -10050,7 +10193,7 @@ def update( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, properties: Union[_models.DynamicSchemaVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DynamicSchemaVersion: @@ -10063,8 +10206,8 @@ def update( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :param properties: The resource properties to be updated. Is one of the following types: DynamicSchemaVersion, JSON, IO[bytes] Required. :type properties: ~azure.mgmt.workloadorchestration.models.DynamicSchemaVersion or JSON or @@ -10098,7 +10241,7 @@ def update( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -10111,6 +10254,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10125,11 +10269,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.DynamicSchemaVersion, response.json()) @@ -10143,7 +10290,7 @@ def _delete_initial( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -10163,7 +10310,7 @@ def _delete_initial( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10174,6 +10321,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10187,7 +10335,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -10195,7 +10346,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -10208,7 +10359,7 @@ def begin_delete( resource_group_name: str, schema_name: str, dynamic_schema_name: str, - schema_version_name: str, + dynamic_schema_version_name: str, **kwargs: Any ) -> LROPoller[None]: """Delete a Dynamic Schema Version Resource. @@ -10220,8 +10371,8 @@ def begin_delete( :type schema_name: str :param dynamic_schema_name: The name of the DynamicSchema. Required. :type dynamic_schema_name: str - :param schema_version_name: The name of the SchemaVersion. Required. - :type schema_version_name: str + :param dynamic_schema_version_name: The name of the DynamicSchemaVersion. Required. + :type dynamic_schema_version_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -10238,7 +10389,7 @@ def begin_delete( resource_group_name=resource_group_name, schema_name=schema_name, dynamic_schema_name=dynamic_schema_name, - schema_version_name=schema_version_name, + dynamic_schema_version_name=dynamic_schema_version_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10293,7 +10444,7 @@ def list_by_dynamic_schema( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DynamicSchemaVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.DynamicSchemaVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10333,7 +10484,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10346,7 +10500,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.DynamicSchemaVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.DynamicSchemaVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -10362,7 +10519,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -10390,14 +10550,408 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> _models.SchemaReference: - """Get a Schema Reference Resource. + def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> _models.SchemaReference: + """Get a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_name: str + :return: SchemaReference. The SchemaReference is compatible with MutableMapping + :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference + :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.SchemaReference] = kwargs.pop("cls", None) + + _request = build_schema_references_get_request( + resource_uri=resource_uri, + schema_reference_name=schema_reference_name, + 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) + + _decompress = kwargs.pop("decompress", True) + _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, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemaReference, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_uri: str, + schema_reference_name: str, + resource: Union[_models.SchemaReference, 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_schema_references_create_or_update_request( + resource_uri=resource_uri, + schema_reference_name=schema_reference_name, + 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) + + _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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_uri: str, + schema_reference_name: str, + resource: _models.SchemaReference, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SchemaReference]: + """Create or update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.workloadorchestration.models.SchemaReference + :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 SchemaReference. The SchemaReference is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloadorchestration.models.SchemaReference] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_uri: str, + schema_reference_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SchemaReference]: + """Create or update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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 SchemaReference. The SchemaReference is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloadorchestration.models.SchemaReference] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_uri: str, + schema_reference_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SchemaReference]: + """Create or update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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 SchemaReference. The SchemaReference is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloadorchestration.models.SchemaReference] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_uri: str, + schema_reference_name: str, + resource: Union[_models.SchemaReference, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SchemaReference]: + """Create or update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_name: str + :param resource: Resource create parameters. Is one of the following types: SchemaReference, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.workloadorchestration.models.SchemaReference or JSON or IO[bytes] + :return: An instance of LROPoller that returns SchemaReference. The SchemaReference is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloadorchestration.models.SchemaReference] + :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.SchemaReference] = 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_uri=resource_uri, + schema_reference_name=schema_reference_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.SchemaReference, 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.SchemaReference].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SchemaReference]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_uri: str, + schema_reference_name: str, + properties: _models.SchemaReference, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemaReference: + """update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SchemaReference + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemaReference. The SchemaReference is compatible with MutableMapping + :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_uri: str, + schema_reference_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemaReference: + """update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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: SchemaReference. The SchemaReference is compatible with MutableMapping + :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_uri: str, + schema_reference_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemaReference: + """update a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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: SchemaReference. The SchemaReference is compatible with MutableMapping + :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_uri: str, + schema_reference_name: str, + properties: Union[_models.SchemaReference, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SchemaReference: + """update a Schema Reference Resource. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. :type resource_uri: str :param schema_reference_name: The name of the SchemaReference. Required. :type schema_reference_name: str + :param properties: The resource properties to be updated. Is one of the following types: + SchemaReference, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SchemaReference or JSON or IO[bytes] :return: SchemaReference. The SchemaReference is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.SchemaReference :raises ~azure.core.exceptions.HttpResponseError: @@ -10410,15 +10964,25 @@ def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> _ } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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.SchemaReference] = kwargs.pop("cls", None) - _request = build_schema_references_get_request( + 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_schema_references_update_request( resource_uri=resource_uri, schema_reference_name=schema_reference_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -10427,6 +10991,7 @@ def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> _ } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10441,11 +11006,14 @@ def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> _ except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SchemaReference, response.json()) @@ -10454,6 +11022,121 @@ def get(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> _ return deserialized # type: ignore + def _delete_initial(self, resource_uri: str, schema_reference_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_schema_references_delete_request( + resource_uri=resource_uri, + schema_reference_name=schema_reference_name, + 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) + + _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 = _failsafe_deserialize( + _models.ErrorResponse, + 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.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_uri: str, schema_reference_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Schema Reference Resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param schema_reference_name: The name of the SchemaReference. Required. + :type schema_reference_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_uri=resource_uri, + schema_reference_name=schema_reference_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_uri: str, **kwargs: Any) -> ItemPaged["_models.SchemaReference"]: """List by specified resource group. @@ -10468,7 +11151,7 @@ def list_by_resource_group(self, resource_uri: str, **kwargs: Any) -> ItemPaged[ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchemaReference]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SchemaReference]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10505,7 +11188,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10518,7 +11204,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SchemaReference], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SchemaReference], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -10534,7 +11223,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -10603,6 +11295,7 @@ def get(self, resource_group_name: str, target_name: str, solution_name: str, ** } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10617,11 +11310,14 @@ def get(self, resource_group_name: str, target_name: str, solution_name: str, ** except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Solution, response.json()) @@ -10675,6 +11371,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10688,7 +11385,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -10698,7 +11398,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -10882,7 +11582,7 @@ def _update_initial( resource_group_name: str, target_name: str, solution_name: str, - properties: Union[_models.Solution, JSON, IO[bytes]], + properties: Union[_models.SolutionUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -10922,6 +11622,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10935,7 +11636,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -10943,7 +11647,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -10956,7 +11660,7 @@ def begin_update( resource_group_name: str, target_name: str, solution_name: str, - properties: _models.Solution, + properties: _models.SolutionUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -10971,7 +11675,7 @@ def begin_update( :param solution_name: Name of the solution. Required. :type solution_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Solution + :type properties: ~azure.mgmt.workloadorchestration.models.SolutionUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11049,7 +11753,7 @@ def begin_update( resource_group_name: str, target_name: str, solution_name: str, - properties: Union[_models.Solution, JSON, IO[bytes]], + properties: Union[_models.SolutionUpdate, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Solution]: """Update a Solution Resource. @@ -11062,8 +11766,8 @@ def begin_update( :param solution_name: Name of the solution. Required. :type solution_name: str :param properties: The resource properties to be updated. Is one of the following types: - Solution, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Solution or JSON or IO[bytes] + SolutionUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SolutionUpdate or JSON or IO[bytes] :return: An instance of LROPoller that returns Solution. The Solution is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloadorchestration.models.Solution] @@ -11152,6 +11856,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11165,7 +11870,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -11173,7 +11881,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -11260,7 +11968,7 @@ def list_by_target( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Solution]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Solution]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11299,7 +12007,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -11312,7 +12023,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Solution], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Solution], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -11328,7 +12042,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -11399,6 +12116,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11413,11 +12131,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTemplateVersion, response.json()) @@ -11445,7 +12166,7 @@ def list_by_solution_template( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SolutionTemplateVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SolutionTemplateVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11484,7 +12205,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -11497,7 +12221,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTemplateVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SolutionTemplateVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -11513,7 +12240,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -11565,6 +12295,7 @@ def _bulk_deploy_solution_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11578,14 +12309,17 @@ def _bulk_deploy_solution_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -11801,6 +12535,7 @@ def _bulk_publish_solution_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11814,14 +12549,17 @@ def _bulk_publish_solution_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -12051,6 +12789,7 @@ def get(self, resource_group_name: str, solution_template_name: str, **kwargs: A } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12065,11 +12804,14 @@ def get(self, resource_group_name: str, solution_template_name: str, **kwargs: A except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTemplate, response.json()) @@ -12121,6 +12863,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12134,7 +12877,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -12144,7 +12890,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -12319,7 +13065,7 @@ def update( self, resource_group_name: str, solution_template_name: str, - properties: _models.SolutionTemplate, + properties: _models.SolutionTemplateUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -12332,7 +13078,7 @@ def update( :param solution_template_name: The name of the SolutionTemplate. Required. :type solution_template_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.SolutionTemplate + :type properties: ~azure.mgmt.workloadorchestration.models.SolutionTemplateUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12400,7 +13146,7 @@ def update( self, resource_group_name: str, solution_template_name: str, - properties: Union[_models.SolutionTemplate, JSON, IO[bytes]], + properties: Union[_models.SolutionTemplateUpdate, JSON, IO[bytes]], **kwargs: Any ) -> _models.SolutionTemplate: """update a Solution Template Resource. @@ -12411,8 +13157,8 @@ def update( :param solution_template_name: The name of the SolutionTemplate. Required. :type solution_template_name: str :param properties: The resource properties to be updated. Is one of the following types: - SolutionTemplate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.SolutionTemplate or JSON or + SolutionTemplateUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.SolutionTemplateUpdate or JSON or IO[bytes] :return: SolutionTemplate. The SolutionTemplate is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.SolutionTemplate @@ -12454,6 +13200,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12468,11 +13215,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTemplate, response.json()) @@ -12524,6 +13274,7 @@ def _create_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12537,7 +13288,10 @@ def _create_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -12545,7 +13299,7 @@ def _create_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -12687,14 +13441,10 @@ def begin_create_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.SolutionTemplateVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -12763,6 +13513,7 @@ def _remove_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12776,14 +13527,17 @@ def _remove_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -12967,6 +13721,7 @@ def _delete_initial(self, resource_group_name: str, solution_template_name: str, } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12980,7 +13735,10 @@ def _delete_initial(self, resource_group_name: str, solution_template_name: str, except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -12988,7 +13746,7 @@ def _delete_initial(self, resource_group_name: str, solution_template_name: str, 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -13066,7 +13824,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SolutionTemplate]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SolutionTemplate]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13104,7 +13862,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -13117,7 +13878,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTemplate], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SolutionTemplate], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -13133,7 +13897,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -13151,7 +13918,7 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.SolutionTemp _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SolutionTemplate]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SolutionTemplate]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13188,7 +13955,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -13201,7 +13971,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTemplate], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SolutionTemplate], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -13217,7 +13990,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -13291,6 +14067,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -13305,11 +14082,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Instance, response.json()) @@ -13365,6 +14145,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -13378,7 +14159,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -13388,7 +14172,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -13627,6 +14411,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -13640,7 +14425,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -13648,7 +14436,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -13871,6 +14659,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -13884,7 +14673,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -13892,7 +14684,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -13984,7 +14776,7 @@ def list_by_solution( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Instance]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Instance]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14024,7 +14816,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -14037,7 +14832,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Instance], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Instance], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -14053,7 +14851,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -14136,6 +14937,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14150,11 +14952,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.InstanceHistory, response.json()) @@ -14185,7 +14990,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.InstanceHistory]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.InstanceHistory]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14226,7 +15031,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -14239,7 +15047,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.InstanceHistory], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.InstanceHistory], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -14255,7 +15066,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -14321,6 +15135,7 @@ def get(self, resource_group_name: str, config_template_name: str, **kwargs: Any } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14335,11 +15150,14 @@ def get(self, resource_group_name: str, config_template_name: str, **kwargs: Any except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ConfigTemplate, response.json()) @@ -14391,6 +15209,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14404,7 +15223,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -14414,7 +15236,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -14585,7 +15407,7 @@ def update( self, resource_group_name: str, config_template_name: str, - properties: _models.ConfigTemplate, + properties: _models.ConfigTemplateUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -14598,7 +15420,7 @@ def update( :param config_template_name: The name of the ConfigTemplate. Required. :type config_template_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.ConfigTemplate + :type properties: ~azure.mgmt.workloadorchestration.models.ConfigTemplateUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14666,7 +15488,7 @@ def update( self, resource_group_name: str, config_template_name: str, - properties: Union[_models.ConfigTemplate, JSON, IO[bytes]], + properties: Union[_models.ConfigTemplateUpdate, JSON, IO[bytes]], **kwargs: Any ) -> _models.ConfigTemplate: """update a Config Template Resource. @@ -14677,8 +15499,9 @@ def update( :param config_template_name: The name of the ConfigTemplate. Required. :type config_template_name: str :param properties: The resource properties to be updated. Is one of the following types: - ConfigTemplate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.ConfigTemplate or JSON or IO[bytes] + ConfigTemplateUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.ConfigTemplateUpdate or JSON or + IO[bytes] :return: ConfigTemplate. The ConfigTemplate is compatible with MutableMapping :rtype: ~azure.mgmt.workloadorchestration.models.ConfigTemplate :raises ~azure.core.exceptions.HttpResponseError: @@ -14719,6 +15542,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14733,11 +15557,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ConfigTemplate, response.json()) @@ -14789,6 +15616,7 @@ def _create_version_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14802,7 +15630,10 @@ def _create_version_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -14810,7 +15641,7 @@ def _create_version_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -14952,14 +15783,10 @@ def begin_create_version( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.ConfigTemplateVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -15124,6 +15951,7 @@ def remove_version( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15138,11 +15966,14 @@ def remove_version( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.RemoveVersionResponse, response.json()) @@ -15178,6 +16009,7 @@ def _delete_initial(self, resource_group_name: str, config_template_name: str, * } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15191,7 +16023,10 @@ def _delete_initial(self, resource_group_name: str, config_template_name: str, * except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -15199,7 +16034,7 @@ def _delete_initial(self, resource_group_name: str, config_template_name: str, * 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -15277,7 +16112,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ConfigTemplate]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ConfigTemplate]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15315,7 +16150,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -15328,7 +16166,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ConfigTemplate], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.ConfigTemplate], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -15344,7 +16185,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -15362,7 +16206,7 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.ConfigTempla _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ConfigTemplate]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ConfigTemplate]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15399,7 +16243,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -15412,7 +16259,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ConfigTemplate], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.ConfigTemplate], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -15428,7 +16278,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -15499,6 +16352,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15513,11 +16367,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ConfigTemplateVersion, response.json()) @@ -15545,7 +16402,7 @@ def list_by_config_template( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ConfigTemplateVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ConfigTemplateVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15584,7 +16441,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -15597,7 +16457,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ConfigTemplateVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.ConfigTemplateVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -15613,7 +16476,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -15682,6 +16548,7 @@ def get(self, resource_group_name: str, context_name: str, workflow_name: str, * } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15696,11 +16563,14 @@ def get(self, resource_group_name: str, context_name: str, workflow_name: str, * except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Workflow, response.json()) @@ -15754,6 +16624,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -15767,7 +16638,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -15777,7 +16651,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -16001,6 +16875,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16014,7 +16889,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -16022,7 +16900,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -16231,6 +17109,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16244,7 +17123,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -16252,7 +17134,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -16339,7 +17221,7 @@ def list_by_context( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Workflow]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Workflow]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -16378,7 +17260,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -16391,7 +17276,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Workflow], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Workflow], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -16407,7 +17295,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -16481,6 +17372,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16495,11 +17387,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.WorkflowVersion, response.json()) @@ -16555,6 +17450,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16568,7 +17464,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -16578,7 +17477,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -16817,6 +17716,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -16830,7 +17730,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -16838,7 +17741,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -17061,6 +17964,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -17074,7 +17978,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -17082,7 +17989,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -17174,7 +18081,7 @@ def list_by_workflow( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.WorkflowVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.WorkflowVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -17214,7 +18121,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -17227,7 +18137,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.WorkflowVersion], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.WorkflowVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -17243,7 +18156,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -17326,6 +18242,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -17340,11 +18257,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Execution, response.json()) @@ -17402,6 +18322,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -17415,7 +18336,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -17425,7 +18349,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -17679,6 +18603,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -17692,7 +18617,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -17700,7 +18628,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -17943,6 +18871,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -17956,7 +18885,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -17964,7 +18896,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -18067,7 +18999,7 @@ def list_by_workflow_version( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Execution]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Execution]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -18108,7 +19040,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -18121,7 +19056,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Execution], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Execution], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -18137,7 +19075,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -18203,6 +19144,7 @@ def get(self, resource_group_name: str, diagnostic_name: str, **kwargs: Any) -> } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -18217,11 +19159,14 @@ def get(self, resource_group_name: str, diagnostic_name: str, **kwargs: Any) -> except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Diagnostic, response.json()) @@ -18273,6 +19218,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -18286,7 +19232,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -18296,7 +19245,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -18466,7 +19415,7 @@ def _update_initial( self, resource_group_name: str, diagnostic_name: str, - properties: Union[_models.Diagnostic, JSON, IO[bytes]], + properties: Union[_models.DiagnosticUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -18505,6 +19454,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -18518,7 +19468,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -18526,7 +19479,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -18538,7 +19491,7 @@ def begin_update( self, resource_group_name: str, diagnostic_name: str, - properties: _models.Diagnostic, + properties: _models.DiagnosticUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -18551,7 +19504,7 @@ def begin_update( :param diagnostic_name: Name of Diagnostic. Required. :type diagnostic_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Diagnostic + :type properties: ~azure.mgmt.workloadorchestration.models.DiagnosticUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -18622,7 +19575,7 @@ def begin_update( self, resource_group_name: str, diagnostic_name: str, - properties: Union[_models.Diagnostic, JSON, IO[bytes]], + properties: Union[_models.DiagnosticUpdate, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Diagnostic]: """Updates existing Diagnostic resource. @@ -18633,8 +19586,9 @@ def begin_update( :param diagnostic_name: Name of Diagnostic. Required. :type diagnostic_name: str :param properties: The resource properties to be updated. Is one of the following types: - Diagnostic, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Diagnostic or JSON or IO[bytes] + DiagnosticUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.DiagnosticUpdate or JSON or + IO[bytes] :return: An instance of LROPoller that returns Diagnostic. The Diagnostic is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloadorchestration.models.Diagnostic] @@ -18719,6 +19673,7 @@ def _delete_initial(self, resource_group_name: str, diagnostic_name: str, **kwar } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -18732,7 +19687,10 @@ def _delete_initial(self, resource_group_name: str, diagnostic_name: str, **kwar except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -18740,7 +19698,7 @@ def _delete_initial(self, resource_group_name: str, diagnostic_name: str, **kwar 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -18818,7 +19776,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Diagnostic]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Diagnostic]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -18856,7 +19814,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -18869,7 +19830,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Diagnostic], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Diagnostic], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -18885,7 +19849,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -18903,7 +19870,7 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Diagnostic"] _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Diagnostic]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Diagnostic]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -18940,7 +19907,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -18953,7 +19923,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Diagnostic], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Diagnostic], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -18969,7 +19942,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -19035,6 +20011,7 @@ def get(self, resource_group_name: str, context_name: str, **kwargs: Any) -> _mo } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -19049,11 +20026,14 @@ def get(self, resource_group_name: str, context_name: str, **kwargs: Any) -> _mo except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Context, response.json()) @@ -19105,6 +20085,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -19118,7 +20099,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -19128,7 +20112,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -19298,7 +20282,7 @@ def _update_initial( self, resource_group_name: str, context_name: str, - properties: Union[_models.Context, JSON, IO[bytes]], + properties: Union[_models.ContextUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -19337,6 +20321,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -19350,7 +20335,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -19358,7 +20346,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -19370,7 +20358,7 @@ def begin_update( self, resource_group_name: str, context_name: str, - properties: _models.Context, + properties: _models.ContextUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -19383,7 +20371,7 @@ def begin_update( :param context_name: The name of the Context. Required. :type context_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Context + :type properties: ~azure.mgmt.workloadorchestration.models.ContextUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -19454,7 +20442,7 @@ def begin_update( self, resource_group_name: str, context_name: str, - properties: Union[_models.Context, JSON, IO[bytes]], + properties: Union[_models.ContextUpdate, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Context]: """update an Context Resource. @@ -19465,8 +20453,8 @@ def begin_update( :param context_name: The name of the Context. Required. :type context_name: str :param properties: The resource properties to be updated. Is one of the following types: - Context, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.workloadorchestration.models.Context or JSON or IO[bytes] + ContextUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.workloadorchestration.models.ContextUpdate or JSON or IO[bytes] :return: An instance of LROPoller that returns Context. The Context is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloadorchestration.models.Context] @@ -19538,7 +20526,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Context]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Context]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -19576,7 +20564,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -19589,7 +20580,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Context], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Context], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -19605,7 +20599,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -19623,7 +20620,7 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Context"]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Context]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.Context]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -19660,7 +20657,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -19673,7 +20673,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Context], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.Context], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -19689,7 +20692,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -19723,6 +20729,7 @@ def _delete_initial(self, resource_group_name: str, context_name: str, **kwargs: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -19736,7 +20743,10 @@ def _delete_initial(self, resource_group_name: str, context_name: str, **kwargs: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -19744,7 +20754,7 @@ def _delete_initial(self, resource_group_name: str, context_name: str, **kwargs: 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -19872,6 +20882,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -19886,11 +20897,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SiteReference, response.json()) @@ -19944,6 +20958,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -19957,7 +20972,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -19967,7 +20985,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -20191,6 +21209,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -20204,7 +21223,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -20212,7 +21234,7 @@ def _update_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -20421,6 +21443,7 @@ def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -20434,7 +21457,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -20442,7 +21468,7 @@ def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -20529,7 +21555,7 @@ def list_by_context( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SiteReference]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SiteReference]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -20568,7 +21594,10 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -20581,7 +21610,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SiteReference], deserialized.get("value", [])) + list_of_elem = _deserialize( + list[_models.SiteReference], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -20597,7 +21629,10 @@ 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/operations/_patch.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/operations/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/operations/_patch.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/azure/mgmt/workloadorchestration/operations/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_create_or_update_maximum_set_gen.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_create_or_update_maximum_set_gen.py index 0b4973aebf69..d10831652071 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_create_or_update_maximum_set_gen.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_create_or_update_maximum_set_gen.py @@ -34,7 +34,7 @@ def main(): resource_group_name="rgconfigurationmanager", schema_name="testname", dynamic_schema_name="testname", - schema_version_name="1.0.0", + dynamic_schema_version_name="1.0.0", resource={"properties": {"value": "uiaqdwsi"}}, ).result() print(response) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_delete_maximum_set_gen.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_delete_maximum_set_gen.py index 368152aed30e..99e9336906ee 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_delete_maximum_set_gen.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_delete_maximum_set_gen.py @@ -34,7 +34,7 @@ def main(): resource_group_name="rgconfigurationmanager", schema_name="testname", dynamic_schema_name="testname", - schema_version_name="1.0.0", + dynamic_schema_version_name="1.0.0", ).result() diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_get_maximum_set_gen.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_get_maximum_set_gen.py index 0dec3317f601..d3af04ff01ff 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_get_maximum_set_gen.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_get_maximum_set_gen.py @@ -34,7 +34,7 @@ def main(): resource_group_name="rgconfigurationmanager", schema_name="testname", dynamic_schema_name="testname", - schema_version_name="1.0.0", + dynamic_schema_version_name="1.0.0", ) print(response) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_update_maximum_set_gen.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_update_maximum_set_gen.py index d15c6466f989..81a99a6b1051 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_update_maximum_set_gen.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/dynamic_schema_versions_update_maximum_set_gen.py @@ -34,7 +34,7 @@ def main(): resource_group_name="rgconfigurationmanager", schema_name="testname", dynamic_schema_name="testname", - schema_version_name="1.0.0", + dynamic_schema_version_name="1.0.0", properties={"properties": {"value": "muezi"}}, ) print(response) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_create_or_update_maximum_set_gen.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_create_or_update_maximum_set_gen.py new file mode 100644 index 000000000000..d9eca3139747 --- /dev/null +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_create_or_update_maximum_set_gen.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) 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.workloadorchestration import WorkloadOrchestrationMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloadorchestration +# USAGE + python schema_references_create_or_update_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 = WorkloadOrchestrationMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.schema_references.begin_create_or_update( + resource_uri="gt", + schema_reference_name="default", + resource={"properties": {"schemaId": "vxgxfkfws"}}, + ).result() + print(response) + + +# x-ms-original-file: 2025-06-01/SchemaReferences_CreateOrUpdate_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_delete_maximum_set_gen.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_delete_maximum_set_gen.py new file mode 100644 index 000000000000..8aa6d907bbb0 --- /dev/null +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_delete_maximum_set_gen.py @@ -0,0 +1,41 @@ +# 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.workloadorchestration import WorkloadOrchestrationMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloadorchestration +# USAGE + python schema_references_delete_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 = WorkloadOrchestrationMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.schema_references.begin_delete( + resource_uri="gt", + schema_reference_name="default", + ).result() + + +# x-ms-original-file: 2025-06-01/SchemaReferences_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_get_maximum_set_gen.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_get_maximum_set_gen.py index f91857dd0ea4..eb7c239ba4f8 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_get_maximum_set_gen.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_get_maximum_set_gen.py @@ -31,8 +31,8 @@ def main(): ) response = client.schema_references.get( - resource_uri="jdvtghygpz", - schema_reference_name="testname", + resource_uri="gt", + schema_reference_name="default", ) print(response) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_list_by_resource_group_maximum_set_gen.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_list_by_resource_group_maximum_set_gen.py index 389c3e5263da..94e65c54f91b 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_list_by_resource_group_maximum_set_gen.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_list_by_resource_group_maximum_set_gen.py @@ -31,7 +31,7 @@ def main(): ) response = client.schema_references.list_by_resource_group( - resource_uri="jdvtghygpz", + resource_uri="gt", ) for item in response: print(item) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_update_maximum_set_gen.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_update_maximum_set_gen.py new file mode 100644 index 000000000000..527a698680a9 --- /dev/null +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_samples/schema_references_update_maximum_set_gen.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) 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.workloadorchestration import WorkloadOrchestrationMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloadorchestration +# USAGE + python schema_references_update_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 = WorkloadOrchestrationMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.schema_references.update( + resource_uri="gt", + schema_reference_name="default", + properties={"properties": {"schemaId": "kxrcdqabzlzgd"}}, + ) + print(response) + + +# x-ms-original-file: 2025-06-01/SchemaReferences_Update_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_config_templates_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_config_templates_operations.py index d6e728f22d44..408306c39cb4 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_config_templates_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_config_templates_operations.py @@ -40,7 +40,12 @@ def test_config_templates_begin_create_or_update(self, resource_group): "eTag": "str", "id": "str", "name": "str", - "properties": {"description": "str", "latestVersion": "str", "provisioningState": "str"}, + "properties": { + "description": "str", + "latestVersion": "str", + "provisioningState": "str", + "uniqueIdentifier": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -63,23 +68,7 @@ def test_config_templates_update(self, resource_group): response = self.client.config_templates.update( resource_group_name=resource_group.name, config_template_name="str", - properties={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": {"description": "str", "latestVersion": "str", "provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, + properties={"properties": {"description": "str"}, "tags": {"str": "str"}}, ) # please add some check logic here by yourself diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_config_templates_operations_async.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_config_templates_operations_async.py index 6eb7d745526f..aba0651d1369 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_config_templates_operations_async.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_config_templates_operations_async.py @@ -42,7 +42,12 @@ async def test_config_templates_begin_create_or_update(self, resource_group): "eTag": "str", "id": "str", "name": "str", - "properties": {"description": "str", "latestVersion": "str", "provisioningState": "str"}, + "properties": { + "description": "str", + "latestVersion": "str", + "provisioningState": "str", + "uniqueIdentifier": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -66,23 +71,7 @@ async def test_config_templates_update(self, resource_group): response = await self.client.config_templates.update( resource_group_name=resource_group.name, config_template_name="str", - properties={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": {"description": "str", "latestVersion": "str", "provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, + properties={"properties": {"description": "str"}, "tags": {"str": "str"}}, ) # please add some check logic here by yourself diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_contexts_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_contexts_operations.py index 2cdbd7e6465d..1151c16dbda0 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_contexts_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_contexts_operations.py @@ -67,24 +67,11 @@ def test_contexts_begin_update(self, resource_group): resource_group_name=resource_group.name, context_name="str", properties={ - "location": "str", - "id": "str", - "name": "str", "properties": { "capabilities": [{"description": "str", "name": "str", "state": "str"}], "hierarchies": [{"description": "str", "name": "str"}], - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", }, "tags": {"str": "str"}, - "type": "str", }, ).result() # call '.result()' to poll until service return final result diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_contexts_operations_async.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_contexts_operations_async.py index e4a6d1cf7780..47db68eb1153 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_contexts_operations_async.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_contexts_operations_async.py @@ -71,24 +71,11 @@ async def test_contexts_begin_update(self, resource_group): resource_group_name=resource_group.name, context_name="str", properties={ - "location": "str", - "id": "str", - "name": "str", "properties": { "capabilities": [{"description": "str", "name": "str", "state": "str"}], "hierarchies": [{"description": "str", "name": "str"}], - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", }, "tags": {"str": "str"}, - "type": "str", }, ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_diagnostics_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_diagnostics_operations.py index 0d0dc27df273..43bc2f625077 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_diagnostics_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_diagnostics_operations.py @@ -64,24 +64,7 @@ def test_diagnostics_begin_update(self, resource_group): response = self.client.diagnostics.begin_update( resource_group_name=resource_group.name, diagnostic_name="str", - properties={ - "location": "str", - "eTag": "str", - "extendedLocation": {"name": "str", "type": "str"}, - "id": "str", - "name": "str", - "properties": {"provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, + properties={"properties": {}, "tags": {"str": "str"}}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_diagnostics_operations_async.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_diagnostics_operations_async.py index 8d6aad6fcb20..ff1d2b4f65e4 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_diagnostics_operations_async.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_diagnostics_operations_async.py @@ -68,24 +68,7 @@ async def test_diagnostics_begin_update(self, resource_group): await self.client.diagnostics.begin_update( resource_group_name=resource_group.name, diagnostic_name="str", - properties={ - "location": "str", - "eTag": "str", - "extendedLocation": {"name": "str", "type": "str"}, - "id": "str", - "name": "str", - "properties": {"provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, + properties={"properties": {}, "tags": {"str": "str"}}, ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_dynamic_schema_versions_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_dynamic_schema_versions_operations.py index 57d5111cfe33..b5614298e9ba 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_dynamic_schema_versions_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_dynamic_schema_versions_operations.py @@ -25,7 +25,7 @@ def test_dynamic_schema_versions_get(self, resource_group): resource_group_name=resource_group.name, schema_name="str", dynamic_schema_name="str", - schema_version_name="str", + dynamic_schema_version_name="str", ) # please add some check logic here by yourself @@ -38,7 +38,7 @@ def test_dynamic_schema_versions_begin_create_or_update(self, resource_group): resource_group_name=resource_group.name, schema_name="str", dynamic_schema_name="str", - schema_version_name="str", + dynamic_schema_version_name="str", resource={ "eTag": "str", "id": "str", @@ -66,7 +66,7 @@ def test_dynamic_schema_versions_update(self, resource_group): resource_group_name=resource_group.name, schema_name="str", dynamic_schema_name="str", - schema_version_name="str", + dynamic_schema_version_name="str", properties={ "eTag": "str", "id": "str", @@ -94,7 +94,7 @@ def test_dynamic_schema_versions_begin_delete(self, resource_group): resource_group_name=resource_group.name, schema_name="str", dynamic_schema_name="str", - schema_version_name="str", + dynamic_schema_version_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_dynamic_schema_versions_operations_async.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_dynamic_schema_versions_operations_async.py index d78fedf0ce88..3656afb17879 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_dynamic_schema_versions_operations_async.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_dynamic_schema_versions_operations_async.py @@ -26,7 +26,7 @@ async def test_dynamic_schema_versions_get(self, resource_group): resource_group_name=resource_group.name, schema_name="str", dynamic_schema_name="str", - schema_version_name="str", + dynamic_schema_version_name="str", ) # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_dynamic_schema_versions_begin_create_or_update(self, resource_gro resource_group_name=resource_group.name, schema_name="str", dynamic_schema_name="str", - schema_version_name="str", + dynamic_schema_version_name="str", resource={ "eTag": "str", "id": "str", @@ -69,7 +69,7 @@ async def test_dynamic_schema_versions_update(self, resource_group): resource_group_name=resource_group.name, schema_name="str", dynamic_schema_name="str", - schema_version_name="str", + dynamic_schema_version_name="str", properties={ "eTag": "str", "id": "str", @@ -98,7 +98,7 @@ async def test_dynamic_schema_versions_begin_delete(self, resource_group): resource_group_name=resource_group.name, schema_name="str", dynamic_schema_name="str", - schema_version_name="str", + dynamic_schema_version_name="str", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schema_references_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schema_references_operations.py index c9b3e21fefb0..2ea89de98035 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schema_references_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schema_references_operations.py @@ -29,6 +29,69 @@ def test_schema_references_get(self, resource_group): # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_schema_references_begin_create_or_update(self, resource_group): + response = self.client.schema_references.begin_create_or_update( + resource_uri="str", + schema_reference_name="str", + resource={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": {"schemaId": "str", "provisioningState": "str"}, + "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", + }, + ).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_schema_references_update(self, resource_group): + response = self.client.schema_references.update( + resource_uri="str", + schema_reference_name="str", + properties={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": {"schemaId": "str", "provisioningState": "str"}, + "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", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_schema_references_begin_delete(self, resource_group): + response = self.client.schema_references.begin_delete( + resource_uri="str", + schema_reference_name="str", + ).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_schema_references_list_by_resource_group(self, resource_group): diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schema_references_operations_async.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schema_references_operations_async.py index c5f370607e6c..b19be9a0d1fc 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schema_references_operations_async.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schema_references_operations_async.py @@ -30,6 +30,73 @@ async def test_schema_references_get(self, resource_group): # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_schema_references_begin_create_or_update(self, resource_group): + response = await ( + await self.client.schema_references.begin_create_or_update( + resource_uri="str", + schema_reference_name="str", + resource={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": {"schemaId": "str", "provisioningState": "str"}, + "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", + }, + ) + ).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_schema_references_update(self, resource_group): + response = await self.client.schema_references.update( + resource_uri="str", + schema_reference_name="str", + properties={ + "eTag": "str", + "id": "str", + "name": "str", + "properties": {"schemaId": "str", "provisioningState": "str"}, + "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", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_schema_references_begin_delete(self, resource_group): + response = await ( + await self.client.schema_references.begin_delete( + resource_uri="str", + schema_reference_name="str", + ) + ).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_schema_references_list_by_resource_group(self, resource_group): diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schemas_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schemas_operations.py index 79b0ae9ca728..33efa765976d 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schemas_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schemas_operations.py @@ -63,23 +63,7 @@ def test_schemas_update(self, resource_group): response = self.client.schemas.update( resource_group_name=resource_group.name, schema_name="str", - properties={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": {"currentVersion": "str", "provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, + properties={"properties": {}, "tags": {"str": "str"}}, ) # please add some check logic here by yourself diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schemas_operations_async.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schemas_operations_async.py index 23ed6127c711..6078cbe81713 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schemas_operations_async.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_schemas_operations_async.py @@ -66,23 +66,7 @@ async def test_schemas_update(self, resource_group): response = await self.client.schemas.update( resource_group_name=resource_group.name, schema_name="str", - properties={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", - "properties": {"currentVersion": "str", "provisioningState": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, + properties={"properties": {}, "tags": {"str": "str"}}, ) # please add some check logic here by yourself diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solution_templates_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solution_templates_operations.py index 0379af03200e..f76fe7bf3690 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solution_templates_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solution_templates_operations.py @@ -47,6 +47,7 @@ def test_solution_templates_begin_create_or_update(self, resource_group): "latestVersion": "str", "provisioningState": "str", "state": "str", + "uniqueIdentifier": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -71,28 +72,13 @@ def test_solution_templates_update(self, resource_group): resource_group_name=resource_group.name, solution_template_name="str", properties={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", "properties": { "capabilities": ["str"], "description": "str", "enableExternalValidation": bool, - "latestVersion": "str", - "provisioningState": "str", "state": "str", }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, "tags": {"str": "str"}, - "type": "str", }, ) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solution_templates_operations_async.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solution_templates_operations_async.py index a16103099eec..a3203a778b01 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solution_templates_operations_async.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solution_templates_operations_async.py @@ -49,6 +49,7 @@ async def test_solution_templates_begin_create_or_update(self, resource_group): "latestVersion": "str", "provisioningState": "str", "state": "str", + "uniqueIdentifier": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -74,28 +75,13 @@ async def test_solution_templates_update(self, resource_group): resource_group_name=resource_group.name, solution_template_name="str", properties={ - "location": "str", - "eTag": "str", - "id": "str", - "name": "str", "properties": { "capabilities": ["str"], "description": "str", "enableExternalValidation": bool, - "latestVersion": "str", - "provisioningState": "str", "state": "str", }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, "tags": {"str": "str"}, - "type": "str", }, ) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solutions_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solutions_operations.py index 34f6e8774531..bd3218fae0de 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solutions_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solutions_operations.py @@ -71,28 +71,7 @@ def test_solutions_begin_update(self, resource_group): resource_group_name=resource_group.name, target_name="str", solution_name="str", - properties={ - "eTag": "str", - "extendedLocation": {"name": "str", "type": "str"}, - "id": "str", - "name": "str", - "properties": { - "availableSolutionTemplateVersions": [ - {"isConfigured": bool, "latestConfigRevision": "str", "solutionTemplateVersion": "str"} - ], - "provisioningState": "str", - "solutionTemplateId": "str", - }, - "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", - }, + properties={"properties": {}}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solutions_operations_async.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solutions_operations_async.py index 907feef0b3a7..2be517450dcd 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solutions_operations_async.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_solutions_operations_async.py @@ -75,28 +75,7 @@ async def test_solutions_begin_update(self, resource_group): resource_group_name=resource_group.name, target_name="str", solution_name="str", - properties={ - "eTag": "str", - "extendedLocation": {"name": "str", "type": "str"}, - "id": "str", - "name": "str", - "properties": { - "availableSolutionTemplateVersions": [ - {"isConfigured": bool, "latestConfigRevision": "str", "solutionTemplateVersion": "str"} - ], - "provisioningState": "str", - "solutionTemplateId": "str", - }, - "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", - }, + properties={"properties": {}}, ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_targets_operations.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_targets_operations.py index 526a47b30b18..3bfee9ebaa5c 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_targets_operations.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_targets_operations.py @@ -87,44 +87,17 @@ def test_targets_begin_update(self, resource_group): resource_group_name=resource_group.name, target_name="str", properties={ - "location": "str", - "eTag": "str", - "extendedLocation": {"name": "str", "type": "str"}, - "id": "str", - "name": "str", "properties": { "capabilities": ["str"], "contextId": "str", "description": "str", "displayName": "str", "hierarchyLevel": "str", - "targetSpecification": {"str": {}}, - "provisioningState": "str", "solutionScope": "str", "state": "str", - "status": { - "deployed": 0, - "expectedRunningJobId": 0, - "generation": 0, - "lastModified": "2020-02-20 00:00:00", - "runningJobId": 0, - "status": "str", - "statusDetails": "str", - "targetStatuses": [ - {"componentStatuses": [{"name": "str", "status": "str"}], "name": "str", "status": "str"} - ], - }, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", + "targetSpecification": {"str": {}}, }, "tags": {"str": "str"}, - "type": "str", }, ).result() # call '.result()' to poll until service return final result diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_targets_operations_async.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_targets_operations_async.py index 94fffa9dd49f..f68a126b5b4a 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_targets_operations_async.py +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/generated_tests/test_workload_orchestration_mgmt_targets_operations_async.py @@ -95,48 +95,17 @@ async def test_targets_begin_update(self, resource_group): resource_group_name=resource_group.name, target_name="str", properties={ - "location": "str", - "eTag": "str", - "extendedLocation": {"name": "str", "type": "str"}, - "id": "str", - "name": "str", "properties": { "capabilities": ["str"], "contextId": "str", "description": "str", "displayName": "str", "hierarchyLevel": "str", - "targetSpecification": {"str": {}}, - "provisioningState": "str", "solutionScope": "str", "state": "str", - "status": { - "deployed": 0, - "expectedRunningJobId": 0, - "generation": 0, - "lastModified": "2020-02-20 00:00:00", - "runningJobId": 0, - "status": "str", - "statusDetails": "str", - "targetStatuses": [ - { - "componentStatuses": [{"name": "str", "status": "str"}], - "name": "str", - "status": "str", - } - ], - }, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", + "targetSpecification": {"str": {}}, }, "tags": {"str": "str"}, - "type": "str", }, ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/pyproject.toml b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/pyproject.toml index ce5cf69b33f0..3263669de1da 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/pyproject.toml +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/pyproject.toml @@ -1,4 +1,85 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-workloadorchestration" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Workloadorchestration Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">=3.10" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.workloadorchestration._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false pyright = false mypy = false + +[packaging] +package_name = "azure-mgmt-workloadorchestration" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Workloadorchestration Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "WorkloadOrchestrationMgmtClient" diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/sdk_packaging.toml b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/sdk_packaging.toml deleted file mode 100644 index 28d028d9e4ea..000000000000 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/sdk_packaging.toml +++ /dev/null @@ -1,12 +0,0 @@ -[packaging] -package_name = "azure-mgmt-workloadorchestration" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Workloadorchestration Management" -package_doc_id = "" -is_stable = false -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -exclude_folders = "" -title = "WorkloadOrchestrationMgmtClient" diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/setup.py b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/setup.py deleted file mode 100644 index 7230aa52bb6e..000000000000 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/setup.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-workloadorchestration" -PACKAGE_PPRINT_NAME = "Workloadorchestration Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.5.0", - ], - python_requires=">=3.9", -) diff --git a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/tsp-location.yaml b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/tsp-location.yaml index f38f936bff76..db727c9c5d3a 100644 --- a/sdk/workloadorchestration/azure-mgmt-workloadorchestration/tsp-location.yaml +++ b/sdk/workloadorchestration/azure-mgmt-workloadorchestration/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/edge/Microsoft.Edge.ConfigurationManager.Management -commit: 802f22a25fa6938c226d518cd89e61a98201831f +commit: b373ded4a6c77a9f541ca8f020fd2072db632751 repo: Azure/azure-rest-api-specs additionalDirectories: