66# --------------------------------------------------------------------------
77
88
9- from typing import TYPE_CHECKING , Any , Callable , Union
9+ from typing import Any , Callable , Union
1010
1111from azure .core .credentials import AccessToken , AzureKeyCredential
1212from azure .core .paging import ItemPaged
1313from azure .core .pipeline .policies import BearerTokenCredentialPolicy
1414from azure .core .polling import LROPoller
1515from azure .core .tracing .decorator import distributed_trace
16+ from azure .core .credentials import TokenCredential
1617
1718from ._api_version import validate_api_version , DEFAULT_VERSION
1819from ._generated import RemoteRenderingRestClient
3233from ._shared .static_access_token_credential import StaticAccessTokenCredential
3334from ._version import SDK_MONIKER
3435
35- if TYPE_CHECKING :
36- from azure .core .credentials import TokenCredential
37-
38- # pylint: disable=unsubscriptable-object
39-
40-
4136class RemoteRenderingClient :
4237 """A client for the Azure Remote Rendering Service.
4338
@@ -126,8 +121,11 @@ def __init__(self,
126121 ** kwargs )
127122
128123 @distributed_trace
129- def begin_asset_conversion (self , conversion_id , input_settings , output_settings , ** kwargs ):
130- # type: (str, AssetConversionInputSettings, AssetConversionOutputSettings, Any) -> LROPoller[AssetConversion]
124+ def begin_asset_conversion (self ,
125+ conversion_id : str ,
126+ input_settings : AssetConversionInputSettings ,
127+ output_settings : AssetConversionOutputSettings ,
128+ ** kwargs ) -> LROPoller [AssetConversion ]:
131129 """
132130 Start a new asset conversion with the given options.
133131 :param str conversion_id:
@@ -161,8 +159,7 @@ def begin_asset_conversion(self, conversion_id, input_settings, output_settings,
161159 polling_method = polling_method )
162160
163161 @distributed_trace
164- def get_asset_conversion (self , conversion_id , ** kwargs ):
165- # type: (str, Any) -> AssetConversion
162+ def get_asset_conversion (self , conversion_id : str , ** kwargs ) -> AssetConversion :
166163 """
167164 Retrieve the state of a previously created conversion.
168165 :param str conversion_id:
@@ -175,23 +172,19 @@ def get_asset_conversion(self, conversion_id, **kwargs):
175172 account_id = self ._account_id , conversion_id = conversion_id , ** kwargs )
176173
177174 @distributed_trace
178- def get_asset_conversion_poller (self , ** kwargs ):
179- # type: (Any) -> LROPoller[AssetConversion]
175+ def get_asset_conversion_poller (self , ** kwargs ) -> LROPoller [AssetConversion ]: # pylint:disable=docstring-keyword-should-match-keyword-only
180176 """
181177 Returns a poller for an existing conversion by conversion id or a continuation token retrieved from a previous
182178 poller.
183- :keyword conversion_id: The conversion id of a previously created conversion.
184- :paramtype conversion_id: str
185- :keyword continuation_token:
186- A continuation token retrieved from a poller of a conversion.
187- :paramtype continuation_token: str
179+ :keyword str conversion_id: The conversion_id of a previously created conversion.
180+ :keyword str continuation_token: A continuation token retrieved from a poller of a conversion.
188181 :return: A poller for the created asset conversion
189182 :rtype: ~azure.core.polling.LROPoller[AssetConversion]
190183 :raises ~azure.core.exceptions.HttpResponseError:
191184 """
192185
193- conversion_id = kwargs .pop ("conversion_id" , None ) # type: Union[str,None]
194- continuation_token = kwargs .pop ("continuation_token" , None ) # type: Union[str,None]
186+ conversion_id : Union [ str , None ] = kwargs .pop ("conversion_id" , None )
187+ continuation_token : Union [ str , None ] = kwargs .pop ("continuation_token" , None )
195188
196189 if conversion_id is None and continuation_token is None :
197190 raise ValueError (
@@ -222,18 +215,20 @@ def get_asset_conversion_poller(self, **kwargs):
222215 polling_method = polling_method )
223216
224217 @distributed_trace
225- def list_asset_conversions (self , ** kwargs ):
226- # type: (...) -> ItemPaged[AssetConversion]
218+ def list_asset_conversions (self , ** kwargs ) -> ItemPaged [AssetConversion ]:
227219 """ Returns list of conversions for the remote rendering account.
228220 :rtype: ItemPaged[AssetConversion]
229221 :raises ~azure.core.exceptions.HttpResponseError:
230222 :return: List of conversion for the remote rendering account.
231223 """
232- return self ._client .remote_rendering .list_conversions (account_id = self ._account_id , ** kwargs ) # type: ignore
224+ return self ._client .remote_rendering .list_conversions (account_id = self ._account_id , ** kwargs ) # type: ignore
233225
234226 @distributed_trace
235- def begin_rendering_session (self , session_id , size , lease_time_minutes , ** kwargs ):
236- # type: (str, Union[str, RenderingSessionSize], int, Any) -> LROPoller[RenderingSession]
227+ def begin_rendering_session (self ,
228+ session_id : str ,
229+ size : Union [str , RenderingSessionSize ],
230+ lease_time_minutes : int ,
231+ ** kwargs ) -> LROPoller [RenderingSession ]:
237232 """
238233 :param str session_id: An ID uniquely identifying the rendering session for the given account. The ID is case
239234 sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and
@@ -263,8 +258,7 @@ def begin_rendering_session(self, session_id, size, lease_time_minutes, **kwargs
263258 polling_method = polling_method )
264259
265260 @distributed_trace
266- def get_rendering_session (self , session_id , ** kwargs ):
267- # type: (str, Any) -> RenderingSession
261+ def get_rendering_session (self , session_id : str , ** kwargs ) -> RenderingSession :
268262 '''
269263 Returns the properties of a previously generated rendering session.
270264 :param str session_id: The identifier of the rendering session.
@@ -278,23 +272,19 @@ def get_rendering_session(self, session_id, **kwargs):
278272 ** kwargs )
279273
280274 @distributed_trace
281- def get_rendering_session_poller (self , ** kwargs ):
282- # type: (Any) -> LROPoller[RenderingSession]
275+ def get_rendering_session_poller (self , ** kwargs ) -> LROPoller [RenderingSession ]: # pylint:disable=docstring-keyword-should-match-keyword-only
283276 """
284277 Returns a poller for an existing rendering session by session id or a continuation token retrieved from a
285278 previous poller.
286- :keyword session_id: The conversion id of a previously created conversion.
287- :paramtype session_id: str
288- :keyword continuation_token:
289- A continuation token retrieved from a poller of a session.
290- :paramtype continuation_token: str
279+ :keyword str session_id: The conversion id of a previously created conversion.
280+ :keyword str continuation_token: A continuation token retrieved from a poller of a session.
291281 :return: A session poller for the given session
292282 :rtype: LROPoller[RenderingSession]
293283 :raises ~azure.core.exceptions.HttpResponseError:
294284 """
295285
296- session_id = kwargs .pop ("session_id" , None ) # type: Union[str,None]
297- continuation_token = kwargs .pop ("continuation_token" , None ) # type: Union[str,None]
286+ session_id : Union [ str , None ] = kwargs .pop ("session_id" , None )
287+ continuation_token : Union [ str , None ] = kwargs .pop ("continuation_token" , None )
298288
299289 if session_id is None and continuation_token is None :
300290 raise ValueError (
@@ -325,8 +315,7 @@ def get_rendering_session_poller(self, **kwargs):
325315 polling_method = polling_method )
326316
327317 @distributed_trace
328- def stop_rendering_session (self , session_id , ** kwargs ):
329- # type: (str, Any) -> None
318+ def stop_rendering_session (self , session_id : str , ** kwargs ) -> None :
330319 """
331320 :param str session_id: The identifier of the session to be stopped.
332321 :return: None
@@ -337,20 +326,18 @@ def stop_rendering_session(self, session_id, **kwargs):
337326 account_id = self ._account_id , session_id = session_id , ** kwargs )
338327
339328 @distributed_trace
340- def update_rendering_session (self , session_id , ** kwargs ):
341- # type: (str, Any) -> RenderingSession
329+ def update_rendering_session (self , session_id : str , ** kwargs ) -> RenderingSession : # pylint:disable=docstring-keyword-should-match-keyword-only
342330 """
343331 Updates an already existing rendering session.
344332 :param str session_id: The identifier of the session to be updated.
345- :keyword lease_time_minutes: The new lease time of the rendering session. Has to be strictly larger than
333+ :keyword int lease_time_minutes: The new lease time of the rendering session. Has to be strictly larger than
346334 the previous lease time.
347- :paramtype lease_time_minutes: int
348335 :return: The properties of the updated session
349336 :rtype: ~azure.mixedreality.remoterendering.models.RenderingSession
350337 :raises ~azure.core.exceptions.HttpResponseError:
351338 """
352339
353- lease_time_minutes = kwargs .pop ("lease_time_minutes" , None ) # type: Union[int,None]
340+ lease_time_minutes : Union [ int , None ] = kwargs .pop ("lease_time_minutes" , None )
354341 if lease_time_minutes is not None :
355342 return self ._client .remote_rendering .update_session (account_id = self ._account_id ,
356343 session_id = session_id ,
@@ -364,8 +351,7 @@ def update_rendering_session(self, session_id, **kwargs):
364351 ** kwargs )
365352
366353 @distributed_trace
367- def list_rendering_sessions (self , ** kwargs ):
368- # type: (...) -> ItemPaged[RenderingSession]
354+ def list_rendering_sessions (self , ** kwargs ) -> ItemPaged [RenderingSession ]:
369355 """
370356 Returns list of rendering sessions in the 'Ready' or 'Starting' state.
371357 Does not return stopped or failed rendering sessions.
@@ -375,15 +361,12 @@ def list_rendering_sessions(self, **kwargs):
375361 """
376362 return self ._client .remote_rendering .list_sessions (account_id = self ._account_id , ** kwargs ) # type: ignore
377363
378- def close (self ):
379- # type: () -> None
364+ def close (self ) -> None :
380365 self ._client .close ()
381366
382- def __enter__ (self ):
383- # type: () -> RemoteRenderingClient
367+ def __enter__ (self ) -> "RemoteRenderingClient" :
384368 self ._client .__enter__ () # pylint:disable=no-member
385369 return self
386370
387- def __exit__ (self , * args ):
388- # type: (*Any) -> None
371+ def __exit__ (self , * args : Any ) -> None :
389372 self ._client .__exit__ (* args ) # pylint:disable=no-member
0 commit comments