1515from azure .core .rest import HttpRequest
1616from azure .core .tracing .decorator import distributed_trace
1717from azure .core .tracing .decorator_async import distributed_trace_async
18+ from azure .core .utils import case_insensitive_dict
1819from azure .mgmt .core .exceptions import ARMErrorFormat
1920
2021from ... import models as _models
2425ClsType = Optional [Callable [[PipelineResponse [HttpRequest , AsyncHttpResponse ], T , Dict [str , Any ]], Any ]]
2526
2627class AvailableGroundStationsOperations :
27- """AvailableGroundStationsOperations async operations.
28-
29- You should not instantiate this class directly. Instead, you should create a Client instance that
30- instantiates it for you and attaches it as an attribute.
28+ """
29+ .. warning::
30+ **DO NOT** instantiate this class directly.
3131
32- :ivar models: Alias to model classes used in this operation group.
33- :type models: ~azure.mgmt.orbital.models
34- :param client: Client for service requests.
35- :param config: Configuration of service client.
36- :param serializer: An object model serializer.
37- :param deserializer: An object model deserializer.
32+ Instead, you should access the following operations through
33+ :class:`~azure.mgmt.orbital.aio.AzureOrbital`'s
34+ :attr:`available_ground_stations` attribute.
3835 """
3936
4037 models = _models
4138
42- def __init__ (self , client , config , serializer , deserializer ) -> None :
43- self ._client = client
44- self ._serialize = serializer
45- self ._deserialize = deserializer
46- self ._config = config
39+ def __init__ (self , * args , ** kwargs ) -> None :
40+ input_args = list (args )
41+ self ._client = input_args .pop (0 ) if input_args else kwargs .pop ("client" )
42+ self ._config = input_args .pop (0 ) if input_args else kwargs .pop ("config" )
43+ self ._serialize = input_args .pop (0 ) if input_args else kwargs .pop ("serializer" )
44+ self ._deserialize = input_args .pop (0 ) if input_args else kwargs .pop ("deserializer" )
45+
4746
4847 @distributed_trace
4948 def list_by_capability (
5049 self ,
5150 capability : Union [str , "_models.CapabilityParameter" ] = "EarthObservation" ,
5251 ** kwargs : Any
53- ) -> AsyncIterable [" _models.AvailableGroundStationListResult" ]:
52+ ) -> AsyncIterable [_models .AvailableGroundStationListResult ]:
5453 """Returns list of available ground stations.
5554
5655 :param capability: Ground Station Capability. Default value is "EarthObservation".
@@ -62,13 +61,16 @@ def list_by_capability(
6261 ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.orbital.models.AvailableGroundStationListResult]
6362 :raises: ~azure.core.exceptions.HttpResponseError
6463 """
65- api_version = kwargs .pop ('api_version' , "2022-03-01" ) # type: str
64+ _headers = kwargs .pop ("headers" , {}) or {}
65+ _params = case_insensitive_dict (kwargs .pop ("params" , {}) or {})
66+
67+ api_version = kwargs .pop ('api_version' , _params .pop ('api-version' , "2022-03-01" )) # type: str
68+ cls = kwargs .pop ('cls' , None ) # type: ClsType[_models.AvailableGroundStationListResult]
6669
67- cls = kwargs .pop ('cls' , None ) # type: ClsType["_models.AvailableGroundStationListResult"]
6870 error_map = {
6971 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
7072 }
71- error_map .update (kwargs .pop ('error_map' , {}))
73+ error_map .update (kwargs .pop ('error_map' , {}) or {} )
7274 def prepare_request (next_link = None ):
7375 if not next_link :
7476
@@ -77,9 +79,11 @@ def prepare_request(next_link=None):
7779 api_version = api_version ,
7880 capability = capability ,
7981 template_url = self .list_by_capability .metadata ['url' ],
82+ headers = _headers ,
83+ params = _params ,
8084 )
8185 request = _convert_request (request )
82- request .url = self ._client .format_url (request .url )
86+ request .url = self ._client .format_url (request .url ) # type: ignore
8387
8488 else :
8589
@@ -88,9 +92,11 @@ def prepare_request(next_link=None):
8892 api_version = api_version ,
8993 capability = capability ,
9094 template_url = next_link ,
95+ headers = _headers ,
96+ params = _params ,
9197 )
9298 request = _convert_request (request )
93- request .url = self ._client .format_url (request .url )
99+ request .url = self ._client .format_url (request .url ) # type: ignore
94100 request .method = "GET"
95101 return request
96102
@@ -128,8 +134,8 @@ async def get(
128134 self ,
129135 ground_station_name : str ,
130136 ** kwargs : Any
131- ) -> " _models.AvailableGroundStation" :
132- """Gets the specified available ground station.
137+ ) -> _models .AvailableGroundStation :
138+ """Gets the specified available ground station.
133139
134140 :param ground_station_name: Ground Station name.
135141 :type ground_station_name: str
@@ -138,25 +144,30 @@ async def get(
138144 :rtype: ~azure.mgmt.orbital.models.AvailableGroundStation
139145 :raises: ~azure.core.exceptions.HttpResponseError
140146 """
141- cls = kwargs .pop ('cls' , None ) # type: ClsType["_models.AvailableGroundStation"]
142147 error_map = {
143148 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
144149 }
145- error_map .update (kwargs .pop ('error_map' , {}))
150+ error_map .update (kwargs .pop ('error_map' , {}) or {})
151+
152+ _headers = kwargs .pop ("headers" , {}) or {}
153+ _params = case_insensitive_dict (kwargs .pop ("params" , {}) or {})
146154
147- api_version = kwargs .pop ('api_version' , "2022-03-01" ) # type: str
155+ api_version = kwargs .pop ('api_version' , _params .pop ('api-version' , "2022-03-01" )) # type: str
156+ cls = kwargs .pop ('cls' , None ) # type: ClsType[_models.AvailableGroundStation]
148157
149158
150159 request = build_get_request (
151160 subscription_id = self ._config .subscription_id ,
152161 ground_station_name = ground_station_name ,
153162 api_version = api_version ,
154163 template_url = self .get .metadata ['url' ],
164+ headers = _headers ,
165+ params = _params ,
155166 )
156167 request = _convert_request (request )
157- request .url = self ._client .format_url (request .url )
168+ request .url = self ._client .format_url (request .url ) # type: ignore
158169
159- pipeline_response = await self ._client ._pipeline .run ( # pylint: disable=protected-access
170+ pipeline_response = await self ._client ._pipeline .run ( # type: ignore # pylint: disable=protected-access
160171 request ,
161172 stream = False ,
162173 ** kwargs
0 commit comments