From 23d1db2edcdadc2267c7dd16c56bce9bdba432a6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 May 2025 11:06:09 +0000 Subject: [PATCH] CodeGen from PR 34270 in Azure/azure-rest-api-specs Merge c5c31b0506df39bc9e78f53a9678914719c1964d into a19648565889eaae019e531c15f3045d1244c7ce --- .../azure-mgmt-impactreporting/CHANGELOG.md | 6 + .../azure-mgmt-impactreporting/README.md | 6 +- .../azure-mgmt-impactreporting/_meta.json | 4 +- .../apiview-properties.json | 48 +++++--- .../azure/mgmt/impactreporting/_client.py | 28 +++-- .../azure/mgmt/impactreporting/_patch.py | 9 +- .../mgmt/impactreporting/_utils/__init__.py | 6 + .../{_model_base.py => _utils/model_base.py} | 27 ++--- .../serialization.py} | 28 +---- .../azure/mgmt/impactreporting/_version.py | 2 +- .../azure/mgmt/impactreporting/aio/_client.py | 30 +++-- .../azure/mgmt/impactreporting/aio/_patch.py | 9 +- .../aio/operations/_operations.py | 22 ++-- .../impactreporting/aio/operations/_patch.py | 9 +- .../mgmt/impactreporting/models/_models.py | 103 ++++++------------ .../mgmt/impactreporting/models/_patch.py | 9 +- .../impactreporting/operations/_operations.py | 32 +++--- .../mgmt/impactreporting/operations/_patch.py | 9 +- .../generated_samples/insights_create.py | 2 +- .../azure-mgmt-impactreporting/setup.py | 5 +- .../tsp-location.yaml | 2 +- 21 files changed, 189 insertions(+), 207 deletions(-) create mode 100644 sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/__init__.py rename sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/{_model_base.py => _utils/model_base.py} (98%) rename sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/{_serialization.py => _utils/serialization.py} (98%) diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/CHANGELOG.md b/sdk/impactreporting/azure-mgmt-impactreporting/CHANGELOG.md index 39390fc093d7..6a1af2ec68ed 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/CHANGELOG.md +++ b/sdk/impactreporting/azure-mgmt-impactreporting/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.0.0b2 (2025-05-13) + +### Features Added + + - Method `WorkloadImpactProperties.__init__` has a new overload `def __init__(self: None, start_date_time: datetime, impacted_resource_id: str, impact_category: str, end_date_time: Optional[datetime], impact_description: Optional[str], arm_correlation_ids: Optional[List[str]], performance: Optional[List[_models.Performance]], connectivity: Optional[_models.Connectivity], additional_properties: Optional[Dict[str, Any]], error_details: Optional[_models.ErrorDetailProperties], workload: Optional[_models.Workload], impact_group_id: Optional[str], confidence_level: Optional[Union[str, _models.ConfidenceLevel]], client_incident_details: Optional[_models.ClientIncidentDetails])` + ## 1.0.0b1 (2025-02-19) ### Other Changes diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/README.md b/sdk/impactreporting/azure-mgmt-impactreporting/README.md index 69b58e6ffc4d..1da0a1fdefea 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/README.md +++ b/sdk/impactreporting/azure-mgmt-impactreporting/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Impactreporting Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. 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.8+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/_meta.json b/sdk/impactreporting/azure-mgmt-impactreporting/_meta.json index 4caffc2c4bcf..6a90dd443a8f 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/_meta.json +++ b/sdk/impactreporting/azure-mgmt-impactreporting/_meta.json @@ -1,6 +1,6 @@ { - "commit": "2ed1d371e3519553cd527c1f9f2c316f9ed58f47", + "commit": "079f70d6f2b754db6b736e117196104efd2dd496", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/impact/Impact.Management", - "@azure-tools/typespec-python": "0.38.4" + "@azure-tools/typespec-python": "0.44.2" } \ No newline at end of file diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/apiview-properties.json b/sdk/impactreporting/azure-mgmt-impactreporting/apiview-properties.json index 7e1ea047dcac..764c6d5c9d7a 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/apiview-properties.json +++ b/sdk/impactreporting/azure-mgmt-impactreporting/apiview-properties.json @@ -39,21 +39,37 @@ "azure.mgmt.impactreporting.models.ConfidenceLevel": "Microsoft.Impact.ConfidenceLevel", "azure.mgmt.impactreporting.models.IncidentSource": "Microsoft.Impact.IncidentSource", "azure.mgmt.impactreporting.models.Platform": "Microsoft.Impact.Platform", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.workload_impacts.begin_create": "Microsoft.Impact.WorkloadImpacts.create", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.workload_impacts.get": "Microsoft.Impact.WorkloadImpacts.get", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.workload_impacts.delete": "Microsoft.Impact.WorkloadImpacts.delete", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.workload_impacts.list_by_subscription": "Microsoft.Impact.WorkloadImpacts.listBySubscription", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.impact_categories.get": "Microsoft.Impact.ImpactCategories.get", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.impact_categories.list_by_subscription": "Microsoft.Impact.ImpactCategories.listBySubscription", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.insights.get": "Microsoft.Impact.Insights.get", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.insights.list_by_subscription": "Microsoft.Impact.Insights.listBySubscription", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.insights.create": "Microsoft.Impact.Insights.create", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.insights.delete": "Microsoft.Impact.Insights.delete", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.connectors.get": "Microsoft.Impact.Connectors.get", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.connectors.begin_create_or_update": "Microsoft.Impact.Connectors.createOrUpdate", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.connectors.update": "Microsoft.Impact.Connectors.update", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.connectors.delete": "Microsoft.Impact.Connectors.delete", - "azure.mgmt.impactreporting.ImpactReportingMgmtClient.connectors.list_by_subscription": "Microsoft.Impact.Connectors.listBySubscription" + "azure.mgmt.impactreporting.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.impactreporting.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.impactreporting.operations.WorkloadImpactsOperations.begin_create": "Microsoft.Impact.WorkloadImpacts.create", + "azure.mgmt.impactreporting.aio.operations.WorkloadImpactsOperations.begin_create": "Microsoft.Impact.WorkloadImpacts.create", + "azure.mgmt.impactreporting.operations.WorkloadImpactsOperations.get": "Microsoft.Impact.WorkloadImpacts.get", + "azure.mgmt.impactreporting.aio.operations.WorkloadImpactsOperations.get": "Microsoft.Impact.WorkloadImpacts.get", + "azure.mgmt.impactreporting.operations.WorkloadImpactsOperations.delete": "Microsoft.Impact.WorkloadImpacts.delete", + "azure.mgmt.impactreporting.aio.operations.WorkloadImpactsOperations.delete": "Microsoft.Impact.WorkloadImpacts.delete", + "azure.mgmt.impactreporting.operations.WorkloadImpactsOperations.list_by_subscription": "Microsoft.Impact.WorkloadImpacts.listBySubscription", + "azure.mgmt.impactreporting.aio.operations.WorkloadImpactsOperations.list_by_subscription": "Microsoft.Impact.WorkloadImpacts.listBySubscription", + "azure.mgmt.impactreporting.operations.ImpactCategoriesOperations.get": "Microsoft.Impact.ImpactCategories.get", + "azure.mgmt.impactreporting.aio.operations.ImpactCategoriesOperations.get": "Microsoft.Impact.ImpactCategories.get", + "azure.mgmt.impactreporting.operations.ImpactCategoriesOperations.list_by_subscription": "Microsoft.Impact.ImpactCategories.listBySubscription", + "azure.mgmt.impactreporting.aio.operations.ImpactCategoriesOperations.list_by_subscription": "Microsoft.Impact.ImpactCategories.listBySubscription", + "azure.mgmt.impactreporting.operations.InsightsOperations.get": "Microsoft.Impact.Insights.get", + "azure.mgmt.impactreporting.aio.operations.InsightsOperations.get": "Microsoft.Impact.Insights.get", + "azure.mgmt.impactreporting.operations.InsightsOperations.list_by_subscription": "Microsoft.Impact.Insights.listBySubscription", + "azure.mgmt.impactreporting.aio.operations.InsightsOperations.list_by_subscription": "Microsoft.Impact.Insights.listBySubscription", + "azure.mgmt.impactreporting.operations.InsightsOperations.create": "Microsoft.Impact.Insights.create", + "azure.mgmt.impactreporting.aio.operations.InsightsOperations.create": "Microsoft.Impact.Insights.create", + "azure.mgmt.impactreporting.operations.InsightsOperations.delete": "Microsoft.Impact.Insights.delete", + "azure.mgmt.impactreporting.aio.operations.InsightsOperations.delete": "Microsoft.Impact.Insights.delete", + "azure.mgmt.impactreporting.operations.ConnectorsOperations.get": "Microsoft.Impact.Connectors.get", + "azure.mgmt.impactreporting.aio.operations.ConnectorsOperations.get": "Microsoft.Impact.Connectors.get", + "azure.mgmt.impactreporting.operations.ConnectorsOperations.begin_create_or_update": "Microsoft.Impact.Connectors.createOrUpdate", + "azure.mgmt.impactreporting.aio.operations.ConnectorsOperations.begin_create_or_update": "Microsoft.Impact.Connectors.createOrUpdate", + "azure.mgmt.impactreporting.operations.ConnectorsOperations.update": "Microsoft.Impact.Connectors.update", + "azure.mgmt.impactreporting.aio.operations.ConnectorsOperations.update": "Microsoft.Impact.Connectors.update", + "azure.mgmt.impactreporting.operations.ConnectorsOperations.delete": "Microsoft.Impact.Connectors.delete", + "azure.mgmt.impactreporting.aio.operations.ConnectorsOperations.delete": "Microsoft.Impact.Connectors.delete", + "azure.mgmt.impactreporting.operations.ConnectorsOperations.list_by_subscription": "Microsoft.Impact.Connectors.listBySubscription", + "azure.mgmt.impactreporting.aio.operations.ConnectorsOperations.list_by_subscription": "Microsoft.Impact.Connectors.listBySubscription" } } \ No newline at end of file diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_client.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_client.py index f052207769d6..e8df2a7a272b 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_client.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +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 +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from ._configuration import ImpactReportingMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( ConnectorsOperations, ImpactCategoriesOperations, @@ -46,7 +48,7 @@ class ImpactReportingMgmtClient: :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :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 "2024-05-01-preview". Note that overriding this default value may result in unsupported @@ -57,16 +59,22 @@ class ImpactReportingMgmtClient: """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ImpactReportingMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -85,7 +93,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) self._serialize = Serializer() self._deserialize = Deserializer() diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_patch.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_patch.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/__init__.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_model_base.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/model_base.py similarity index 98% rename from sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_model_base.py rename to sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/model_base.py index 3072ee252ed9..49d5c7259389 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_model_base.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/model_base.py @@ -2,8 +2,9 @@ # 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. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=protected-access, broad-except @@ -21,6 +22,7 @@ from datetime import datetime, date, time, timedelta, timezone 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 @@ -28,11 +30,6 @@ from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping - _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -347,7 +344,7 @@ def _get_model(module_name: str, model_name: str): _UNSET = object() -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object +class _MyMutableMapping(MutableMapping[str, typing.Any]): def __init__(self, data: typing.Dict[str, typing.Any]) -> None: self._data = data @@ -407,13 +404,13 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: return default @typing.overload - def pop(self, key: str) -> typing.Any: ... + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ @typing.overload - def pop(self, key: str, default: _T) -> _T: ... + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ @@ -443,7 +440,7 @@ def clear(self) -> None: """ self._data.clear() - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ Updates D from mapping/iterable E and F. :param any args: Either a mapping object or an iterable of key-value pairs. @@ -454,7 +451,7 @@ def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: def setdefault(self, key: str, default: None = None) -> None: ... @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ @@ -644,7 +641,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint: disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: @@ -680,7 +677,7 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + 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]: diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_serialization.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/serialization.py similarity index 98% rename from sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_serialization.py rename to sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/serialization.py index e2a20b1d534c..eb86ea23c965 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_serialization.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_utils/serialization.py @@ -1,28 +1,10 @@ # pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# 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. # -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false @@ -411,7 +393,7 @@ def from_dict( :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_version.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_version.py index be71c81bd282..bbcd28b4aa67 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_version.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_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/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/_client.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/_client.py index 0bfac41cdb35..b9146f0064c1 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/_client.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/_client.py @@ -7,15 +7,17 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +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 +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import ImpactReportingMgmtClientConfiguration from .operations import ( ConnectorsOperations, @@ -47,7 +49,7 @@ class ImpactReportingMgmtClient: :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :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 "2024-05-01-preview". Note that overriding this default value may result in unsupported @@ -58,16 +60,22 @@ class ImpactReportingMgmtClient: """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ImpactReportingMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -86,7 +94,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) self._serialize = Serializer() self._deserialize = Deserializer() diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/_patch.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/_patch.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/operations/_operations.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/operations/_operations.py index 2250b7f9282e..20e28bdacac6 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/operations/_operations.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/operations/_operations.py @@ -6,9 +6,9 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -34,8 +34,8 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from ..._serialization import Deserializer, Serializer +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import ( build_connectors_create_or_update_request, build_connectors_delete_request, @@ -56,13 +56,9 @@ ) from .._configuration import ImpactReportingMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] class Operations: @@ -142,7 +138,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -554,7 +550,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.WorkloadImpact], deserialized["value"]) + list_of_elem = _deserialize(List[_models.WorkloadImpact], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -727,7 +723,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ImpactCategory], deserialized["value"]) + list_of_elem = _deserialize(List[_models.ImpactCategory], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -897,7 +893,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Insight], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Insight], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1654,7 +1650,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Connector], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Connector], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/operations/_patch.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/operations/_patch.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/operations/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/models/_models.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/models/_models.py index 3adb9bcdef97..ac107e50f8aa 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/models/_models.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/models/_models.py @@ -9,16 +9,15 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, List, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload -from .. import _model_base -from .._model_base import rest_field +from .._utils.model_base import Model as _Model, rest_field if TYPE_CHECKING: from .. import models as _models -class ClientIncidentDetails(_model_base.Model): +class ClientIncidentDetails(_Model): """Client incident details ex: incidentId , incident source. :ivar client_incident_id: Client incident id. ex : id of the incident created to investigate @@ -59,7 +58,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Connectivity(_model_base.Model): +class Connectivity(_Model): """Details about connectivity issue. Applicable when root resource causing the issue is not identified. For example, when a VM is impacted due to a network issue, the impacted resource could be VM or the network. In such cases, the connectivity field will have the details about @@ -109,10 +108,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Resource(_model_base.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Readonly variables are only populated by the server, and will be ignored when sending a request. +class Resource(_Model): + """Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -140,10 +137,7 @@ class Resource(_model_base.Model): class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Readonly variables are only populated by the server, and will be ignored when sending a request. + """Proxy Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -163,8 +157,6 @@ class Connector(ProxyResource): """A connector is a resource that can be used to proactively report impacts against workloads in Azure to Microsoft. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str @@ -203,12 +195,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConnectorProperties(_model_base.Model): +class ConnectorProperties(_Model): """Details of the Connector. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Resource provisioning state. Known values are: "Succeeded", "Failed", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.impactreporting.models.ProvisioningState @@ -255,7 +244,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConnectorUpdate(_model_base.Model): +class ConnectorUpdate(_Model): """The type used for update operations of the Connector. :ivar properties: The resource-specific properties for this resource. @@ -285,7 +274,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConnectorUpdateProperties(_model_base.Model): +class ConnectorUpdateProperties(_Model): """The updatable properties of the Connector. :ivar connector_type: connector type. "AzureMonitor" @@ -315,10 +304,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Content(_model_base.Model): +class Content(_Model): """Article details of the insight like title, description etc. - :ivar title: Title of the insight. Required. :vartype title: str :ivar description: Description of the insight. Required. @@ -349,11 +337,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ErrorAdditionalInfo(_model_base.Model): +class ErrorAdditionalInfo(_Model): """The resource management error additional info. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. @@ -366,11 +352,9 @@ class ErrorAdditionalInfo(_model_base.Model): """The additional info.""" -class ErrorDetail(_model_base.Model): +class ErrorDetail(_Model): """The error detail. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar code: The error code. :vartype code: str :ivar message: The error message. @@ -397,7 +381,7 @@ class ErrorDetail(_model_base.Model): """The error additional info.""" -class ErrorDetailProperties(_model_base.Model): +class ErrorDetailProperties(_Model): """ARM error code and error message associated with the impact. :ivar error_code: ARM Error code associated with the impact. @@ -432,9 +416,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ErrorResponse(_model_base.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. +class ErrorResponse(_Model): + """Error response. :ivar error: The error object. :vartype error: ~azure.mgmt.impactreporting.models.ErrorDetail @@ -461,10 +444,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExpectedValueRange(_model_base.Model): +class ExpectedValueRange(_Model): """Max and Min Threshold values for the metric. - :ivar min: Min threshold value for the metric. Required. :vartype min: float :ivar max: Max threshold value for the metric. Required. @@ -498,8 +480,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ImpactCategory(ProxyResource): """ImpactCategory resource. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str @@ -538,12 +518,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImpactCategoryProperties(_model_base.Model): +class ImpactCategoryProperties(_Model): """Impact category properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Resource provisioning state. Known values are: "Succeeded", "Failed", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.impactreporting.models.ProvisioningState @@ -597,10 +574,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImpactDetails(_model_base.Model): +class ImpactDetails(_Model): """details of of the impact for which insight has been generated. - :ivar impacted_resource_id: List of impacted Azure resources. Required. :vartype impacted_resource_id: str :ivar start_time: Time at which impact was started according to reported impact. Required. @@ -650,8 +626,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Insight(ProxyResource): """Insight resource. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str @@ -690,12 +664,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightProperties(_model_base.Model): +class InsightProperties(_Model): """Impact category properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Resource provisioning state. Known values are: "Succeeded", "Failed", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.impactreporting.models.ProvisioningState @@ -776,10 +747,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_model_base.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Readonly variables are only populated by the server, and will be ignored when sending a request. +class Operation(_Model): + """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". @@ -835,11 +804,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationDisplay(_model_base.Model): +class OperationDisplay(_Model): """Localized display information for and operation. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". :vartype provider: str @@ -868,7 +835,7 @@ class OperationDisplay(_model_base.Model): views.""" -class Performance(_model_base.Model): +class Performance(_Model): """Details about impacted performance metrics. Applicable for performance related impact. :ivar metric_name: Name of the Metric examples: Disk, IOPs, CPU, GPU, Memory, details can be @@ -930,10 +897,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RequiredImpactProperties(_model_base.Model): +class RequiredImpactProperties(_Model): """Required impact properties. - :ivar name: Name of the property. Required. :vartype name: str :ivar allowed_values: Allowed values values for the property. @@ -966,7 +932,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SourceOrTarget(_model_base.Model): +class SourceOrTarget(_Model): """Resource details. :ivar azure_resource_id: Azure resource id, example @@ -998,7 +964,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SystemData(_model_base.Model): +class SystemData(_Model): """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -1065,7 +1031,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Workload(_model_base.Model): +class Workload(_Model): """Information about the impacted workload. :ivar context: the scenario for the workload. @@ -1105,8 +1071,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class WorkloadImpact(ProxyResource): """Workload Impact properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str @@ -1145,12 +1109,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WorkloadImpactProperties(_model_base.Model): +class WorkloadImpactProperties(_Model): """Workload impact properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Resource provisioning state. Known values are: "Succeeded", "Failed", and "Canceled". :vartype provisioning_state: str or ~azure.mgmt.impactreporting.models.ProvisioningState @@ -1181,7 +1142,7 @@ class WorkloadImpactProperties(_model_base.Model): :vartype connectivity: ~azure.mgmt.impactreporting.models.Connectivity :ivar additional_properties: Additional fields related to impact, applicable fields per resource type are list under /impactCategories API. - :vartype additional_properties: any + :vartype additional_properties: dict[str, any] :ivar error_details: ARM error code and error message associated with the impact. :vartype error_details: ~azure.mgmt.impactreporting.models.ErrorDetailProperties :ivar workload: Information about the impacted workload. @@ -1238,7 +1199,7 @@ class WorkloadImpactProperties(_model_base.Model): identified. For example, when a VM is impacted due to a network issue, the impacted resource is identified as the VM, but the root cause is the network. In such cases, the connectivity field will have the details about the network issue.""" - additional_properties: Optional[Any] = rest_field( + additional_properties: Optional[Dict[str, Any]] = rest_field( name="additionalProperties", visibility=["read", "create", "update", "delete", "query"] ) """Additional fields related to impact, applicable fields per resource type are list under @@ -1275,7 +1236,7 @@ def __init__( arm_correlation_ids: Optional[List[str]] = None, performance: Optional[List["_models.Performance"]] = None, connectivity: Optional["_models.Connectivity"] = None, - additional_properties: Optional[Any] = None, + additional_properties: Optional[Dict[str, Any]] = None, error_details: Optional["_models.ErrorDetailProperties"] = None, workload: Optional["_models.Workload"] = None, impact_group_id: Optional[str] = None, diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/models/_patch.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/models/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/models/_patch.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/models/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/operations/_operations.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/operations/_operations.py index abde1505d85c..085b6346d623 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/operations/_operations.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/operations/_operations.py @@ -6,9 +6,9 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -34,16 +34,12 @@ from .. import models as _models from .._configuration import ImpactReportingMgmtClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from .._serialization import Deserializer, Serializer +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -488,7 +484,7 @@ class Operations: :attr:`operations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ImpactReportingMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -555,7 +551,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -589,7 +585,7 @@ class WorkloadImpactsOperations: :attr:`workload_impacts` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ImpactReportingMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -968,7 +964,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.WorkloadImpact], deserialized["value"]) + list_of_elem = _deserialize(List[_models.WorkloadImpact], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1002,7 +998,7 @@ class ImpactCategoriesOperations: :attr:`impact_categories` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ImpactReportingMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -1140,7 +1136,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ImpactCategory], deserialized["value"]) + list_of_elem = _deserialize(List[_models.ImpactCategory], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1174,7 +1170,7 @@ class InsightsOperations: :attr:`insights` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ImpactReportingMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -1310,7 +1306,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Insight], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Insight], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1561,7 +1557,7 @@ class ConnectorsOperations: :attr:`connectors` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ImpactReportingMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") @@ -2069,7 +2065,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Connector], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Connector], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/operations/_patch.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/operations/_patch.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/operations/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/generated_samples/insights_create.py b/sdk/impactreporting/azure-mgmt-impactreporting/generated_samples/insights_create.py index 939a95aded2e..0c78a7adbbdd 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/generated_samples/insights_create.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/generated_samples/insights_create.py @@ -38,7 +38,7 @@ def main(): "properties": { "category": "repair", "content": { - "description": 'At 2018-11-08T00:00:00Z UTC, your services dependent on these resources :code:`VM1` may have experienced an issue. :code:`
`\\ :code:`
`We have identified an outage that affected these resources(s). You can look at outage information on :code:`NL2W-VCZ` link.\\ :code:`
`', + "description": 'At 2018-11-08T00:00:00Z UTC, your services dependent on these resources VM1 may have experienced an issue.
We have identified an outage that affected these resources(s). You can look at outage information on NL2W-VCZ link.
', "title": "Impact Has been correlated to an outage", }, "eventTime": "2023-06-15T04:00:00.009223Z", diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/setup.py b/sdk/impactreporting/azure-mgmt-impactreporting/setup.py index fe9648afa0df..9deb2c8fc823 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/setup.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/setup.py @@ -53,7 +53,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -77,7 +76,7 @@ "isodate>=0.6.1", "typing-extensions>=4.6.0", "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", + "azure-mgmt-core>=1.5.0", ], - python_requires=">=3.8", + python_requires=">=3.9", ) diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/tsp-location.yaml b/sdk/impactreporting/azure-mgmt-impactreporting/tsp-location.yaml index f077b3260131..e55f99bf738a 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/tsp-location.yaml +++ b/sdk/impactreporting/azure-mgmt-impactreporting/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/impact/Impact.Management -commit: 2ed1d371e3519553cd527c1f9f2c316f9ed58f47 +commit: 079f70d6f2b754db6b736e117196104efd2dd496 repo: Azure/azure-rest-api-specs additionalDirectories: