From 9bbf5c80cb795a260f6acd74c707dfcc5002632a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 26 Mar 2025 15:51:19 +0000 Subject: [PATCH] CodeGen from PR 33352 in Azure/azure-rest-api-specs Merge 5d05f98b8edc461aa70ebb4797d11c16df89c9d2 into 45924e49834c4e01c0713e6b7ca21f94be17e396 --- .../azure-mgmt-impactreporting/CHANGELOG.md | 6 +++ .../azure-mgmt-impactreporting/README.md | 2 +- .../azure-mgmt-impactreporting/_meta.json | 4 +- .../mgmt/impactreporting/_serialization.py | 2 +- .../azure/mgmt/impactreporting/_version.py | 2 +- .../aio/operations/_operations.py | 10 ++--- .../mgmt/impactreporting/models/_models.py | 44 ++----------------- .../impactreporting/operations/_operations.py | 10 ++--- .../generated_samples/insights_create.py | 2 +- .../tsp-location.yaml | 2 +- 10 files changed, 27 insertions(+), 57 deletions(-) diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/CHANGELOG.md b/sdk/impactreporting/azure-mgmt-impactreporting/CHANGELOG.md index 39390fc093d7..75aff060d7f6 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-03-26) + +### 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..52c0208b2849 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/README.md +++ b/sdk/impactreporting/azure-mgmt-impactreporting/README.md @@ -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..6672cd6fabb9 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/_meta.json +++ b/sdk/impactreporting/azure-mgmt-impactreporting/_meta.json @@ -1,6 +1,6 @@ { - "commit": "2ed1d371e3519553cd527c1f9f2c316f9ed58f47", + "commit": "91b7747c37688b97639a7e73390b554a3d1e562a", "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.41.0" } \ No newline at end of file diff --git a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_serialization.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_serialization.py index e2a20b1d534c..7a0232de5ddc 100644 --- a/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_serialization.py +++ b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/_serialization.py @@ -411,7 +411,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/operations/_operations.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/aio/operations/_operations.py index 2250b7f9282e..6b0c9851721f 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 @@ -142,7 +142,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 +554,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 +727,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 +897,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 +1654,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/models/_models.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/models/_models.py index 3adb9bcdef97..d26cd87ac3eb 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,7 +9,7 @@ # 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 @@ -112,8 +112,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Resource(_model_base.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str @@ -143,8 +141,6 @@ 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. - :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str @@ -163,8 +159,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 @@ -206,9 +200,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ConnectorProperties(_model_base.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 @@ -318,7 +309,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Content(_model_base.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. @@ -352,8 +342,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ErrorAdditionalInfo(_model_base.Model): """The resource management error additional info. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. @@ -369,8 +357,6 @@ class ErrorAdditionalInfo(_model_base.Model): class ErrorDetail(_model_base.Model): """The error detail. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar code: The error code. :vartype code: str :ivar message: The error message. @@ -464,7 +450,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ExpectedValueRange(_model_base.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 +483,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 @@ -541,9 +524,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ImpactCategoryProperties(_model_base.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 @@ -600,7 +580,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ImpactDetails(_model_base.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 +629,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 @@ -693,9 +670,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InsightProperties(_model_base.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 @@ -779,8 +753,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Operation(_model_base.Model): """Details of a REST API operation, returned from the Resource Provider Operations API. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". :vartype name: str @@ -838,8 +810,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OperationDisplay(_model_base.Model): """Localized display information for and operation. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". :vartype provider: str @@ -933,7 +903,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class RequiredImpactProperties(_model_base.Model): """Required impact properties. - :ivar name: Name of the property. Required. :vartype name: str :ivar allowed_values: Allowed values values for the property. @@ -1105,8 +1074,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 @@ -1148,9 +1115,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class WorkloadImpactProperties(_model_base.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 +1145,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 +1202,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 +1239,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/operations/_operations.py b/sdk/impactreporting/azure-mgmt-impactreporting/azure/mgmt/impactreporting/operations/_operations.py index abde1505d85c..4c11f6c66d8d 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 @@ -555,7 +555,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) @@ -968,7 +968,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) @@ -1140,7 +1140,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) @@ -1310,7 +1310,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) @@ -2069,7 +2069,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/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/tsp-location.yaml b/sdk/impactreporting/azure-mgmt-impactreporting/tsp-location.yaml index f077b3260131..452a88a55e91 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: 91b7747c37688b97639a7e73390b554a3d1e562a repo: Azure/azure-rest-api-specs additionalDirectories: