|
33 | 33 | build_auth_get_refresh_tokens_request,
|
34 | 34 | build_auth_initiate_authorization_flow_request,
|
35 | 35 | build_auth_initiate_device_flow_request,
|
| 36 | + build_auth_pilot_login_request, |
36 | 37 | build_auth_revoke_refresh_token_request,
|
37 | 38 | build_auth_userinfo_request,
|
38 | 39 | build_config_serve_config_request,
|
|
53 | 54 | build_lollygag_get_gubbins_secrets_request,
|
54 | 55 | build_lollygag_get_owner_object_request,
|
55 | 56 | build_lollygag_insert_owner_object_request,
|
| 57 | + build_pilots_get_pilot_info_request, |
56 | 58 | build_well_known_get_installation_metadata_request,
|
57 | 59 | build_well_known_get_openid_configuration_request,
|
58 | 60 | )
|
@@ -830,6 +832,65 @@ async def complete_authorization_flow(
|
830 | 832 |
|
831 | 833 | return deserialized # type: ignore
|
832 | 834 |
|
| 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 | + |
833 | 894 |
|
834 | 895 | class ConfigOperations:
|
835 | 896 | """
|
@@ -2347,3 +2408,82 @@ async def get_gubbins_secrets(self, **kwargs: Any) -> Any:
|
2347 | 2408 | return cls(pipeline_response, deserialized, {}) # type: ignore
|
2348 | 2409 |
|
2349 | 2410 | 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 |
0 commit comments