# coding: utf-8

"""
    Arthur GenAI Engine

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 2.1.294
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from datetime import datetime
from pydantic import Field, StrictInt, StrictStr
from typing import Any, Optional
from typing_extensions import Annotated
from arthur_observability_sdk._generated.arthur_observability_sdk._generated.models.feedback_request import FeedbackRequest
from arthur_observability_sdk._generated.arthur_observability_sdk._generated.models.inference_feedback_response import InferenceFeedbackResponse
from arthur_observability_sdk._generated.arthur_observability_sdk._generated.models.pagination_sort_method import PaginationSortMethod
from arthur_observability_sdk._generated.arthur_observability_sdk._generated.models.query_feedback_response import QueryFeedbackResponse

from arthur_observability_sdk._generated.arthur_observability_sdk._generated.api_client import ApiClient, RequestSerialized
from arthur_observability_sdk._generated.arthur_observability_sdk._generated.api_response import ApiResponse
from arthur_observability_sdk._generated.arthur_observability_sdk._generated.rest import RESTResponseType


class FeedbackApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    def post_feedback_api_v2_feedback_inference_id_post(
        self,
        inference_id: StrictStr,
        feedback_request: FeedbackRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> InferenceFeedbackResponse:
        """Post Feedback

        Post feedback for LLM Application.

        :param inference_id: (required)
        :type inference_id: str
        :param feedback_request: (required)
        :type feedback_request: FeedbackRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_feedback_api_v2_feedback_inference_id_post_serialize(
            inference_id=inference_id,
            feedback_request=feedback_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '201': "InferenceFeedbackResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def post_feedback_api_v2_feedback_inference_id_post_with_http_info(
        self,
        inference_id: StrictStr,
        feedback_request: FeedbackRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[InferenceFeedbackResponse]:
        """Post Feedback

        Post feedback for LLM Application.

        :param inference_id: (required)
        :type inference_id: str
        :param feedback_request: (required)
        :type feedback_request: FeedbackRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_feedback_api_v2_feedback_inference_id_post_serialize(
            inference_id=inference_id,
            feedback_request=feedback_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '201': "InferenceFeedbackResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def post_feedback_api_v2_feedback_inference_id_post_without_preload_content(
        self,
        inference_id: StrictStr,
        feedback_request: FeedbackRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Post Feedback

        Post feedback for LLM Application.

        :param inference_id: (required)
        :type inference_id: str
        :param feedback_request: (required)
        :type feedback_request: FeedbackRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_feedback_api_v2_feedback_inference_id_post_serialize(
            inference_id=inference_id,
            feedback_request=feedback_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '201': "InferenceFeedbackResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _post_feedback_api_v2_feedback_inference_id_post_serialize(
        self,
        inference_id,
        feedback_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if inference_id is not None:
            _path_params['inference_id'] = inference_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if feedback_request is not None:
            _body_params = feedback_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v2/feedback/{inference_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def query_feedback_api_v2_feedback_query_get(
        self,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format")] = None,
        feedback_id: Annotated[Optional[Any], Field(description="Feedback ID to filter on")] = None,
        inference_id: Annotated[Optional[Any], Field(description="Inference ID to filter on")] = None,
        target: Annotated[Optional[Any], Field(description="Target of the feedback. Must be one of ['context', 'response_results', 'prompt_results']")] = None,
        score: Annotated[Optional[Any], Field(description="Score of the feedback. Must be an integer.")] = None,
        feedback_user_id: Annotated[Optional[StrictStr], Field(description="User ID of the user giving feedback to filter on (query will perform fuzzy search)")] = None,
        conversation_id: Annotated[Optional[Any], Field(description="Conversation ID to filter on")] = None,
        task_id: Annotated[Optional[Any], Field(description="Task ID to filter on")] = None,
        inference_user_id: Annotated[Optional[StrictStr], Field(description="User ID of the user who created the inferences to filter on (query will perform fuzzy search)")] = None,
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> QueryFeedbackResponse:
        """Query Feedback

        Paginated feedback querying. See parameters for available filters. Includes feedback from archived tasks and rules.

        :param start_time: Inclusive start date in ISO8601 string format
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format
        :type end_time: datetime
        :param feedback_id: Feedback ID to filter on
        :type feedback_id: FeedbackId
        :param inference_id: Inference ID to filter on
        :type inference_id: InferenceId
        :param target: Target of the feedback. Must be one of ['context', 'response_results', 'prompt_results']
        :type target: Target
        :param score: Score of the feedback. Must be an integer.
        :type score: Score
        :param feedback_user_id: User ID of the user giving feedback to filter on (query will perform fuzzy search)
        :type feedback_user_id: str
        :param conversation_id: Conversation ID to filter on
        :type conversation_id: ConversationId
        :param task_id: Task ID to filter on
        :type task_id: TaskId
        :param inference_user_id: User ID of the user who created the inferences to filter on (query will perform fuzzy search)
        :type inference_user_id: str
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._query_feedback_api_v2_feedback_query_get_serialize(
            start_time=start_time,
            end_time=end_time,
            feedback_id=feedback_id,
            inference_id=inference_id,
            target=target,
            score=score,
            feedback_user_id=feedback_user_id,
            conversation_id=conversation_id,
            task_id=task_id,
            inference_user_id=inference_user_id,
            sort=sort,
            page_size=page_size,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QueryFeedbackResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def query_feedback_api_v2_feedback_query_get_with_http_info(
        self,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format")] = None,
        feedback_id: Annotated[Optional[Any], Field(description="Feedback ID to filter on")] = None,
        inference_id: Annotated[Optional[Any], Field(description="Inference ID to filter on")] = None,
        target: Annotated[Optional[Any], Field(description="Target of the feedback. Must be one of ['context', 'response_results', 'prompt_results']")] = None,
        score: Annotated[Optional[Any], Field(description="Score of the feedback. Must be an integer.")] = None,
        feedback_user_id: Annotated[Optional[StrictStr], Field(description="User ID of the user giving feedback to filter on (query will perform fuzzy search)")] = None,
        conversation_id: Annotated[Optional[Any], Field(description="Conversation ID to filter on")] = None,
        task_id: Annotated[Optional[Any], Field(description="Task ID to filter on")] = None,
        inference_user_id: Annotated[Optional[StrictStr], Field(description="User ID of the user who created the inferences to filter on (query will perform fuzzy search)")] = None,
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[QueryFeedbackResponse]:
        """Query Feedback

        Paginated feedback querying. See parameters for available filters. Includes feedback from archived tasks and rules.

        :param start_time: Inclusive start date in ISO8601 string format
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format
        :type end_time: datetime
        :param feedback_id: Feedback ID to filter on
        :type feedback_id: FeedbackId
        :param inference_id: Inference ID to filter on
        :type inference_id: InferenceId
        :param target: Target of the feedback. Must be one of ['context', 'response_results', 'prompt_results']
        :type target: Target
        :param score: Score of the feedback. Must be an integer.
        :type score: Score
        :param feedback_user_id: User ID of the user giving feedback to filter on (query will perform fuzzy search)
        :type feedback_user_id: str
        :param conversation_id: Conversation ID to filter on
        :type conversation_id: ConversationId
        :param task_id: Task ID to filter on
        :type task_id: TaskId
        :param inference_user_id: User ID of the user who created the inferences to filter on (query will perform fuzzy search)
        :type inference_user_id: str
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._query_feedback_api_v2_feedback_query_get_serialize(
            start_time=start_time,
            end_time=end_time,
            feedback_id=feedback_id,
            inference_id=inference_id,
            target=target,
            score=score,
            feedback_user_id=feedback_user_id,
            conversation_id=conversation_id,
            task_id=task_id,
            inference_user_id=inference_user_id,
            sort=sort,
            page_size=page_size,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QueryFeedbackResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def query_feedback_api_v2_feedback_query_get_without_preload_content(
        self,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format")] = None,
        feedback_id: Annotated[Optional[Any], Field(description="Feedback ID to filter on")] = None,
        inference_id: Annotated[Optional[Any], Field(description="Inference ID to filter on")] = None,
        target: Annotated[Optional[Any], Field(description="Target of the feedback. Must be one of ['context', 'response_results', 'prompt_results']")] = None,
        score: Annotated[Optional[Any], Field(description="Score of the feedback. Must be an integer.")] = None,
        feedback_user_id: Annotated[Optional[StrictStr], Field(description="User ID of the user giving feedback to filter on (query will perform fuzzy search)")] = None,
        conversation_id: Annotated[Optional[Any], Field(description="Conversation ID to filter on")] = None,
        task_id: Annotated[Optional[Any], Field(description="Task ID to filter on")] = None,
        inference_user_id: Annotated[Optional[StrictStr], Field(description="User ID of the user who created the inferences to filter on (query will perform fuzzy search)")] = None,
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Query Feedback

        Paginated feedback querying. See parameters for available filters. Includes feedback from archived tasks and rules.

        :param start_time: Inclusive start date in ISO8601 string format
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format
        :type end_time: datetime
        :param feedback_id: Feedback ID to filter on
        :type feedback_id: FeedbackId
        :param inference_id: Inference ID to filter on
        :type inference_id: InferenceId
        :param target: Target of the feedback. Must be one of ['context', 'response_results', 'prompt_results']
        :type target: Target
        :param score: Score of the feedback. Must be an integer.
        :type score: Score
        :param feedback_user_id: User ID of the user giving feedback to filter on (query will perform fuzzy search)
        :type feedback_user_id: str
        :param conversation_id: Conversation ID to filter on
        :type conversation_id: ConversationId
        :param task_id: Task ID to filter on
        :type task_id: TaskId
        :param inference_user_id: User ID of the user who created the inferences to filter on (query will perform fuzzy search)
        :type inference_user_id: str
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._query_feedback_api_v2_feedback_query_get_serialize(
            start_time=start_time,
            end_time=end_time,
            feedback_id=feedback_id,
            inference_id=inference_id,
            target=target,
            score=score,
            feedback_user_id=feedback_user_id,
            conversation_id=conversation_id,
            task_id=task_id,
            inference_user_id=inference_user_id,
            sort=sort,
            page_size=page_size,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QueryFeedbackResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _query_feedback_api_v2_feedback_query_get_serialize(
        self,
        start_time,
        end_time,
        feedback_id,
        inference_id,
        target,
        score,
        feedback_user_id,
        conversation_id,
        task_id,
        inference_user_id,
        sort,
        page_size,
        page,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if start_time is not None:
            if isinstance(start_time, datetime):
                _query_params.append(
                    (
                        'start_time',
                        start_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('start_time', start_time))
            
        if end_time is not None:
            if isinstance(end_time, datetime):
                _query_params.append(
                    (
                        'end_time',
                        end_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('end_time', end_time))
            
        if feedback_id is not None:
            
            _query_params.append(('feedback_id', feedback_id))
            
        if inference_id is not None:
            
            _query_params.append(('inference_id', inference_id))
            
        if target is not None:
            
            _query_params.append(('target', target))
            
        if score is not None:
            
            _query_params.append(('score', score))
            
        if feedback_user_id is not None:
            
            _query_params.append(('feedback_user_id', feedback_user_id))
            
        if conversation_id is not None:
            
            _query_params.append(('conversation_id', conversation_id))
            
        if task_id is not None:
            
            _query_params.append(('task_id', task_id))
            
        if inference_user_id is not None:
            
            _query_params.append(('inference_user_id', inference_user_id))
            
        if sort is not None:
            
            _query_params.append(('sort', sort.value))
            
        if page_size is not None:
            
            _query_params.append(('page_size', page_size))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v2/feedback/query',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


