Skip to content

Commit 536c2a5

Browse files
fix: Generating gubbins client
1 parent 37a0f5f commit 536c2a5

File tree

6 files changed

+333
-0
lines changed

6 files changed

+333
-0
lines changed

extensions/gubbins/gubbins-client/src/gubbins/client/generated/_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
ConfigOperations,
2121
JobsOperations,
2222
LollygagOperations,
23+
PilotsOperations,
2324
WellKnownOperations,
2425
)
2526

@@ -37,6 +38,8 @@ class Dirac: # pylint: disable=client-accepts-api-version-keyword
3738
:vartype jobs: generated.operations.JobsOperations
3839
:ivar lollygag: LollygagOperations operations
3940
:vartype lollygag: generated.operations.LollygagOperations
41+
:ivar pilots: PilotsOperations operations
42+
:vartype pilots: generated.operations.PilotsOperations
4043
:keyword endpoint: Service URL. Required. Default value is "".
4144
:paramtype endpoint: str
4245
"""
@@ -91,6 +94,9 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
9194
self.lollygag = LollygagOperations(
9295
self._client, self._config, self._serialize, self._deserialize
9396
)
97+
self.pilots = PilotsOperations(
98+
self._client, self._config, self._serialize, self._deserialize
99+
)
94100

95101
def send_request(
96102
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any

extensions/gubbins/gubbins-client/src/gubbins/client/generated/aio/_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
ConfigOperations,
2121
JobsOperations,
2222
LollygagOperations,
23+
PilotsOperations,
2324
WellKnownOperations,
2425
)
2526

@@ -37,6 +38,8 @@ class Dirac: # pylint: disable=client-accepts-api-version-keyword
3738
:vartype jobs: generated.aio.operations.JobsOperations
3839
:ivar lollygag: LollygagOperations operations
3940
:vartype lollygag: generated.aio.operations.LollygagOperations
41+
:ivar pilots: PilotsOperations operations
42+
:vartype pilots: generated.aio.operations.PilotsOperations
4043
:keyword endpoint: Service URL. Required. Default value is "".
4144
:paramtype endpoint: str
4245
"""
@@ -91,6 +94,9 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
9194
self.lollygag = LollygagOperations(
9295
self._client, self._config, self._serialize, self._deserialize
9396
)
97+
self.pilots = PilotsOperations(
98+
self._client, self._config, self._serialize, self._deserialize
99+
)
94100

95101
def send_request(
96102
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any

extensions/gubbins/gubbins-client/src/gubbins/client/generated/aio/operations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from ._operations import ConfigOperations # type: ignore
1616
from ._operations import JobsOperations # type: ignore
1717
from ._operations import LollygagOperations # type: ignore
18+
from ._operations import PilotsOperations # type: ignore
1819

1920
from ._patch import __all__ as _patch_all
2021
from ._patch import *
@@ -26,6 +27,7 @@
2627
"ConfigOperations",
2728
"JobsOperations",
2829
"LollygagOperations",
30+
"PilotsOperations",
2931
]
3032
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
3133
_patch_sdk()

extensions/gubbins/gubbins-client/src/gubbins/client/generated/aio/operations/_operations.py

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
build_auth_get_refresh_tokens_request,
3434
build_auth_initiate_authorization_flow_request,
3535
build_auth_initiate_device_flow_request,
36+
build_auth_pilot_login_request,
3637
build_auth_revoke_refresh_token_request,
3738
build_auth_userinfo_request,
3839
build_config_serve_config_request,
@@ -53,6 +54,7 @@
5354
build_lollygag_get_gubbins_secrets_request,
5455
build_lollygag_get_owner_object_request,
5556
build_lollygag_insert_owner_object_request,
57+
build_pilots_get_pilot_info_request,
5658
build_well_known_get_installation_metadata_request,
5759
build_well_known_get_openid_configuration_request,
5860
)
@@ -830,6 +832,65 @@ async def complete_authorization_flow(
830832

831833
return deserialized # type: ignore
832834

835+
@distributed_trace_async
836+
async def pilot_login(
837+
self, *, pilot_job_reference: str, pilot_secret: str, **kwargs: Any
838+
) -> Any:
839+
"""Pilot Login.
840+
841+
Endpoint without policy, the pilot uses only its secret.
842+
843+
:keyword pilot_job_reference: Required.
844+
:paramtype pilot_job_reference: str
845+
:keyword pilot_secret: Required.
846+
:paramtype pilot_secret: str
847+
:return: any
848+
:rtype: any
849+
:raises ~azure.core.exceptions.HttpResponseError:
850+
"""
851+
error_map: MutableMapping = {
852+
401: ClientAuthenticationError,
853+
404: ResourceNotFoundError,
854+
409: ResourceExistsError,
855+
304: ResourceNotModifiedError,
856+
}
857+
error_map.update(kwargs.pop("error_map", {}) or {})
858+
859+
_headers = kwargs.pop("headers", {}) or {}
860+
_params = kwargs.pop("params", {}) or {}
861+
862+
cls: ClsType[Any] = kwargs.pop("cls", None)
863+
864+
_request = build_auth_pilot_login_request(
865+
pilot_job_reference=pilot_job_reference,
866+
pilot_secret=pilot_secret,
867+
headers=_headers,
868+
params=_params,
869+
)
870+
_request.url = self._client.format_url(_request.url)
871+
872+
_stream = False
873+
pipeline_response: PipelineResponse = (
874+
await self._client._pipeline.run( # pylint: disable=protected-access
875+
_request, stream=_stream, **kwargs
876+
)
877+
)
878+
879+
response = pipeline_response.http_response
880+
881+
if response.status_code not in [200]:
882+
map_error(
883+
status_code=response.status_code, response=response, error_map=error_map
884+
)
885+
raise HttpResponseError(response=response)
886+
887+
deserialized = self._deserialize("object", pipeline_response.http_response)
888+
889+
if cls:
890+
return cls(pipeline_response, deserialized, {}) # type: ignore
891+
892+
return deserialized # type: ignore
893+
833894

834895
class ConfigOperations:
835896
"""
@@ -2347,3 +2408,82 @@ async def get_gubbins_secrets(self, **kwargs: Any) -> Any:
23472408
return cls(pipeline_response, deserialized, {}) # type: ignore
23482409

23492410
return deserialized # type: ignore
2411+
2412+
2413+
class PilotsOperations:
2414+
"""
2415+
.. warning::
2416+
**DO NOT** instantiate this class directly.
2417+
2418+
Instead, you should access the following operations through
2419+
:class:`~generated.aio.Dirac`'s
2420+
:attr:`pilots` attribute.
2421+
"""
2422+
2423+
models = _models
2424+
2425+
def __init__(self, *args, **kwargs) -> None:
2426+
input_args = list(args)
2427+
self._client: AsyncPipelineClient = (
2428+
input_args.pop(0) if input_args else kwargs.pop("client")
2429+
)
2430+
self._config: DiracConfiguration = (
2431+
input_args.pop(0) if input_args else kwargs.pop("config")
2432+
)
2433+
self._serialize: Serializer = (
2434+
input_args.pop(0) if input_args else kwargs.pop("serializer")
2435+
)
2436+
self._deserialize: Deserializer = (
2437+
input_args.pop(0) if input_args else kwargs.pop("deserializer")
2438+
)
2439+
2440+
@distributed_trace_async
2441+
async def get_pilot_info(self, **kwargs: Any) -> Any:
2442+
"""Get Pilot Info.
2443+
2444+
Get Pilot Info.
2445+
2446+
:return: any
2447+
:rtype: any
2448+
:raises ~azure.core.exceptions.HttpResponseError:
2449+
"""
2450+
error_map: MutableMapping = {
2451+
401: ClientAuthenticationError,
2452+
404: ResourceNotFoundError,
2453+
409: ResourceExistsError,
2454+
304: ResourceNotModifiedError,
2455+
}
2456+
error_map.update(kwargs.pop("error_map", {}) or {})
2457+
2458+
_headers = kwargs.pop("headers", {}) or {}
2459+
_params = kwargs.pop("params", {}) or {}
2460+
2461+
cls: ClsType[Any] = kwargs.pop("cls", None)
2462+
2463+
_request = build_pilots_get_pilot_info_request(
2464+
headers=_headers,
2465+
params=_params,
2466+
)
2467+
_request.url = self._client.format_url(_request.url)
2468+
2469+
_stream = False
2470+
pipeline_response: PipelineResponse = (
2471+
await self._client._pipeline.run( # pylint: disable=protected-access
2472+
_request, stream=_stream, **kwargs
2473+
)
2474+
)
2475+
2476+
response = pipeline_response.http_response
2477+
2478+
if response.status_code not in [200]:
2479+
map_error(
2480+
status_code=response.status_code, response=response, error_map=error_map
2481+
)
2482+
raise HttpResponseError(response=response)
2483+
2484+
deserialized = self._deserialize("object", pipeline_response.http_response)
2485+
2486+
if cls:
2487+
return cls(pipeline_response, deserialized, {}) # type: ignore
2488+
2489+
return deserialized # type: ignore

extensions/gubbins/gubbins-client/src/gubbins/client/generated/operations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from ._operations import ConfigOperations # type: ignore
1616
from ._operations import JobsOperations # type: ignore
1717
from ._operations import LollygagOperations # type: ignore
18+
from ._operations import PilotsOperations # type: ignore
1819

1920
from ._patch import __all__ as _patch_all
2021
from ._patch import *
@@ -26,6 +27,7 @@
2627
"ConfigOperations",
2728
"JobsOperations",
2829
"LollygagOperations",
30+
"PilotsOperations",
2931
]
3032
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
3133
_patch_sdk()

0 commit comments

Comments
 (0)