1515from azure .core .pipeline .transport import AsyncHttpResponse , HttpRequest
1616from azure .mgmt .core .exceptions import ARMErrorFormat
1717
18- from ... import models
18+ from ... import models as _models
1919
2020T = TypeVar ('T' )
2121ClsType = Optional [Callable [[PipelineResponse [HttpRequest , AsyncHttpResponse ], T , Dict [str , Any ]], Any ]]
@@ -34,7 +34,7 @@ class HealthMonitorsOperations:
3434 :param deserializer: An object model deserializer.
3535 """
3636
37- models = models
37+ models = _models
3838
3939 def __init__ (self , client , config , serializer , deserializer ) -> None :
4040 self ._client = client
@@ -51,8 +51,8 @@ def list(
5151 resource_name : str ,
5252 filter : Optional [str ] = None ,
5353 expand : Optional [str ] = None ,
54- ** kwargs
55- ) -> AsyncIterable ["models .HealthMonitorList" ]:
54+ ** kwargs : Any
55+ ) -> AsyncIterable ["_models .HealthMonitorList" ]:
5656 """Get the current health status of all monitors of a virtual machine. Optional parameters: $expand (retrieve the monitor's evidence and configuration) and $filter (filter by monitor name).
5757
5858 Get the current health status of all monitors of a virtual machine. Optional parameters:
@@ -70,8 +70,8 @@ def list(
7070 :type resource_collection_name: str
7171 :param resource_name: The name of the virtual machine.
7272 :type resource_name: str
73- :param filter: Optionally filter by monitor name. Example: $filter=monitorName eq 'logical-
74- disks|C:|disk-free-space-mb.'.
73+ :param filter: Optionally filter by monitor name. Example: $filter=monitorName eq
74+ 'logical- disks|C:|disk-free-space-mb.'.
7575 :type filter: str
7676 :param expand: Optionally expand the monitor’s evidence and/or configuration. Example:
7777 $expand=evidence,configuration.
@@ -81,7 +81,7 @@ def list(
8181 :rtype: ~azure.core.async_paging.AsyncItemPaged[~workload_monitor_api.models.HealthMonitorList]
8282 :raises: ~azure.core.exceptions.HttpResponseError
8383 """
84- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .HealthMonitorList"]
84+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .HealthMonitorList"]
8585 error_map = {
8686 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
8787 }
@@ -134,7 +134,7 @@ async def get_next(next_link=None):
134134 response = pipeline_response .http_response
135135
136136 if response .status_code not in [200 ]:
137- error = self ._deserialize ( models .ErrorResponse , response )
137+ error = self ._deserialize . failsafe_deserialize ( _models .ErrorResponse , response )
138138 map_error (status_code = response .status_code , response = response , error_map = error_map )
139139 raise HttpResponseError (response = response , model = error , error_format = ARMErrorFormat )
140140
@@ -154,8 +154,8 @@ async def get(
154154 resource_name : str ,
155155 monitor_id : str ,
156156 expand : Optional [str ] = None ,
157- ** kwargs
158- ) -> "models .HealthMonitor" :
157+ ** kwargs : Any
158+ ) -> "_models .HealthMonitor" :
159159 """Get the current health status of a monitor of a virtual machine. Optional parameter: $expand (retrieve the monitor's evidence and configuration).
160160
161161 Get the current health status of a monitor of a virtual machine. Optional parameter: $expand
@@ -182,7 +182,7 @@ async def get(
182182 :rtype: ~workload_monitor_api.models.HealthMonitor
183183 :raises: ~azure.core.exceptions.HttpResponseError
184184 """
185- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .HealthMonitor"]
185+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .HealthMonitor"]
186186 error_map = {
187187 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
188188 }
@@ -218,7 +218,7 @@ async def get(
218218
219219 if response .status_code not in [200 ]:
220220 map_error (status_code = response .status_code , response = response , error_map = error_map )
221- error = self ._deserialize ( models .ErrorResponse , response )
221+ error = self ._deserialize . failsafe_deserialize ( _models .ErrorResponse , response )
222222 raise HttpResponseError (response = response , model = error , error_format = ARMErrorFormat )
223223
224224 deserialized = self ._deserialize ('HealthMonitor' , pipeline_response )
@@ -241,8 +241,8 @@ def list_state_changes(
241241 expand : Optional [str ] = None ,
242242 start_timestamp_utc : Optional [datetime .datetime ] = None ,
243243 end_timestamp_utc : Optional [datetime .datetime ] = None ,
244- ** kwargs
245- ) -> AsyncIterable ["models .HealthMonitorStateChangeList" ]:
244+ ** kwargs : Any
245+ ) -> AsyncIterable ["_models .HealthMonitorStateChangeList" ]:
246246 """Get the health state changes of a monitor of a virtual machine within the provided time window (default is the last 24 hours). Optional parameters: $expand (retrieve the monitor's evidence and configuration) and $filter (filter by heartbeat condition).
247247
248248 Get the health state changes of a monitor of a virtual machine within the provided time window
@@ -276,7 +276,7 @@ def list_state_changes(
276276 :rtype: ~azure.core.async_paging.AsyncItemPaged[~workload_monitor_api.models.HealthMonitorStateChangeList]
277277 :raises: ~azure.core.exceptions.HttpResponseError
278278 """
279- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .HealthMonitorStateChangeList"]
279+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .HealthMonitorStateChangeList"]
280280 error_map = {
281281 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
282282 }
@@ -334,7 +334,7 @@ async def get_next(next_link=None):
334334 response = pipeline_response .http_response
335335
336336 if response .status_code not in [200 ]:
337- error = self ._deserialize ( models .ErrorResponse , response )
337+ error = self ._deserialize . failsafe_deserialize ( _models .ErrorResponse , response )
338338 map_error (status_code = response .status_code , response = response , error_map = error_map )
339339 raise HttpResponseError (response = response , model = error , error_format = ARMErrorFormat )
340340
@@ -355,8 +355,8 @@ async def get_state_change(
355355 monitor_id : str ,
356356 timestamp_unix : str ,
357357 expand : Optional [str ] = None ,
358- ** kwargs
359- ) -> "models .HealthMonitorStateChange" :
358+ ** kwargs : Any
359+ ) -> "_models .HealthMonitorStateChange" :
360360 """Get the health state change of a monitor of a virtual machine at the provided timestamp. Optional parameter: $expand (retrieve the monitor's evidence and configuration).
361361
362362 Get the health state change of a monitor of a virtual machine at the provided timestamp.
@@ -385,7 +385,7 @@ async def get_state_change(
385385 :rtype: ~workload_monitor_api.models.HealthMonitorStateChange
386386 :raises: ~azure.core.exceptions.HttpResponseError
387387 """
388- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .HealthMonitorStateChange"]
388+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .HealthMonitorStateChange"]
389389 error_map = {
390390 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
391391 }
@@ -422,7 +422,7 @@ async def get_state_change(
422422
423423 if response .status_code not in [200 ]:
424424 map_error (status_code = response .status_code , response = response , error_map = error_map )
425- error = self ._deserialize ( models .ErrorResponse , response )
425+ error = self ._deserialize . failsafe_deserialize ( _models .ErrorResponse , response )
426426 raise HttpResponseError (response = response , model = error , error_format = ARMErrorFormat )
427427
428428 deserialized = self ._deserialize ('HealthMonitorStateChange' , pipeline_response )
0 commit comments