|
60 | 60 | build_pilots_create_pilot_secrets_request, |
61 | 61 | build_pilots_delete_pilots_request, |
62 | 62 | build_pilots_get_pilot_jobs_request, |
| 63 | + build_pilots_internal_send_message_request, |
63 | 64 | build_pilots_internal_userinfo_request, |
| 65 | + build_pilots_search_logs_request, |
64 | 66 | build_pilots_search_request, |
65 | 67 | build_pilots_update_pilot_fields_request, |
66 | 68 | build_pilots_update_secrets_constraints_request, |
@@ -3392,6 +3394,143 @@ async def search( |
3392 | 3394 |
|
3393 | 3395 | return deserialized # type: ignore |
3394 | 3396 |
|
| 3397 | + @overload |
| 3398 | + async def search_logs( |
| 3399 | + self, |
| 3400 | + body: Optional[_models.SearchParams] = None, |
| 3401 | + *, |
| 3402 | + page: int = 1, |
| 3403 | + per_page: int = 100, |
| 3404 | + content_type: str = "application/json", |
| 3405 | + **kwargs: Any |
| 3406 | + ) -> List[Dict[str, Any]]: |
| 3407 | + """Search Logs. |
| 3408 | + |
| 3409 | + Search Logs. |
| 3410 | + |
| 3411 | + :param body: Default value is None. |
| 3412 | + :type body: ~_generated.models.SearchParams |
| 3413 | + :keyword page: Default value is 1. |
| 3414 | + :paramtype page: int |
| 3415 | + :keyword per_page: Default value is 100. |
| 3416 | + :paramtype per_page: int |
| 3417 | + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. |
| 3418 | + Default value is "application/json". |
| 3419 | + :paramtype content_type: str |
| 3420 | + :return: list of dict mapping str to any |
| 3421 | + :rtype: list[dict[str, any]] |
| 3422 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3423 | + """ |
| 3424 | +
|
| 3425 | + @overload |
| 3426 | + async def search_logs( |
| 3427 | + self, |
| 3428 | + body: Optional[IO[bytes]] = None, |
| 3429 | + *, |
| 3430 | + page: int = 1, |
| 3431 | + per_page: int = 100, |
| 3432 | + content_type: str = "application/json", |
| 3433 | + **kwargs: Any |
| 3434 | + ) -> List[Dict[str, Any]]: |
| 3435 | + """Search Logs. |
| 3436 | + |
| 3437 | + Search Logs. |
| 3438 | + |
| 3439 | + :param body: Default value is None. |
| 3440 | + :type body: IO[bytes] |
| 3441 | + :keyword page: Default value is 1. |
| 3442 | + :paramtype page: int |
| 3443 | + :keyword per_page: Default value is 100. |
| 3444 | + :paramtype per_page: int |
| 3445 | + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. |
| 3446 | + Default value is "application/json". |
| 3447 | + :paramtype content_type: str |
| 3448 | + :return: list of dict mapping str to any |
| 3449 | + :rtype: list[dict[str, any]] |
| 3450 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3451 | + """ |
| 3452 | +
|
| 3453 | + @distributed_trace_async |
| 3454 | + async def search_logs( |
| 3455 | + self, |
| 3456 | + body: Optional[Union[_models.SearchParams, IO[bytes]]] = None, |
| 3457 | + *, |
| 3458 | + page: int = 1, |
| 3459 | + per_page: int = 100, |
| 3460 | + **kwargs: Any |
| 3461 | + ) -> List[Dict[str, Any]]: |
| 3462 | + """Search Logs. |
| 3463 | + |
| 3464 | + Search Logs. |
| 3465 | + |
| 3466 | + :param body: Is either a SearchParams type or a IO[bytes] type. Default value is None. |
| 3467 | + :type body: ~_generated.models.SearchParams or IO[bytes] |
| 3468 | + :keyword page: Default value is 1. |
| 3469 | + :paramtype page: int |
| 3470 | + :keyword per_page: Default value is 100. |
| 3471 | + :paramtype per_page: int |
| 3472 | + :return: list of dict mapping str to any |
| 3473 | + :rtype: list[dict[str, any]] |
| 3474 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3475 | + """ |
| 3476 | + error_map: MutableMapping = { |
| 3477 | + 401: ClientAuthenticationError, |
| 3478 | + 404: ResourceNotFoundError, |
| 3479 | + 409: ResourceExistsError, |
| 3480 | + 304: ResourceNotModifiedError, |
| 3481 | + } |
| 3482 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 3483 | +
|
| 3484 | + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) |
| 3485 | + _params = kwargs.pop("params", {}) or {} |
| 3486 | +
|
| 3487 | + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) |
| 3488 | + cls: ClsType[List[Dict[str, Any]]] = kwargs.pop("cls", None) |
| 3489 | +
|
| 3490 | + content_type = content_type or "application/json" |
| 3491 | + _json = None |
| 3492 | + _content = None |
| 3493 | + if isinstance(body, (IOBase, bytes)): |
| 3494 | + _content = body |
| 3495 | + else: |
| 3496 | + if body is not None: |
| 3497 | + _json = self._serialize.body(body, "SearchParams") |
| 3498 | + else: |
| 3499 | + _json = None |
| 3500 | +
|
| 3501 | + _request = build_pilots_search_logs_request( |
| 3502 | + page=page, |
| 3503 | + per_page=per_page, |
| 3504 | + content_type=content_type, |
| 3505 | + json=_json, |
| 3506 | + content=_content, |
| 3507 | + headers=_headers, |
| 3508 | + params=_params, |
| 3509 | + ) |
| 3510 | + _request.url = self._client.format_url(_request.url) |
| 3511 | +
|
| 3512 | + _stream = False |
| 3513 | + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
| 3514 | + _request, stream=_stream, **kwargs |
| 3515 | + ) |
| 3516 | +
|
| 3517 | + response = pipeline_response.http_response |
| 3518 | +
|
| 3519 | + if response.status_code not in [200, 206]: |
| 3520 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
| 3521 | + raise HttpResponseError(response=response) |
| 3522 | +
|
| 3523 | + response_headers = {} |
| 3524 | + if response.status_code == 206: |
| 3525 | + response_headers["Content-Range"] = self._deserialize("str", response.headers.get("Content-Range")) |
| 3526 | +
|
| 3527 | + deserialized = self._deserialize("[{object}]", pipeline_response.http_response) |
| 3528 | +
|
| 3529 | + if cls: |
| 3530 | + return cls(pipeline_response, deserialized, response_headers) # type: ignore |
| 3531 | +
|
| 3532 | + return deserialized # type: ignore |
| 3533 | +
|
3395 | 3534 |
|
3396 | 3535 | class PilotsInternalOperations: |
3397 | 3536 | """ |
@@ -3461,3 +3600,119 @@ async def userinfo(self, *, authorization: Optional[str] = None, **kwargs: Any) |
3461 | 3600 | return cls(pipeline_response, deserialized, {}) # type: ignore |
3462 | 3601 |
|
3463 | 3602 | return deserialized # type: ignore |
| 3603 | +
|
| 3604 | + @overload |
| 3605 | + async def send_message( |
| 3606 | + self, |
| 3607 | + body: _models.BodyPilotsInternalSendMessage, |
| 3608 | + *, |
| 3609 | + authorization: Optional[str] = None, |
| 3610 | + content_type: str = "application/json", |
| 3611 | + **kwargs: Any |
| 3612 | + ) -> None: |
| 3613 | + """Send Message. |
| 3614 | + |
| 3615 | + Send Message. |
| 3616 | + |
| 3617 | + :param body: Required. |
| 3618 | + :type body: ~_generated.models.BodyPilotsInternalSendMessage |
| 3619 | + :keyword authorization: Default value is None. |
| 3620 | + :paramtype authorization: str |
| 3621 | + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. |
| 3622 | + Default value is "application/json". |
| 3623 | + :paramtype content_type: str |
| 3624 | + :return: None |
| 3625 | + :rtype: None |
| 3626 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3627 | + """ |
| 3628 | +
|
| 3629 | + @overload |
| 3630 | + async def send_message( |
| 3631 | + self, |
| 3632 | + body: IO[bytes], |
| 3633 | + *, |
| 3634 | + authorization: Optional[str] = None, |
| 3635 | + content_type: str = "application/json", |
| 3636 | + **kwargs: Any |
| 3637 | + ) -> None: |
| 3638 | + """Send Message. |
| 3639 | + |
| 3640 | + Send Message. |
| 3641 | + |
| 3642 | + :param body: Required. |
| 3643 | + :type body: IO[bytes] |
| 3644 | + :keyword authorization: Default value is None. |
| 3645 | + :paramtype authorization: str |
| 3646 | + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. |
| 3647 | + Default value is "application/json". |
| 3648 | + :paramtype content_type: str |
| 3649 | + :return: None |
| 3650 | + :rtype: None |
| 3651 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3652 | + """ |
| 3653 | +
|
| 3654 | + @distributed_trace_async |
| 3655 | + async def send_message( |
| 3656 | + self, |
| 3657 | + body: Union[_models.BodyPilotsInternalSendMessage, IO[bytes]], |
| 3658 | + *, |
| 3659 | + authorization: Optional[str] = None, |
| 3660 | + **kwargs: Any |
| 3661 | + ) -> None: |
| 3662 | + """Send Message. |
| 3663 | + |
| 3664 | + Send Message. |
| 3665 | + |
| 3666 | + :param body: Is either a BodyPilotsInternalSendMessage type or a IO[bytes] type. Required. |
| 3667 | + :type body: ~_generated.models.BodyPilotsInternalSendMessage or IO[bytes] |
| 3668 | + :keyword authorization: Default value is None. |
| 3669 | + :paramtype authorization: str |
| 3670 | + :return: None |
| 3671 | + :rtype: None |
| 3672 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3673 | + """ |
| 3674 | + error_map: MutableMapping = { |
| 3675 | + 401: ClientAuthenticationError, |
| 3676 | + 404: ResourceNotFoundError, |
| 3677 | + 409: ResourceExistsError, |
| 3678 | + 304: ResourceNotModifiedError, |
| 3679 | + } |
| 3680 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 3681 | + |
| 3682 | + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) |
| 3683 | + _params = kwargs.pop("params", {}) or {} |
| 3684 | + |
| 3685 | + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) |
| 3686 | + cls: ClsType[None] = kwargs.pop("cls", None) |
| 3687 | + |
| 3688 | + content_type = content_type or "application/json" |
| 3689 | + _json = None |
| 3690 | + _content = None |
| 3691 | + if isinstance(body, (IOBase, bytes)): |
| 3692 | + _content = body |
| 3693 | + else: |
| 3694 | + _json = self._serialize.body(body, "BodyPilotsInternalSendMessage") |
| 3695 | + |
| 3696 | + _request = build_pilots_internal_send_message_request( |
| 3697 | + authorization=authorization, |
| 3698 | + content_type=content_type, |
| 3699 | + json=_json, |
| 3700 | + content=_content, |
| 3701 | + headers=_headers, |
| 3702 | + params=_params, |
| 3703 | + ) |
| 3704 | + _request.url = self._client.format_url(_request.url) |
| 3705 | + |
| 3706 | + _stream = False |
| 3707 | + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
| 3708 | + _request, stream=_stream, **kwargs |
| 3709 | + ) |
| 3710 | + |
| 3711 | + response = pipeline_response.http_response |
| 3712 | + |
| 3713 | + if response.status_code not in [204]: |
| 3714 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
| 3715 | + raise HttpResponseError(response=response) |
| 3716 | + |
| 3717 | + if cls: |
| 3718 | + return cls(pipeline_response, None, {}) # type: ignore |
0 commit comments