|
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,
|
|
50 | 51 | build_jobs_summary_request,
|
51 | 52 | build_jobs_unassign_bulk_jobs_sandboxes_request,
|
52 | 53 | build_jobs_unassign_job_sandboxes_request,
|
| 54 | + build_pilots_get_pilot_info_request, |
53 | 55 | build_well_known_get_installation_metadata_request,
|
54 | 56 | build_well_known_get_openid_configuration_request,
|
55 | 57 | )
|
@@ -823,6 +825,65 @@ async def complete_authorization_flow(
|
823 | 825 |
|
824 | 826 | return deserialized # type: ignore
|
825 | 827 |
|
| 828 | + @distributed_trace_async |
| 829 | + async def pilot_login( |
| 830 | + self, *, pilot_id: int, pilot_secret: str, **kwargs: Any |
| 831 | + ) -> Any: |
| 832 | + """Pilot Login. |
| 833 | +
|
| 834 | + Endpoint without policy, the pilot uses only its secret. |
| 835 | +
|
| 836 | + :keyword pilot_id: Required. |
| 837 | + :paramtype pilot_id: int |
| 838 | + :keyword pilot_secret: Required. |
| 839 | + :paramtype pilot_secret: str |
| 840 | + :return: any |
| 841 | + :rtype: any |
| 842 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 843 | + """ |
| 844 | + error_map: MutableMapping = { |
| 845 | + 401: ClientAuthenticationError, |
| 846 | + 404: ResourceNotFoundError, |
| 847 | + 409: ResourceExistsError, |
| 848 | + 304: ResourceNotModifiedError, |
| 849 | + } |
| 850 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 851 | + |
| 852 | + _headers = kwargs.pop("headers", {}) or {} |
| 853 | + _params = kwargs.pop("params", {}) or {} |
| 854 | + |
| 855 | + cls: ClsType[Any] = kwargs.pop("cls", None) |
| 856 | + |
| 857 | + _request = build_auth_pilot_login_request( |
| 858 | + pilot_id=pilot_id, |
| 859 | + pilot_secret=pilot_secret, |
| 860 | + headers=_headers, |
| 861 | + params=_params, |
| 862 | + ) |
| 863 | + _request.url = self._client.format_url(_request.url) |
| 864 | + |
| 865 | + _stream = False |
| 866 | + pipeline_response: PipelineResponse = ( |
| 867 | + await self._client._pipeline.run( # pylint: disable=protected-access |
| 868 | + _request, stream=_stream, **kwargs |
| 869 | + ) |
| 870 | + ) |
| 871 | + |
| 872 | + response = pipeline_response.http_response |
| 873 | + |
| 874 | + if response.status_code not in [200]: |
| 875 | + map_error( |
| 876 | + status_code=response.status_code, response=response, error_map=error_map |
| 877 | + ) |
| 878 | + raise HttpResponseError(response=response) |
| 879 | + |
| 880 | + deserialized = self._deserialize("object", pipeline_response.http_response) |
| 881 | + |
| 882 | + if cls: |
| 883 | + return cls(pipeline_response, deserialized, {}) # type: ignore |
| 884 | + |
| 885 | + return deserialized # type: ignore |
| 886 | + |
826 | 887 |
|
827 | 888 | class ConfigOperations:
|
828 | 889 | """
|
@@ -2156,3 +2217,82 @@ async def submit_jdl_jobs(
|
2156 | 2217 | return cls(pipeline_response, deserialized, {}) # type: ignore
|
2157 | 2218 |
|
2158 | 2219 | return deserialized # type: ignore
|
| 2220 | + |
| 2221 | + |
| 2222 | +class PilotsOperations: |
| 2223 | + """ |
| 2224 | + .. warning:: |
| 2225 | + **DO NOT** instantiate this class directly. |
| 2226 | +
|
| 2227 | + Instead, you should access the following operations through |
| 2228 | + :class:`~generated.aio.Dirac`'s |
| 2229 | + :attr:`pilots` attribute. |
| 2230 | + """ |
| 2231 | + |
| 2232 | + models = _models |
| 2233 | + |
| 2234 | + def __init__(self, *args, **kwargs) -> None: |
| 2235 | + input_args = list(args) |
| 2236 | + self._client: AsyncPipelineClient = ( |
| 2237 | + input_args.pop(0) if input_args else kwargs.pop("client") |
| 2238 | + ) |
| 2239 | + self._config: DiracConfiguration = ( |
| 2240 | + input_args.pop(0) if input_args else kwargs.pop("config") |
| 2241 | + ) |
| 2242 | + self._serialize: Serializer = ( |
| 2243 | + input_args.pop(0) if input_args else kwargs.pop("serializer") |
| 2244 | + ) |
| 2245 | + self._deserialize: Deserializer = ( |
| 2246 | + input_args.pop(0) if input_args else kwargs.pop("deserializer") |
| 2247 | + ) |
| 2248 | + |
| 2249 | + @distributed_trace_async |
| 2250 | + async def get_pilot_info(self, **kwargs: Any) -> Any: |
| 2251 | + """Get Pilot Info. |
| 2252 | +
|
| 2253 | + Get Pilot Info. |
| 2254 | +
|
| 2255 | + :return: any |
| 2256 | + :rtype: any |
| 2257 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 2258 | + """ |
| 2259 | + error_map: MutableMapping = { |
| 2260 | + 401: ClientAuthenticationError, |
| 2261 | + 404: ResourceNotFoundError, |
| 2262 | + 409: ResourceExistsError, |
| 2263 | + 304: ResourceNotModifiedError, |
| 2264 | + } |
| 2265 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 2266 | + |
| 2267 | + _headers = kwargs.pop("headers", {}) or {} |
| 2268 | + _params = kwargs.pop("params", {}) or {} |
| 2269 | + |
| 2270 | + cls: ClsType[Any] = kwargs.pop("cls", None) |
| 2271 | + |
| 2272 | + _request = build_pilots_get_pilot_info_request( |
| 2273 | + headers=_headers, |
| 2274 | + params=_params, |
| 2275 | + ) |
| 2276 | + _request.url = self._client.format_url(_request.url) |
| 2277 | + |
| 2278 | + _stream = False |
| 2279 | + pipeline_response: PipelineResponse = ( |
| 2280 | + await self._client._pipeline.run( # pylint: disable=protected-access |
| 2281 | + _request, stream=_stream, **kwargs |
| 2282 | + ) |
| 2283 | + ) |
| 2284 | + |
| 2285 | + response = pipeline_response.http_response |
| 2286 | + |
| 2287 | + if response.status_code not in [200]: |
| 2288 | + map_error( |
| 2289 | + status_code=response.status_code, response=response, error_map=error_map |
| 2290 | + ) |
| 2291 | + raise HttpResponseError(response=response) |
| 2292 | + |
| 2293 | + deserialized = self._deserialize("object", pipeline_response.http_response) |
| 2294 | + |
| 2295 | + if cls: |
| 2296 | + return cls(pipeline_response, deserialized, {}) # type: ignore |
| 2297 | + |
| 2298 | + return deserialized # type: ignore |
0 commit comments