|
56 | 56 | build_pilots_add_pilot_stamps_request,
|
57 | 57 | build_pilots_delete_pilots_request,
|
58 | 58 | build_pilots_get_pilot_jobs_request,
|
| 59 | + build_pilots_search_logs_request, |
59 | 60 | build_pilots_search_request,
|
| 61 | + build_pilots_send_message_request, |
60 | 62 | build_pilots_summary_request,
|
61 | 63 | build_pilots_update_pilot_fields_request,
|
62 | 64 | build_well_known_get_installation_metadata_request,
|
@@ -2705,6 +2707,143 @@ async def search(
|
2705 | 2707 |
|
2706 | 2708 | return deserialized # type: ignore
|
2707 | 2709 |
|
| 2710 | + @overload |
| 2711 | + async def search_logs( |
| 2712 | + self, |
| 2713 | + body: Optional[_models.SearchParams] = None, |
| 2714 | + *, |
| 2715 | + page: int = 1, |
| 2716 | + per_page: int = 100, |
| 2717 | + content_type: str = "application/json", |
| 2718 | + **kwargs: Any |
| 2719 | + ) -> List[Dict[str, Any]]: |
| 2720 | + """Search Logs. |
| 2721 | +
|
| 2722 | + Search Logs. |
| 2723 | +
|
| 2724 | + :param body: Default value is None. |
| 2725 | + :type body: ~_generated.models.SearchParams |
| 2726 | + :keyword page: Default value is 1. |
| 2727 | + :paramtype page: int |
| 2728 | + :keyword per_page: Default value is 100. |
| 2729 | + :paramtype per_page: int |
| 2730 | + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. |
| 2731 | + Default value is "application/json". |
| 2732 | + :paramtype content_type: str |
| 2733 | + :return: list of dict mapping str to any |
| 2734 | + :rtype: list[dict[str, any]] |
| 2735 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 2736 | + """ |
| 2737 | + |
| 2738 | + @overload |
| 2739 | + async def search_logs( |
| 2740 | + self, |
| 2741 | + body: Optional[IO[bytes]] = None, |
| 2742 | + *, |
| 2743 | + page: int = 1, |
| 2744 | + per_page: int = 100, |
| 2745 | + content_type: str = "application/json", |
| 2746 | + **kwargs: Any |
| 2747 | + ) -> List[Dict[str, Any]]: |
| 2748 | + """Search Logs. |
| 2749 | +
|
| 2750 | + Search Logs. |
| 2751 | +
|
| 2752 | + :param body: Default value is None. |
| 2753 | + :type body: IO[bytes] |
| 2754 | + :keyword page: Default value is 1. |
| 2755 | + :paramtype page: int |
| 2756 | + :keyword per_page: Default value is 100. |
| 2757 | + :paramtype per_page: int |
| 2758 | + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. |
| 2759 | + Default value is "application/json". |
| 2760 | + :paramtype content_type: str |
| 2761 | + :return: list of dict mapping str to any |
| 2762 | + :rtype: list[dict[str, any]] |
| 2763 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 2764 | + """ |
| 2765 | + |
| 2766 | + @distributed_trace_async |
| 2767 | + async def search_logs( |
| 2768 | + self, |
| 2769 | + body: Optional[Union[_models.SearchParams, IO[bytes]]] = None, |
| 2770 | + *, |
| 2771 | + page: int = 1, |
| 2772 | + per_page: int = 100, |
| 2773 | + **kwargs: Any |
| 2774 | + ) -> List[Dict[str, Any]]: |
| 2775 | + """Search Logs. |
| 2776 | +
|
| 2777 | + Search Logs. |
| 2778 | +
|
| 2779 | + :param body: Is either a SearchParams type or a IO[bytes] type. Default value is None. |
| 2780 | + :type body: ~_generated.models.SearchParams or IO[bytes] |
| 2781 | + :keyword page: Default value is 1. |
| 2782 | + :paramtype page: int |
| 2783 | + :keyword per_page: Default value is 100. |
| 2784 | + :paramtype per_page: int |
| 2785 | + :return: list of dict mapping str to any |
| 2786 | + :rtype: list[dict[str, any]] |
| 2787 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 2788 | + """ |
| 2789 | + error_map: MutableMapping = { |
| 2790 | + 401: ClientAuthenticationError, |
| 2791 | + 404: ResourceNotFoundError, |
| 2792 | + 409: ResourceExistsError, |
| 2793 | + 304: ResourceNotModifiedError, |
| 2794 | + } |
| 2795 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 2796 | + |
| 2797 | + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) |
| 2798 | + _params = kwargs.pop("params", {}) or {} |
| 2799 | + |
| 2800 | + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) |
| 2801 | + cls: ClsType[List[Dict[str, Any]]] = kwargs.pop("cls", None) |
| 2802 | + |
| 2803 | + content_type = content_type or "application/json" |
| 2804 | + _json = None |
| 2805 | + _content = None |
| 2806 | + if isinstance(body, (IOBase, bytes)): |
| 2807 | + _content = body |
| 2808 | + else: |
| 2809 | + if body is not None: |
| 2810 | + _json = self._serialize.body(body, "SearchParams") |
| 2811 | + else: |
| 2812 | + _json = None |
| 2813 | + |
| 2814 | + _request = build_pilots_search_logs_request( |
| 2815 | + page=page, |
| 2816 | + per_page=per_page, |
| 2817 | + content_type=content_type, |
| 2818 | + json=_json, |
| 2819 | + content=_content, |
| 2820 | + headers=_headers, |
| 2821 | + params=_params, |
| 2822 | + ) |
| 2823 | + _request.url = self._client.format_url(_request.url) |
| 2824 | + |
| 2825 | + _stream = False |
| 2826 | + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
| 2827 | + _request, stream=_stream, **kwargs |
| 2828 | + ) |
| 2829 | + |
| 2830 | + response = pipeline_response.http_response |
| 2831 | + |
| 2832 | + if response.status_code not in [200, 206]: |
| 2833 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
| 2834 | + raise HttpResponseError(response=response) |
| 2835 | + |
| 2836 | + response_headers = {} |
| 2837 | + if response.status_code == 206: |
| 2838 | + response_headers["Content-Range"] = self._deserialize("str", response.headers.get("Content-Range")) |
| 2839 | + |
| 2840 | + deserialized = self._deserialize("[{object}]", pipeline_response.http_response) |
| 2841 | + |
| 2842 | + if cls: |
| 2843 | + return cls(pipeline_response, deserialized, response_headers) # type: ignore |
| 2844 | + |
| 2845 | + return deserialized # type: ignore |
| 2846 | + |
2708 | 2847 | @overload
|
2709 | 2848 | async def summary(
|
2710 | 2849 | self, body: _models.SummaryParams, *, content_type: str = "application/json", **kwargs: Any
|
@@ -2799,3 +2938,94 @@ async def summary(self, body: Union[_models.SummaryParams, IO[bytes]], **kwargs:
|
2799 | 2938 | return cls(pipeline_response, deserialized, {}) # type: ignore
|
2800 | 2939 |
|
2801 | 2940 | return deserialized # type: ignore
|
| 2941 | + |
| 2942 | + @overload |
| 2943 | + async def send_message( |
| 2944 | + self, body: _models.BodyPilotsSendMessage, *, content_type: str = "application/json", **kwargs: Any |
| 2945 | + ) -> None: |
| 2946 | + """Send Message. |
| 2947 | +
|
| 2948 | + Send logs with legacy pilot. |
| 2949 | +
|
| 2950 | + :param body: Required. |
| 2951 | + :type body: ~_generated.models.BodyPilotsSendMessage |
| 2952 | + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. |
| 2953 | + Default value is "application/json". |
| 2954 | + :paramtype content_type: str |
| 2955 | + :return: None |
| 2956 | + :rtype: None |
| 2957 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 2958 | + """ |
| 2959 | + |
| 2960 | + @overload |
| 2961 | + async def send_message(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: |
| 2962 | + """Send Message. |
| 2963 | +
|
| 2964 | + Send logs with legacy pilot. |
| 2965 | +
|
| 2966 | + :param body: Required. |
| 2967 | + :type body: IO[bytes] |
| 2968 | + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. |
| 2969 | + Default value is "application/json". |
| 2970 | + :paramtype content_type: str |
| 2971 | + :return: None |
| 2972 | + :rtype: None |
| 2973 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 2974 | + """ |
| 2975 | + |
| 2976 | + @distributed_trace_async |
| 2977 | + async def send_message(self, body: Union[_models.BodyPilotsSendMessage, IO[bytes]], **kwargs: Any) -> None: |
| 2978 | + """Send Message. |
| 2979 | +
|
| 2980 | + Send logs with legacy pilot. |
| 2981 | +
|
| 2982 | + :param body: Is either a BodyPilotsSendMessage type or a IO[bytes] type. Required. |
| 2983 | + :type body: ~_generated.models.BodyPilotsSendMessage or IO[bytes] |
| 2984 | + :return: None |
| 2985 | + :rtype: None |
| 2986 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 2987 | + """ |
| 2988 | + error_map: MutableMapping = { |
| 2989 | + 401: ClientAuthenticationError, |
| 2990 | + 404: ResourceNotFoundError, |
| 2991 | + 409: ResourceExistsError, |
| 2992 | + 304: ResourceNotModifiedError, |
| 2993 | + } |
| 2994 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 2995 | + |
| 2996 | + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) |
| 2997 | + _params = kwargs.pop("params", {}) or {} |
| 2998 | + |
| 2999 | + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) |
| 3000 | + cls: ClsType[None] = kwargs.pop("cls", None) |
| 3001 | + |
| 3002 | + content_type = content_type or "application/json" |
| 3003 | + _json = None |
| 3004 | + _content = None |
| 3005 | + if isinstance(body, (IOBase, bytes)): |
| 3006 | + _content = body |
| 3007 | + else: |
| 3008 | + _json = self._serialize.body(body, "BodyPilotsSendMessage") |
| 3009 | + |
| 3010 | + _request = build_pilots_send_message_request( |
| 3011 | + content_type=content_type, |
| 3012 | + json=_json, |
| 3013 | + content=_content, |
| 3014 | + headers=_headers, |
| 3015 | + params=_params, |
| 3016 | + ) |
| 3017 | + _request.url = self._client.format_url(_request.url) |
| 3018 | + |
| 3019 | + _stream = False |
| 3020 | + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
| 3021 | + _request, stream=_stream, **kwargs |
| 3022 | + ) |
| 3023 | + |
| 3024 | + response = pipeline_response.http_response |
| 3025 | + |
| 3026 | + if response.status_code not in [204]: |
| 3027 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
| 3028 | + raise HttpResponseError(response=response) |
| 3029 | + |
| 3030 | + if cls: |
| 3031 | + return cls(pipeline_response, None, {}) # type: ignore |
0 commit comments