Skip to content

Commit bdeadb5

Browse files
author
SDKAuto
committed
CodeGen from PR 19536 in Azure/azure-rest-api-specs
Merge fc48db0a6b6ad3caf878829aaf58e3d461b5610c into 93207d1a3cbabfd418273f4a6ace1f4984b138e5
1 parent 0ea015b commit bdeadb5

27 files changed

+1721
-1213
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.13.0",
4+
"@autorest/python@5.16.0",
55
"@autorest/[email protected]"
66
],
7-
"commit": "5ee062ac3cc2df298ff47bdfc7792d257fd85bb8",
7+
"commit": "c1adb64e795ccbf8473aff7afaa9290098e536c5",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/orbital/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/[email protected] --version=3.7.2",
9+
"autorest_command": "autorest specification/orbital/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/[email protected] --version=3.7.2",
1010
"readme": "specification/orbital/resource-manager/readme.md"
1111
}

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13+
14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
1320
__all__ = ['AzureOrbital']
21+
__all__.extend([p for p in _patch_all if p not in __all__])
1422

15-
# `._patch.py` is used for handwritten extensions to the generated code
16-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17-
from ._patch import patch_sdk
18-
patch_sdk()
23+
_patch_sdk()

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/_azure_orbital.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,24 @@ def __init__(
6565
self._serialize = Serializer(client_models)
6666
self._deserialize = Deserializer(client_models)
6767
self._serialize.client_side_validation = False
68-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
69-
self.spacecrafts = SpacecraftsOperations(self._client, self._config, self._serialize, self._deserialize)
70-
self.contacts = ContactsOperations(self._client, self._config, self._serialize, self._deserialize)
71-
self.contact_profiles = ContactProfilesOperations(self._client, self._config, self._serialize, self._deserialize)
72-
self.available_ground_stations = AvailableGroundStationsOperations(self._client, self._config, self._serialize, self._deserialize)
73-
self.operations_results = OperationsResultsOperations(self._client, self._config, self._serialize, self._deserialize)
68+
self.operations = Operations(
69+
self._client, self._config, self._serialize, self._deserialize
70+
)
71+
self.spacecrafts = SpacecraftsOperations(
72+
self._client, self._config, self._serialize, self._deserialize
73+
)
74+
self.contacts = ContactsOperations(
75+
self._client, self._config, self._serialize, self._deserialize
76+
)
77+
self.contact_profiles = ContactProfilesOperations(
78+
self._client, self._config, self._serialize, self._deserialize
79+
)
80+
self.available_ground_stations = AvailableGroundStationsOperations(
81+
self._client, self._config, self._serialize, self._deserialize
82+
)
83+
self.operations_results = OperationsResultsOperations(
84+
self._client, self._config, self._serialize, self._deserialize
85+
)
7486

7587

7688
def _send_request(

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/_metadata.json

Lines changed: 0 additions & 107 deletions
This file was deleted.

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0"
9+
VERSION = "1.0.0b1"

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/aio/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
# --------------------------------------------------------------------------
88

99
from ._azure_orbital import AzureOrbital
10+
11+
try:
12+
from ._patch import __all__ as _patch_all
13+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
14+
except ImportError:
15+
_patch_all = []
16+
from ._patch import patch_sdk as _patch_sdk
1017
__all__ = ['AzureOrbital']
18+
__all__.extend([p for p in _patch_all if p not in __all__])
1119

12-
# `._patch.py` is used for handwritten extensions to the generated code
13-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
14-
from ._patch import patch_sdk
15-
patch_sdk()
20+
_patch_sdk()

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/aio/_azure_orbital.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,24 @@ def __init__(
6565
self._serialize = Serializer(client_models)
6666
self._deserialize = Deserializer(client_models)
6767
self._serialize.client_side_validation = False
68-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
69-
self.spacecrafts = SpacecraftsOperations(self._client, self._config, self._serialize, self._deserialize)
70-
self.contacts = ContactsOperations(self._client, self._config, self._serialize, self._deserialize)
71-
self.contact_profiles = ContactProfilesOperations(self._client, self._config, self._serialize, self._deserialize)
72-
self.available_ground_stations = AvailableGroundStationsOperations(self._client, self._config, self._serialize, self._deserialize)
73-
self.operations_results = OperationsResultsOperations(self._client, self._config, self._serialize, self._deserialize)
68+
self.operations = Operations(
69+
self._client, self._config, self._serialize, self._deserialize
70+
)
71+
self.spacecrafts = SpacecraftsOperations(
72+
self._client, self._config, self._serialize, self._deserialize
73+
)
74+
self.contacts = ContactsOperations(
75+
self._client, self._config, self._serialize, self._deserialize
76+
)
77+
self.contact_profiles = ContactProfilesOperations(
78+
self._client, self._config, self._serialize, self._deserialize
79+
)
80+
self.available_ground_stations = AvailableGroundStationsOperations(
81+
self._client, self._config, self._serialize, self._deserialize
82+
)
83+
self.operations_results = OperationsResultsOperations(
84+
self._client, self._config, self._serialize, self._deserialize
85+
)
7486

7587

7688
def _send_request(

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/aio/operations/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
from ._available_ground_stations_operations import AvailableGroundStationsOperations
1414
from ._operations_results_operations import OperationsResultsOperations
1515

16+
from ._patch import __all__ as _patch_all
17+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
18+
from ._patch import patch_sdk as _patch_sdk
1619
__all__ = [
1720
'Operations',
1821
'SpacecraftsOperations',
@@ -21,3 +24,5 @@
2124
'AvailableGroundStationsOperations',
2225
'OperationsResultsOperations',
2326
]
27+
__all__.extend([p for p in _patch_all if p not in __all__])
28+
_patch_sdk()

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/aio/operations/_available_ground_stations_operations.py

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from azure.core.rest import HttpRequest
1616
from azure.core.tracing.decorator import distributed_trace
1717
from azure.core.tracing.decorator_async import distributed_trace_async
18+
from azure.core.utils import case_insensitive_dict
1819
from azure.mgmt.core.exceptions import ARMErrorFormat
1920

2021
from ... import models as _models
@@ -24,33 +25,31 @@
2425
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
2526

2627
class 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

Comments
 (0)