diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/_meta.json b/sdk/resourcehealth/azure-mgmt-resourcehealth/_meta.json index d1b5bdd1d22a..fe311c91b609 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/_meta.json +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/_meta.json @@ -1,11 +1,11 @@ { - "commit": "51d4c24a011e300b9713179e0515fef35bf3f678", + "commit": "bc573342663fc1fafbb3cdc4fad0a5fd7ca807ed", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.4.0", + "@autorest/python@6.4.6", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/resourcehealth/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/resourcehealth/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.6 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/resourcehealth/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/_serialization.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/_serialization.py index 25467dfc00bb..e3cc6ce6ed6f 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/_serialization.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/_serialization.py @@ -631,7 +631,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): @@ -1273,7 +1273,7 @@ def _extract_name_from_internal_type(internal_type): xml_name = internal_type_xml_map.get("name", internal_type.__name__) xml_ns = internal_type_xml_map.get("ns", None) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1297,7 +1297,7 @@ def xml_key_extractor(attr, attr_desc, data): # Integrate namespace if necessary xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/_version.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/_version.py index 01c327e5d6a4..a30a458f8b5b 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/_version.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "1.0.0b3" +VERSION = "0.1.0" \ No newline at end of file diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_configuration.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_configuration.py index 7b34753df363..59e47b0e561f 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_configuration.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from ._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -43,7 +37,7 @@ class MicrosoftResourceHealthConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(MicrosoftResourceHealthConfiguration, self).__init__(**kwargs) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", "2015-01-01") + api_version: str = kwargs.pop("api_version", "2015-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_microsoft_resource_health.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_microsoft_resource_health.py index f5e4c3ada41c..06e81f95c1a5 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_microsoft_resource_health.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_microsoft_resource_health.py @@ -63,7 +63,7 @@ def __init__( self._config = MicrosoftResourceHealthConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_version.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_version.py index 20971492f129..e5754a47ce68 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_version.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b3" +VERSION = "1.0.0b1" diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/_configuration.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/_configuration.py index a8d670d658ae..c9f00e43b9ee 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/_configuration.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from .._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -43,7 +37,7 @@ class MicrosoftResourceHealthConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(MicrosoftResourceHealthConfiguration, self).__init__(**kwargs) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", "2015-01-01") + api_version: str = kwargs.pop("api_version", "2015-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/_microsoft_resource_health.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/_microsoft_resource_health.py index c3fcf7a2ca8d..29566ae76056 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/_microsoft_resource_health.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/_microsoft_resource_health.py @@ -63,7 +63,7 @@ def __init__( self._config = MicrosoftResourceHealthConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_availability_statuses_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_availability_statuses_operations.py index 8737693a6f32..ec9244999495 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_availability_statuses_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_availability_statuses_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -36,10 +35,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +81,7 @@ def list_by_subscription_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -140,8 +135,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -183,7 +179,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -238,8 +234,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -292,7 +289,7 @@ async def get_by_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatus] = kwargs.pop("cls", None) request = build_get_by_resource_request( @@ -307,8 +304,9 @@ async def get_by_resource( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -357,7 +355,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -411,8 +409,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_child_availability_statuses_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_child_availability_statuses_operations.py index 0e0bb70f5698..0602d52d749f 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_child_availability_statuses_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_child_availability_statuses_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -31,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._child_availability_statuses_operations import build_get_by_resource_request, build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +87,7 @@ async def get_by_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatus] = kwargs.pop("cls", None) request = build_get_by_resource_request( @@ -107,8 +102,9 @@ async def get_by_resource( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,7 +153,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -211,8 +207,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_child_resources_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_child_resources_operations.py index f342647ed9ea..085ef222ac92 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_child_resources_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_child_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._child_resources_operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +80,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -139,8 +134,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_operations.py index 50be7539a9ae..2d1ed129da85 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/aio/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +70,7 @@ async def list(self, **kwargs: Any) -> _models.OperationListResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -87,8 +82,9 @@ async def list(self, **kwargs: Any) -> _models.OperationListResult: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/models/_models_py3.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/models/_models_py3.py index f109d01529e4..9a0e00300ed9 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/models/_models_py3.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/models/_models_py3.py @@ -122,6 +122,16 @@ class AvailabilityStatusProperties(_serialization.Model): # pylint: disable=too health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. :vartype reason_type: str + :ivar context: When an event is created, it can either be triggered by a customer or the + platform of the resource and this field will illustrate that. This field is connected to the + category field in this object. + :vartype context: str + :ivar category: When a context field is set to Platform, this field will reflect if the event + was planned or unplanned. If the context field does not have a value of Platform, then this + field will be ignored. + :vartype category: str + :ivar article_id: The Article Id. + :vartype article_id: str :ivar root_cause_attribution_time: When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. :vartype root_cause_attribution_time: ~datetime.datetime @@ -158,6 +168,9 @@ class AvailabilityStatusProperties(_serialization.Model): # pylint: disable=too "summary": {"key": "summary", "type": "str"}, "detailed_status": {"key": "detailedStatus", "type": "str"}, "reason_type": {"key": "reasonType", "type": "str"}, + "context": {"key": "context", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "article_id": {"key": "articleId", "type": "str"}, "root_cause_attribution_time": {"key": "rootCauseAttributionTime", "type": "iso-8601"}, "resolution_eta": {"key": "resolutionETA", "type": "iso-8601"}, "occured_time": {"key": "occuredTime", "type": "iso-8601"}, @@ -179,6 +192,9 @@ def __init__( summary: Optional[str] = None, detailed_status: Optional[str] = None, reason_type: Optional[str] = None, + context: Optional[str] = None, + category: Optional[str] = None, + article_id: Optional[str] = None, root_cause_attribution_time: Optional[datetime.datetime] = None, resolution_eta: Optional[datetime.datetime] = None, occured_time: Optional[datetime.datetime] = None, @@ -203,6 +219,16 @@ def __init__( the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. :paramtype reason_type: str + :keyword context: When an event is created, it can either be triggered by a customer or the + platform of the resource and this field will illustrate that. This field is connected to the + category field in this object. + :paramtype context: str + :keyword category: When a context field is set to Platform, this field will reflect if the + event was planned or unplanned. If the context field does not have a value of Platform, then + this field will be ignored. + :paramtype category: str + :keyword article_id: The Article Id. + :paramtype article_id: str :keyword root_cause_attribution_time: When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. :paramtype root_cause_attribution_time: ~datetime.datetime @@ -238,6 +264,9 @@ def __init__( self.summary = summary self.detailed_status = detailed_status self.reason_type = reason_type + self.context = context + self.category = category + self.article_id = article_id self.root_cause_attribution_time = root_cause_attribution_time self.resolution_eta = resolution_eta self.occured_time = occured_time @@ -432,6 +461,8 @@ class RecommendedAction(_serialization.Model): :vartype action: str :ivar action_url: Link to the action. :vartype action_url: str + :ivar action_url_comment: the comment for the Action. + :vartype action_url_comment: str :ivar action_url_text: Substring of action, it describes which text should host the action url. :vartype action_url_text: str """ @@ -439,6 +470,7 @@ class RecommendedAction(_serialization.Model): _attribute_map = { "action": {"key": "action", "type": "str"}, "action_url": {"key": "actionUrl", "type": "str"}, + "action_url_comment": {"key": "_ActionUrl\\.Comment", "type": "str"}, "action_url_text": {"key": "actionUrlText", "type": "str"}, } @@ -447,6 +479,7 @@ def __init__( *, action: Optional[str] = None, action_url: Optional[str] = None, + action_url_comment: Optional[str] = None, action_url_text: Optional[str] = None, **kwargs: Any ) -> None: @@ -455,6 +488,8 @@ def __init__( :paramtype action: str :keyword action_url: Link to the action. :paramtype action_url: str + :keyword action_url_comment: the comment for the Action. + :paramtype action_url_comment: str :keyword action_url_text: Substring of action, it describes which text should host the action url. :paramtype action_url_text: str @@ -462,6 +497,7 @@ def __init__( super().__init__(**kwargs) self.action = action self.action_url = action_url + self.action_url_comment = action_url_comment self.action_url_text = action_url_text diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_availability_statuses_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_availability_statuses_operations.py index 1ce93cd468f1..7875ba2cafcb 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_availability_statuses_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_availability_statuses_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +42,7 @@ def build_list_by_subscription_id_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -84,7 +79,7 @@ def build_list_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +113,7 @@ def build_get_by_resource_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +143,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +209,7 @@ def list_by_subscription_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -268,8 +263,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -311,7 +307,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -366,8 +362,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -420,7 +417,7 @@ def get_by_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatus] = kwargs.pop("cls", None) request = build_get_by_resource_request( @@ -435,8 +432,9 @@ def get_by_resource( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -485,7 +483,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -539,8 +537,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_child_availability_statuses_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_child_availability_statuses_operations.py index 90588fa60598..389ddec48bb9 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_child_availability_statuses_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_child_availability_statuses_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +42,7 @@ def build_get_by_resource_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,7 +74,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -156,7 +151,7 @@ def get_by_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatus] = kwargs.pop("cls", None) request = build_get_by_resource_request( @@ -171,8 +166,9 @@ def get_by_resource( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -221,7 +217,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -275,8 +271,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_child_resources_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_child_resources_operations.py index fbd77461c4a6..86614f5e4603 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_child_resources_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_child_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +42,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +113,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -172,8 +167,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_operations.py index f0f98c1335c4..cb3ba7041c99 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2015_01_01/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._serialization import Serializer from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +38,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +92,7 @@ def list(self, **kwargs: Any) -> _models.OperationListResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -109,8 +104,9 @@ def list(self, **kwargs: Any) -> _models.OperationListResult: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_configuration.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_configuration.py index d0da50c9730c..53818996eda0 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_configuration.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from ._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -43,7 +37,7 @@ class MicrosoftResourceHealthConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(MicrosoftResourceHealthConfiguration, self).__init__(**kwargs) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", "2018-07-01") + api_version: str = kwargs.pop("api_version", "2018-07-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_microsoft_resource_health.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_microsoft_resource_health.py index 6a1ea00b4935..56e15dbeac70 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_microsoft_resource_health.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_microsoft_resource_health.py @@ -65,7 +65,7 @@ def __init__( self._config = MicrosoftResourceHealthConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_version.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_version.py index 20971492f129..e5754a47ce68 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_version.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b3" +VERSION = "1.0.0b1" diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/_configuration.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/_configuration.py index 7a5f1b7fc164..8242dd75b3d1 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/_configuration.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from .._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -43,7 +37,7 @@ class MicrosoftResourceHealthConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(MicrosoftResourceHealthConfiguration, self).__init__(**kwargs) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", "2018-07-01") + api_version: str = kwargs.pop("api_version", "2018-07-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/_microsoft_resource_health.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/_microsoft_resource_health.py index 0cdb7f1e8b84..5157fab99f7a 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/_microsoft_resource_health.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/_microsoft_resource_health.py @@ -65,7 +65,7 @@ def __init__( self._config = MicrosoftResourceHealthConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_availability_statuses_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_availability_statuses_operations.py index 4366f2918f1e..704b45c2fa80 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_availability_statuses_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_availability_statuses_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -36,10 +35,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +82,7 @@ def list_by_subscription_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -141,8 +136,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -185,7 +181,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -240,8 +236,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -296,7 +293,7 @@ async def get_by_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.AvailabilityStatus] = kwargs.pop("cls", None) request = build_get_by_resource_request( @@ -311,8 +308,9 @@ async def get_by_resource( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,7 +360,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -416,8 +414,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_emerging_issues_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_emerging_issues_operations.py index 1f19c1c2e295..8bedc5468d5b 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_emerging_issues_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_emerging_issues_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -31,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._emerging_issues_operations import build_get_request, build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +75,7 @@ async def get(self, issue_name: Union[str, _models.Enum8], **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.EmergingIssuesGetResult] = kwargs.pop("cls", None) request = build_get_request( @@ -93,8 +88,9 @@ async def get(self, issue_name: Union[str, _models.Enum8], **kwargs: Any) -> _mo request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,7 +123,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.EmergingIssuesGetResult" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.EmergingIssueListResult] = kwargs.pop("cls", None) error_map = { @@ -178,8 +174,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_events_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_events_operations.py index cf5fd38ee99b..6c2bd1e891c7 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_events_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_events_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -33,10 +32,6 @@ build_list_by_subscription_id_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +86,7 @@ def list_by_subscription_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.Events] = kwargs.pop("cls", None) error_map = { @@ -146,8 +141,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -194,7 +190,7 @@ def list_by_single_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.Events] = kwargs.pop("cls", None) error_map = { @@ -248,8 +244,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_metadata_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_metadata_operations.py index 03b44476404e..6d3a099e8f9c 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_metadata_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_metadata_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -31,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._metadata_operations import build_get_entity_request, build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +66,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.MetadataEntity"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.MetadataEntityListResult] = kwargs.pop("cls", None) error_map = { @@ -122,8 +117,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,7 +156,7 @@ async def get_entity(self, name: str, **kwargs: Any) -> _models.MetadataEntity: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.MetadataEntity] = kwargs.pop("cls", None) request = build_get_entity_request( @@ -173,8 +169,9 @@ async def get_entity(self, name: str, **kwargs: Any) -> _models.MetadataEntity: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_operations.py index e4ff11a438ea..deeec3ec7fa0 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/aio/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +70,7 @@ async def list(self, **kwargs: Any) -> _models.OperationListResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -87,8 +82,9 @@ async def list(self, **kwargs: Any) -> _models.OperationListResult: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/models/_models_py3.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/models/_models_py3.py index d7a7ef94362f..aa775b795005 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/models/_models_py3.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/models/_models_py3.py @@ -130,6 +130,16 @@ class AvailabilityStatusProperties(_serialization.Model): # pylint: disable=too health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. :vartype reason_type: str + :ivar context: When an event is created, it can either be triggered by a customer or the + platform of the resource and this field will illustrate that. This field is connected to the + category field in this object. + :vartype context: str + :ivar category: When a context field is set to Platform, this field will reflect if the event + was planned or unplanned. If the context field does not have a value of Platform, then this + field will be ignored. + :vartype category: str + :ivar article_id: The Article Id. + :vartype article_id: str :ivar root_cause_attribution_time: When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. :vartype root_cause_attribution_time: ~datetime.datetime @@ -175,6 +185,9 @@ class AvailabilityStatusProperties(_serialization.Model): # pylint: disable=too "summary": {"key": "summary", "type": "str"}, "detailed_status": {"key": "detailedStatus", "type": "str"}, "reason_type": {"key": "reasonType", "type": "str"}, + "context": {"key": "context", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "article_id": {"key": "articleId", "type": "str"}, "root_cause_attribution_time": {"key": "rootCauseAttributionTime", "type": "iso-8601"}, "health_event_type": {"key": "healthEventType", "type": "str"}, "health_event_cause": {"key": "healthEventCause", "type": "str"}, @@ -196,6 +209,9 @@ def __init__( summary: Optional[str] = None, detailed_status: Optional[str] = None, reason_type: Optional[str] = None, + context: Optional[str] = None, + category: Optional[str] = None, + article_id: Optional[str] = None, root_cause_attribution_time: Optional[datetime.datetime] = None, health_event_type: Optional[str] = None, health_event_cause: Optional[str] = None, @@ -224,6 +240,16 @@ def __init__( the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. :paramtype reason_type: str + :keyword context: When an event is created, it can either be triggered by a customer or the + platform of the resource and this field will illustrate that. This field is connected to the + category field in this object. + :paramtype context: str + :keyword category: When a context field is set to Platform, this field will reflect if the + event was planned or unplanned. If the context field does not have a value of Platform, then + this field will be ignored. + :paramtype category: str + :keyword article_id: The Article Id. + :paramtype article_id: str :keyword root_cause_attribution_time: When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. :paramtype root_cause_attribution_time: ~datetime.datetime @@ -268,6 +294,9 @@ def __init__( self.summary = summary self.detailed_status = detailed_status self.reason_type = reason_type + self.context = context + self.category = category + self.article_id = article_id self.root_cause_attribution_time = root_cause_attribution_time self.health_event_type = health_event_type self.health_event_cause = health_event_cause @@ -555,6 +584,8 @@ class Event(Resource): # pylint: disable=too-many-instance-attributes :ivar event_level: Level of event. Known values are: "Critical", "Error", "Warning", and "Informational". :vartype event_level: str or ~azure.mgmt.resourcehealth.v2018_07_01.models.EventLevelValues + :ivar reason: The reason for the Incident. + :vartype reason: str :ivar article: Article of event. :vartype article: ~azure.mgmt.resourcehealth.v2018_07_01.models.EventPropertiesArticle :ivar links: Useful links of event. @@ -614,6 +645,7 @@ class Event(Resource): # pylint: disable=too-many-instance-attributes "header": {"key": "properties.header", "type": "str"}, "level": {"key": "properties.level", "type": "str"}, "event_level": {"key": "properties.eventLevel", "type": "str"}, + "reason": {"key": "properties.reason", "type": "str"}, "article": {"key": "properties.article", "type": "EventPropertiesArticle"}, "links": {"key": "properties.links", "type": "[Link]"}, "impact_start_time": {"key": "properties.impactStartTime", "type": "iso-8601"}, @@ -642,6 +674,7 @@ def __init__( # pylint: disable=too-many-locals header: Optional[str] = None, level: Optional[Union[str, "_models.LevelValues"]] = None, event_level: Optional[Union[str, "_models.EventLevelValues"]] = None, + reason: Optional[str] = None, article: Optional["_models.EventPropertiesArticle"] = None, links: Optional[List["_models.Link"]] = None, impact_start_time: Optional[datetime.datetime] = None, @@ -678,6 +711,8 @@ def __init__( # pylint: disable=too-many-locals :keyword event_level: Level of event. Known values are: "Critical", "Error", "Warning", and "Informational". :paramtype event_level: str or ~azure.mgmt.resourcehealth.v2018_07_01.models.EventLevelValues + :keyword reason: The reason for the Incident. + :paramtype reason: str :keyword article: Article of event. :paramtype article: ~azure.mgmt.resourcehealth.v2018_07_01.models.EventPropertiesArticle :keyword links: Useful links of event. @@ -728,6 +763,7 @@ def __init__( # pylint: disable=too-many-locals self.header = header self.level = level self.event_level = event_level + self.reason = reason self.article = article self.links = links self.impact_start_time = impact_start_time @@ -750,19 +786,38 @@ class EventPropertiesArticle(_serialization.Model): :ivar article_content: Article content of event. :vartype article_content: str + :ivar article_id: Article Id. + :vartype article_id: str + :ivar parameters: It provides a map of parameter name and value. + :vartype parameters: JSON """ _attribute_map = { "article_content": {"key": "articleContent", "type": "str"}, + "article_id": {"key": "articleId", "type": "str"}, + "parameters": {"key": "parameters", "type": "object"}, } - def __init__(self, *, article_content: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + article_content: Optional[str] = None, + article_id: Optional[str] = None, + parameters: Optional[JSON] = None, + **kwargs: Any + ) -> None: """ :keyword article_content: Article content of event. :paramtype article_content: str + :keyword article_id: Article Id. + :paramtype article_id: str + :keyword parameters: It provides a map of parameter name and value. + :paramtype parameters: JSON """ super().__init__(**kwargs) self.article_content = article_content + self.article_id = article_id + self.parameters = parameters class EventPropertiesRecommendedActions(_serialization.Model): @@ -1348,6 +1403,8 @@ class RecommendedAction(_serialization.Model): :vartype action: str :ivar action_url: Link to the action. :vartype action_url: str + :ivar action_url_comment: the comment for the Action. + :vartype action_url_comment: str :ivar action_url_text: Substring of action, it describes which text should host the action url. :vartype action_url_text: str """ @@ -1355,6 +1412,7 @@ class RecommendedAction(_serialization.Model): _attribute_map = { "action": {"key": "action", "type": "str"}, "action_url": {"key": "actionUrl", "type": "str"}, + "action_url_comment": {"key": "_ActionUrl\\.Comment", "type": "str"}, "action_url_text": {"key": "actionUrlText", "type": "str"}, } @@ -1363,6 +1421,7 @@ def __init__( *, action: Optional[str] = None, action_url: Optional[str] = None, + action_url_comment: Optional[str] = None, action_url_text: Optional[str] = None, **kwargs: Any ) -> None: @@ -1371,6 +1430,8 @@ def __init__( :paramtype action: str :keyword action_url: Link to the action. :paramtype action_url: str + :keyword action_url_comment: the comment for the Action. + :paramtype action_url_comment: str :keyword action_url_text: Substring of action, it describes which text should host the action url. :paramtype action_url_text: str @@ -1378,6 +1439,7 @@ def __init__( super().__init__(**kwargs) self.action = action self.action_url = action_url + self.action_url_comment = action_url_comment self.action_url_text = action_url_text diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_availability_statuses_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_availability_statuses_operations.py index 0d8204da04f8..bdbe45b91eae 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_availability_statuses_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_availability_statuses_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +42,7 @@ def build_list_by_subscription_id_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -84,7 +79,7 @@ def build_list_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +113,7 @@ def build_get_by_resource_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +143,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +210,7 @@ def list_by_subscription_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -269,8 +264,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -313,7 +309,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -368,8 +364,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,7 +421,7 @@ def get_by_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.AvailabilityStatus] = kwargs.pop("cls", None) request = build_get_by_resource_request( @@ -439,8 +436,9 @@ def get_by_resource( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -490,7 +488,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.AvailabilityStatusListResult] = kwargs.pop("cls", None) error_map = { @@ -544,8 +542,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_emerging_issues_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_emerging_issues_operations.py index 67e0e64497e4..8c7a90d6716d 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_emerging_issues_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_emerging_issues_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -30,10 +29,6 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +40,7 @@ def build_get_request(issue_name: Union[str, _models.Enum8], **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +64,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +120,7 @@ def get(self, issue_name: Union[str, _models.Enum8], **kwargs: Any) -> _models.E _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.EmergingIssuesGetResult] = kwargs.pop("cls", None) request = build_get_request( @@ -138,8 +133,9 @@ def get(self, issue_name: Union[str, _models.Enum8], **kwargs: Any) -> _models.E request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -172,7 +168,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.EmergingIssuesGetResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.EmergingIssueListResult] = kwargs.pop("cls", None) error_map = { @@ -223,8 +219,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_events_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_events_operations.py index 2fc1b98f4827..39374d075cca 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_events_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_events_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +47,7 @@ def build_list_by_subscription_id_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -84,7 +79,7 @@ def build_list_by_single_resource_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -157,7 +152,7 @@ def list_by_subscription_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.Events] = kwargs.pop("cls", None) error_map = { @@ -212,8 +207,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -259,7 +255,7 @@ def list_by_single_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.Events] = kwargs.pop("cls", None) error_map = { @@ -313,8 +309,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_metadata_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_metadata_operations.py index 1636ab55b347..c0a7329dfdbb 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_metadata_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_metadata_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +59,7 @@ def build_get_entity_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +111,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.MetadataEntity"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.MetadataEntityListResult] = kwargs.pop("cls", None) error_map = { @@ -167,8 +162,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,7 +201,7 @@ def get_entity(self, name: str, **kwargs: Any) -> _models.MetadataEntity: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.MetadataEntity] = kwargs.pop("cls", None) request = build_get_entity_request( @@ -218,8 +214,9 @@ def get_entity(self, name: str, **kwargs: Any) -> _models.MetadataEntity: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_operations.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_operations.py index 6f8c3f7b5fbd..af1a40ea2186 100644 --- a/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_operations.py +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/azure/mgmt/resourcehealth/v2018_07_01/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._serialization import Serializer from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +38,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +92,7 @@ def list(self, **kwargs: Any) -> _models.OperationListResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2018-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -109,8 +104,9 @@ def list(self, **kwargs: Any) -> _models.OperationListResult: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/resourcehealth/azure-mgmt-resourcehealth/generated_samples/operations_list.py b/sdk/resourcehealth/azure-mgmt-resourcehealth/generated_samples/operations_list.py new file mode 100644 index 000000000000..3b48776e462e --- /dev/null +++ b/sdk/resourcehealth/azure-mgmt-resourcehealth/generated_samples/operations_list.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.resourcehealth import MicrosoftResourceHealth + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-resourcehealth +# USAGE + python operations_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + 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 = MicrosoftResourceHealth( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.operations.list() + print(response) + + +# x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2018-07-01/examples/Operations_List.json +if __name__ == "__main__": + main()