2525 AsyncOffsetPageQueryLogGroups ,
2626)
2727from ..._base_client import AsyncPaginator , make_request_options
28- from ...types .projects import query_log_list_params , query_log_list_groups_params , query_log_list_by_group_params
28+ from ...types .projects import (
29+ query_log_list_params ,
30+ query_log_list_groups_params ,
31+ query_log_list_by_group_params ,
32+ query_log_add_user_feedback_params ,
33+ )
2934from ...types .projects .query_log_list_response import QueryLogListResponse
3035from ...types .projects .query_log_retrieve_response import QueryLogRetrieveResponse
3136from ...types .projects .query_log_list_groups_response import QueryLogListGroupsResponse
3237from ...types .projects .query_log_list_by_group_response import QueryLogListByGroupResponse
38+ from ...types .projects .query_log_add_user_feedback_response import QueryLogAddUserFeedbackResponse
3339from ...types .projects .query_log_start_remediation_response import QueryLogStartRemediationResponse
3440
3541__all__ = ["QueryLogsResource" , "AsyncQueryLogsResource" ]
@@ -184,6 +190,46 @@ def list(
184190 model = QueryLogListResponse ,
185191 )
186192
193+ def add_user_feedback (
194+ self ,
195+ query_log_id : str ,
196+ * ,
197+ project_id : str ,
198+ key : str ,
199+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
200+ # The extra values given here take precedence over values defined on the client or passed to this method.
201+ extra_headers : Headers | None = None ,
202+ extra_query : Query | None = None ,
203+ extra_body : Body | None = None ,
204+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
205+ ) -> QueryLogAddUserFeedbackResponse :
206+ """
207+ Add User Feedback Route
208+
209+ Args:
210+ key: A key describing the criteria of the feedback, eg 'rating'
211+
212+ extra_headers: Send extra headers
213+
214+ extra_query: Add additional query parameters to the request
215+
216+ extra_body: Add additional JSON properties to the request
217+
218+ timeout: Override the client-level default timeout for this request, in seconds
219+ """
220+ if not project_id :
221+ raise ValueError (f"Expected a non-empty value for `project_id` but received { project_id !r} " )
222+ if not query_log_id :
223+ raise ValueError (f"Expected a non-empty value for `query_log_id` but received { query_log_id !r} " )
224+ return self ._post (
225+ f"/api/projects/{ project_id } /query_logs/{ query_log_id } /user_feedback" ,
226+ body = maybe_transform ({"key" : key }, query_log_add_user_feedback_params .QueryLogAddUserFeedbackParams ),
227+ options = make_request_options (
228+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
229+ ),
230+ cast_to = QueryLogAddUserFeedbackResponse ,
231+ )
232+
187233 def list_by_group (
188234 self ,
189235 project_id : str ,
@@ -568,6 +614,48 @@ def list(
568614 model = QueryLogListResponse ,
569615 )
570616
617+ async def add_user_feedback (
618+ self ,
619+ query_log_id : str ,
620+ * ,
621+ project_id : str ,
622+ key : str ,
623+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
624+ # The extra values given here take precedence over values defined on the client or passed to this method.
625+ extra_headers : Headers | None = None ,
626+ extra_query : Query | None = None ,
627+ extra_body : Body | None = None ,
628+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
629+ ) -> QueryLogAddUserFeedbackResponse :
630+ """
631+ Add User Feedback Route
632+
633+ Args:
634+ key: A key describing the criteria of the feedback, eg 'rating'
635+
636+ extra_headers: Send extra headers
637+
638+ extra_query: Add additional query parameters to the request
639+
640+ extra_body: Add additional JSON properties to the request
641+
642+ timeout: Override the client-level default timeout for this request, in seconds
643+ """
644+ if not project_id :
645+ raise ValueError (f"Expected a non-empty value for `project_id` but received { project_id !r} " )
646+ if not query_log_id :
647+ raise ValueError (f"Expected a non-empty value for `query_log_id` but received { query_log_id !r} " )
648+ return await self ._post (
649+ f"/api/projects/{ project_id } /query_logs/{ query_log_id } /user_feedback" ,
650+ body = await async_maybe_transform (
651+ {"key" : key }, query_log_add_user_feedback_params .QueryLogAddUserFeedbackParams
652+ ),
653+ options = make_request_options (
654+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
655+ ),
656+ cast_to = QueryLogAddUserFeedbackResponse ,
657+ )
658+
571659 async def list_by_group (
572660 self ,
573661 project_id : str ,
@@ -813,6 +901,9 @@ def __init__(self, query_logs: QueryLogsResource) -> None:
813901 self .list = to_raw_response_wrapper (
814902 query_logs .list ,
815903 )
904+ self .add_user_feedback = to_raw_response_wrapper (
905+ query_logs .add_user_feedback ,
906+ )
816907 self .list_by_group = to_raw_response_wrapper (
817908 query_logs .list_by_group ,
818909 )
@@ -834,6 +925,9 @@ def __init__(self, query_logs: AsyncQueryLogsResource) -> None:
834925 self .list = async_to_raw_response_wrapper (
835926 query_logs .list ,
836927 )
928+ self .add_user_feedback = async_to_raw_response_wrapper (
929+ query_logs .add_user_feedback ,
930+ )
837931 self .list_by_group = async_to_raw_response_wrapper (
838932 query_logs .list_by_group ,
839933 )
@@ -855,6 +949,9 @@ def __init__(self, query_logs: QueryLogsResource) -> None:
855949 self .list = to_streamed_response_wrapper (
856950 query_logs .list ,
857951 )
952+ self .add_user_feedback = to_streamed_response_wrapper (
953+ query_logs .add_user_feedback ,
954+ )
858955 self .list_by_group = to_streamed_response_wrapper (
859956 query_logs .list_by_group ,
860957 )
@@ -876,6 +973,9 @@ def __init__(self, query_logs: AsyncQueryLogsResource) -> None:
876973 self .list = async_to_streamed_response_wrapper (
877974 query_logs .list ,
878975 )
976+ self .add_user_feedback = async_to_streamed_response_wrapper (
977+ query_logs .add_user_feedback ,
978+ )
879979 self .list_by_group = async_to_streamed_response_wrapper (
880980 query_logs .list_by_group ,
881981 )
0 commit comments