|
58 | 58 | build_pilots_create_pilot_secrets_request,
|
59 | 59 | build_pilots_delete_pilots_request,
|
60 | 60 | build_pilots_get_pilot_jobs_request,
|
| 61 | + build_pilots_internal_send_message_request, |
61 | 62 | build_pilots_internal_userinfo_request,
|
| 63 | + build_pilots_search_logs_request, |
62 | 64 | build_pilots_search_request,
|
63 | 65 | build_pilots_summary_request,
|
64 | 66 | build_pilots_update_pilot_fields_request,
|
@@ -3255,6 +3257,143 @@ async def search(
|
3255 | 3257 |
|
3256 | 3258 | return deserialized # type: ignore
|
3257 | 3259 |
|
| 3260 | + @overload |
| 3261 | + async def search_logs( |
| 3262 | + self, |
| 3263 | + body: Optional[_models.SearchParams] = None, |
| 3264 | + *, |
| 3265 | + page: int = 1, |
| 3266 | + per_page: int = 100, |
| 3267 | + content_type: str = "application/json", |
| 3268 | + **kwargs: Any |
| 3269 | + ) -> List[Dict[str, Any]]: |
| 3270 | + """Search Logs. |
| 3271 | +
|
| 3272 | + Search Logs. |
| 3273 | +
|
| 3274 | + :param body: Default value is None. |
| 3275 | + :type body: ~_generated.models.SearchParams |
| 3276 | + :keyword page: Default value is 1. |
| 3277 | + :paramtype page: int |
| 3278 | + :keyword per_page: Default value is 100. |
| 3279 | + :paramtype per_page: int |
| 3280 | + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. |
| 3281 | + Default value is "application/json". |
| 3282 | + :paramtype content_type: str |
| 3283 | + :return: list of dict mapping str to any |
| 3284 | + :rtype: list[dict[str, any]] |
| 3285 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3286 | + """ |
| 3287 | + |
| 3288 | + @overload |
| 3289 | + async def search_logs( |
| 3290 | + self, |
| 3291 | + body: Optional[IO[bytes]] = None, |
| 3292 | + *, |
| 3293 | + page: int = 1, |
| 3294 | + per_page: int = 100, |
| 3295 | + content_type: str = "application/json", |
| 3296 | + **kwargs: Any |
| 3297 | + ) -> List[Dict[str, Any]]: |
| 3298 | + """Search Logs. |
| 3299 | +
|
| 3300 | + Search Logs. |
| 3301 | +
|
| 3302 | + :param body: Default value is None. |
| 3303 | + :type body: IO[bytes] |
| 3304 | + :keyword page: Default value is 1. |
| 3305 | + :paramtype page: int |
| 3306 | + :keyword per_page: Default value is 100. |
| 3307 | + :paramtype per_page: int |
| 3308 | + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. |
| 3309 | + Default value is "application/json". |
| 3310 | + :paramtype content_type: str |
| 3311 | + :return: list of dict mapping str to any |
| 3312 | + :rtype: list[dict[str, any]] |
| 3313 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3314 | + """ |
| 3315 | + |
| 3316 | + @distributed_trace_async |
| 3317 | + async def search_logs( |
| 3318 | + self, |
| 3319 | + body: Optional[Union[_models.SearchParams, IO[bytes]]] = None, |
| 3320 | + *, |
| 3321 | + page: int = 1, |
| 3322 | + per_page: int = 100, |
| 3323 | + **kwargs: Any |
| 3324 | + ) -> List[Dict[str, Any]]: |
| 3325 | + """Search Logs. |
| 3326 | +
|
| 3327 | + Search Logs. |
| 3328 | +
|
| 3329 | + :param body: Is either a SearchParams type or a IO[bytes] type. Default value is None. |
| 3330 | + :type body: ~_generated.models.SearchParams or IO[bytes] |
| 3331 | + :keyword page: Default value is 1. |
| 3332 | + :paramtype page: int |
| 3333 | + :keyword per_page: Default value is 100. |
| 3334 | + :paramtype per_page: int |
| 3335 | + :return: list of dict mapping str to any |
| 3336 | + :rtype: list[dict[str, any]] |
| 3337 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3338 | + """ |
| 3339 | + error_map: MutableMapping = { |
| 3340 | + 401: ClientAuthenticationError, |
| 3341 | + 404: ResourceNotFoundError, |
| 3342 | + 409: ResourceExistsError, |
| 3343 | + 304: ResourceNotModifiedError, |
| 3344 | + } |
| 3345 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 3346 | + |
| 3347 | + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) |
| 3348 | + _params = kwargs.pop("params", {}) or {} |
| 3349 | + |
| 3350 | + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) |
| 3351 | + cls: ClsType[List[Dict[str, Any]]] = kwargs.pop("cls", None) |
| 3352 | + |
| 3353 | + content_type = content_type or "application/json" |
| 3354 | + _json = None |
| 3355 | + _content = None |
| 3356 | + if isinstance(body, (IOBase, bytes)): |
| 3357 | + _content = body |
| 3358 | + else: |
| 3359 | + if body is not None: |
| 3360 | + _json = self._serialize.body(body, "SearchParams") |
| 3361 | + else: |
| 3362 | + _json = None |
| 3363 | + |
| 3364 | + _request = build_pilots_search_logs_request( |
| 3365 | + page=page, |
| 3366 | + per_page=per_page, |
| 3367 | + content_type=content_type, |
| 3368 | + json=_json, |
| 3369 | + content=_content, |
| 3370 | + headers=_headers, |
| 3371 | + params=_params, |
| 3372 | + ) |
| 3373 | + _request.url = self._client.format_url(_request.url) |
| 3374 | + |
| 3375 | + _stream = False |
| 3376 | + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
| 3377 | + _request, stream=_stream, **kwargs |
| 3378 | + ) |
| 3379 | + |
| 3380 | + response = pipeline_response.http_response |
| 3381 | + |
| 3382 | + if response.status_code not in [200, 206]: |
| 3383 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
| 3384 | + raise HttpResponseError(response=response) |
| 3385 | + |
| 3386 | + response_headers = {} |
| 3387 | + if response.status_code == 206: |
| 3388 | + response_headers["Content-Range"] = self._deserialize("str", response.headers.get("Content-Range")) |
| 3389 | + |
| 3390 | + deserialized = self._deserialize("[{object}]", pipeline_response.http_response) |
| 3391 | + |
| 3392 | + if cls: |
| 3393 | + return cls(pipeline_response, deserialized, response_headers) # type: ignore |
| 3394 | + |
| 3395 | + return deserialized # type: ignore |
| 3396 | + |
3258 | 3397 | @overload
|
3259 | 3398 | async def summary(
|
3260 | 3399 | self, body: _models.SummaryParams, *, content_type: str = "application/json", **kwargs: Any
|
@@ -3419,3 +3558,119 @@ async def userinfo(self, *, authorization: Optional[str] = None, **kwargs: Any)
|
3419 | 3558 | return cls(pipeline_response, deserialized, {}) # type: ignore
|
3420 | 3559 |
|
3421 | 3560 | return deserialized # type: ignore
|
| 3561 | + |
| 3562 | + @overload |
| 3563 | + async def send_message( |
| 3564 | + self, |
| 3565 | + body: _models.BodyPilotsInternalSendMessage, |
| 3566 | + *, |
| 3567 | + authorization: Optional[str] = None, |
| 3568 | + content_type: str = "application/json", |
| 3569 | + **kwargs: Any |
| 3570 | + ) -> None: |
| 3571 | + """Send Message. |
| 3572 | +
|
| 3573 | + Send Message. |
| 3574 | +
|
| 3575 | + :param body: Required. |
| 3576 | + :type body: ~_generated.models.BodyPilotsInternalSendMessage |
| 3577 | + :keyword authorization: Default value is None. |
| 3578 | + :paramtype authorization: str |
| 3579 | + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. |
| 3580 | + Default value is "application/json". |
| 3581 | + :paramtype content_type: str |
| 3582 | + :return: None |
| 3583 | + :rtype: None |
| 3584 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3585 | + """ |
| 3586 | + |
| 3587 | + @overload |
| 3588 | + async def send_message( |
| 3589 | + self, |
| 3590 | + body: IO[bytes], |
| 3591 | + *, |
| 3592 | + authorization: Optional[str] = None, |
| 3593 | + content_type: str = "application/json", |
| 3594 | + **kwargs: Any |
| 3595 | + ) -> None: |
| 3596 | + """Send Message. |
| 3597 | +
|
| 3598 | + Send Message. |
| 3599 | +
|
| 3600 | + :param body: Required. |
| 3601 | + :type body: IO[bytes] |
| 3602 | + :keyword authorization: Default value is None. |
| 3603 | + :paramtype authorization: str |
| 3604 | + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. |
| 3605 | + Default value is "application/json". |
| 3606 | + :paramtype content_type: str |
| 3607 | + :return: None |
| 3608 | + :rtype: None |
| 3609 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3610 | + """ |
| 3611 | + |
| 3612 | + @distributed_trace_async |
| 3613 | + async def send_message( |
| 3614 | + self, |
| 3615 | + body: Union[_models.BodyPilotsInternalSendMessage, IO[bytes]], |
| 3616 | + *, |
| 3617 | + authorization: Optional[str] = None, |
| 3618 | + **kwargs: Any |
| 3619 | + ) -> None: |
| 3620 | + """Send Message. |
| 3621 | +
|
| 3622 | + Send Message. |
| 3623 | +
|
| 3624 | + :param body: Is either a BodyPilotsInternalSendMessage type or a IO[bytes] type. Required. |
| 3625 | + :type body: ~_generated.models.BodyPilotsInternalSendMessage or IO[bytes] |
| 3626 | + :keyword authorization: Default value is None. |
| 3627 | + :paramtype authorization: str |
| 3628 | + :return: None |
| 3629 | + :rtype: None |
| 3630 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3631 | + """ |
| 3632 | + error_map: MutableMapping = { |
| 3633 | + 401: ClientAuthenticationError, |
| 3634 | + 404: ResourceNotFoundError, |
| 3635 | + 409: ResourceExistsError, |
| 3636 | + 304: ResourceNotModifiedError, |
| 3637 | + } |
| 3638 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 3639 | + |
| 3640 | + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) |
| 3641 | + _params = kwargs.pop("params", {}) or {} |
| 3642 | + |
| 3643 | + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) |
| 3644 | + cls: ClsType[None] = kwargs.pop("cls", None) |
| 3645 | + |
| 3646 | + content_type = content_type or "application/json" |
| 3647 | + _json = None |
| 3648 | + _content = None |
| 3649 | + if isinstance(body, (IOBase, bytes)): |
| 3650 | + _content = body |
| 3651 | + else: |
| 3652 | + _json = self._serialize.body(body, "BodyPilotsInternalSendMessage") |
| 3653 | + |
| 3654 | + _request = build_pilots_internal_send_message_request( |
| 3655 | + authorization=authorization, |
| 3656 | + content_type=content_type, |
| 3657 | + json=_json, |
| 3658 | + content=_content, |
| 3659 | + headers=_headers, |
| 3660 | + params=_params, |
| 3661 | + ) |
| 3662 | + _request.url = self._client.format_url(_request.url) |
| 3663 | + |
| 3664 | + _stream = False |
| 3665 | + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
| 3666 | + _request, stream=_stream, **kwargs |
| 3667 | + ) |
| 3668 | + |
| 3669 | + response = pipeline_response.http_response |
| 3670 | + |
| 3671 | + if response.status_code not in [204]: |
| 3672 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
| 3673 | + raise HttpResponseError(response=response) |
| 3674 | + |
| 3675 | + if cls: |
| 3676 | + return cls(pipeline_response, None, {}) # type: ignore |
0 commit comments