"""
RCABench API

RCABench - A comprehensive root cause analysis benchmarking platform for microservices

The version of the OpenAPI document: 1.1.51
Contact: team@rcabench.com
Generated by OpenAPI Generator (https://rcabench.openapi-generator.tech)

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

from typing import Annotated, Any

from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call

from rcabench.openapi.api_client import ApiClient, RequestSerialized
from rcabench.openapi.api_response import ApiResponse
from rcabench.openapi.models.create_dataset_req import CreateDatasetReq
from rcabench.openapi.models.create_dataset_version_req import CreateDatasetVersionReq
from rcabench.openapi.models.generic_response_dataset_detail_resp import GenericResponseDatasetDetailResp
from rcabench.openapi.models.generic_response_dataset_resp import GenericResponseDatasetResp
from rcabench.openapi.models.generic_response_dataset_version_detail_resp import GenericResponseDatasetVersionDetailResp
from rcabench.openapi.models.generic_response_dataset_version_resp import GenericResponseDatasetVersionResp
from rcabench.openapi.models.generic_response_list_dataset_detail_resp import GenericResponseListDatasetDetailResp
from rcabench.openapi.models.generic_response_list_dataset_resp import GenericResponseListDatasetResp
from rcabench.openapi.models.generic_response_list_dataset_version_resp import GenericResponseListDatasetVersionResp
from rcabench.openapi.models.manage_dataset_version_injection_req import ManageDatasetVersionInjectionReq
from rcabench.openapi.models.search_dataset_req import SearchDatasetReq
from rcabench.openapi.models.status_type import StatusType
from rcabench.openapi.rest import RESTResponse, RESTResponseType


class DatasetsApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://rcabench.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 create_dataset(
        self,
        request: Annotated[CreateDatasetReq, Field(description="Dataset creation request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GenericResponseDatasetResp:
        """Create dataset

        Create a new dataset with an initial version

        :param request: Dataset creation request (required)
        :type request: CreateDatasetReq
        :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._create_dataset_serialize(
            request=request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "201": "GenericResponseDatasetResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "409": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data  # type: ignore

    @validate_call
    def create_dataset_with_http_info(
        self,
        request: Annotated[CreateDatasetReq, Field(description="Dataset creation request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GenericResponseDatasetResp]:
        """Create dataset

        Create a new dataset with an initial version

        :param request: Dataset creation request (required)
        :type request: CreateDatasetReq
        :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._create_dataset_serialize(
            request=request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "201": "GenericResponseDatasetResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "409": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )  # type: ignore

    @validate_call
    def create_dataset_without_preload_content(
        self,
        request: Annotated[CreateDatasetReq, Field(description="Dataset creation request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create dataset

        Create a new dataset with an initial version

        :param request: Dataset creation request (required)
        :type request: CreateDatasetReq
        :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._create_dataset_serialize(
            request=request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "201": "GenericResponseDatasetResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "409": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        return response_data.response

    def _create_dataset_serialize(
        self,
        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, str | None] = _headers or {}
        _form_params: list[tuple[str, str]] = []
        _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {}
        _body_params: bytes | None = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if request is not None:
            _body_params = 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] = ["BearerAuth"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/api/v2/datasets",
            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 create_dataset_version(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        request: Annotated[CreateDatasetVersionReq, Field(description="Dataset version creation request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GenericResponseDatasetVersionResp:
        """Create dataset version

        Create a new dataset version for an existing dataset.

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param request: Dataset version creation request (required)
        :type request: CreateDatasetVersionReq
        :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._create_dataset_version_serialize(
            dataset_id=dataset_id,
            request=request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "201": "GenericResponseDatasetVersionResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "409": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data  # type: ignore

    @validate_call
    def create_dataset_version_with_http_info(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        request: Annotated[CreateDatasetVersionReq, Field(description="Dataset version creation request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GenericResponseDatasetVersionResp]:
        """Create dataset version

        Create a new dataset version for an existing dataset.

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param request: Dataset version creation request (required)
        :type request: CreateDatasetVersionReq
        :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._create_dataset_version_serialize(
            dataset_id=dataset_id,
            request=request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "201": "GenericResponseDatasetVersionResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "409": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )  # type: ignore

    @validate_call
    def create_dataset_version_without_preload_content(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        request: Annotated[CreateDatasetVersionReq, Field(description="Dataset version creation request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create dataset version

        Create a new dataset version for an existing dataset.

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param request: Dataset version creation request (required)
        :type request: CreateDatasetVersionReq
        :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._create_dataset_version_serialize(
            dataset_id=dataset_id,
            request=request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "201": "GenericResponseDatasetVersionResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "409": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        return response_data.response

    def _create_dataset_version_serialize(
        self,
        dataset_id,
        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, str | None] = _headers or {}
        _form_params: list[tuple[str, str]] = []
        _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {}
        _body_params: bytes | None = None

        # process the path parameters
        if dataset_id is not None:
            _path_params["dataset_id"] = dataset_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if request is not None:
            _body_params = 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] = ["BearerAuth"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/api/v2/datasets/{dataset_id}/versions",
            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 download_dataset_version(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        version_id: Annotated[StrictInt, Field(description="Dataset Version ID")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bytearray:
        """Download dataset version

        Download dataset file by version ID

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param version_id: Dataset Version ID (required)
        :type version_id: 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._download_dataset_version_serialize(
            dataset_id=dataset_id,
            version_id=version_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "bytearray",
            "400": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data  # type: ignore

    @validate_call
    def download_dataset_version_with_http_info(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        version_id: Annotated[StrictInt, Field(description="Dataset Version ID")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bytearray]:
        """Download dataset version

        Download dataset file by version ID

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param version_id: Dataset Version ID (required)
        :type version_id: 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._download_dataset_version_serialize(
            dataset_id=dataset_id,
            version_id=version_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "bytearray",
            "400": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )  # type: ignore

    @validate_call
    def download_dataset_version_without_preload_content(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        version_id: Annotated[StrictInt, Field(description="Dataset Version ID")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Download dataset version

        Download dataset file by version ID

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param version_id: Dataset Version ID (required)
        :type version_id: 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._download_dataset_version_serialize(
            dataset_id=dataset_id,
            version_id=version_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "bytearray",
            "400": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        return response_data.response

    def _download_dataset_version_serialize(
        self,
        dataset_id,
        version_id,
        _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, str | None] = _headers or {}
        _form_params: list[tuple[str, str]] = []
        _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {}
        _body_params: bytes | None = None

        # process the path parameters
        if dataset_id is not None:
            _path_params["dataset_id"] = dataset_id
        if version_id is not None:
            _path_params["version_id"] = version_id
        # process the query parameters
        # 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/octet-stream"])

        # authentication setting
        _auth_settings: list[str] = ["BearerAuth"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/api/v2/datasets/{dataset_id}/versions/{version_id}/download",
            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 get_dataset_by_id(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GenericResponseDatasetDetailResp:
        """Get dataset by ID

        Get detailed information about a specific dataset

        :param dataset_id: Dataset ID (required)
        :type dataset_id: 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._get_dataset_by_id_serialize(
            dataset_id=dataset_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseDatasetDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data  # type: ignore

    @validate_call
    def get_dataset_by_id_with_http_info(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GenericResponseDatasetDetailResp]:
        """Get dataset by ID

        Get detailed information about a specific dataset

        :param dataset_id: Dataset ID (required)
        :type dataset_id: 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._get_dataset_by_id_serialize(
            dataset_id=dataset_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseDatasetDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )  # type: ignore

    @validate_call
    def get_dataset_by_id_without_preload_content(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get dataset by ID

        Get detailed information about a specific dataset

        :param dataset_id: Dataset ID (required)
        :type dataset_id: 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._get_dataset_by_id_serialize(
            dataset_id=dataset_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseDatasetDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        return response_data.response

    def _get_dataset_by_id_serialize(
        self,
        dataset_id,
        _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, str | None] = _headers or {}
        _form_params: list[tuple[str, str]] = []
        _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {}
        _body_params: bytes | None = None

        # process the path parameters
        if dataset_id is not None:
            _path_params["dataset_id"] = dataset_id
        # process the query parameters
        # 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] = ["BearerAuth"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/api/v2/datasets/{dataset_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 get_dataset_version_by_id(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        version_id: Annotated[StrictInt, Field(description="Dataset Version ID")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GenericResponseDatasetVersionDetailResp:
        """Get dataset version by ID

        Get detailed information about a specific dataset version

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param version_id: Dataset Version ID (required)
        :type version_id: 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._get_dataset_version_by_id_serialize(
            dataset_id=dataset_id,
            version_id=version_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseDatasetVersionDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data  # type: ignore

    @validate_call
    def get_dataset_version_by_id_with_http_info(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        version_id: Annotated[StrictInt, Field(description="Dataset Version ID")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GenericResponseDatasetVersionDetailResp]:
        """Get dataset version by ID

        Get detailed information about a specific dataset version

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param version_id: Dataset Version ID (required)
        :type version_id: 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._get_dataset_version_by_id_serialize(
            dataset_id=dataset_id,
            version_id=version_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseDatasetVersionDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )  # type: ignore

    @validate_call
    def get_dataset_version_by_id_without_preload_content(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        version_id: Annotated[StrictInt, Field(description="Dataset Version ID")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get dataset version by ID

        Get detailed information about a specific dataset version

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param version_id: Dataset Version ID (required)
        :type version_id: 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._get_dataset_version_by_id_serialize(
            dataset_id=dataset_id,
            version_id=version_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseDatasetVersionDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        return response_data.response

    def _get_dataset_version_by_id_serialize(
        self,
        dataset_id,
        version_id,
        _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, str | None] = _headers or {}
        _form_params: list[tuple[str, str]] = []
        _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {}
        _body_params: bytes | None = None

        # process the path parameters
        if dataset_id is not None:
            _path_params["dataset_id"] = dataset_id
        if version_id is not None:
            _path_params["version_id"] = version_id
        # process the query parameters
        # 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] = ["BearerAuth"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/api/v2/datasets/{dataset_id}/versions/{version_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 list_dataset_versions(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        page: Annotated[StrictInt | None, Field(description="Page number")] = None,
        size: Annotated[StrictInt | None, Field(description="Page size")] = None,
        status: Annotated[StatusType | None, Field(description="Dataset version status filter")] = None,
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GenericResponseListDatasetVersionResp:
        """List dataset versions

        Get paginated list of dataset versions for a specific dataset

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param page: Page number
        :type page: int
        :param size: Page size
        :type size: int
        :param status: Dataset version status filter
        :type status: StatusType
        :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._list_dataset_versions_serialize(
            dataset_id=dataset_id,
            page=page,
            size=size,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseListDatasetVersionResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data  # type: ignore

    @validate_call
    def list_dataset_versions_with_http_info(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        page: Annotated[StrictInt | None, Field(description="Page number")] = None,
        size: Annotated[StrictInt | None, Field(description="Page size")] = None,
        status: Annotated[StatusType | None, Field(description="Dataset version status filter")] = None,
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GenericResponseListDatasetVersionResp]:
        """List dataset versions

        Get paginated list of dataset versions for a specific dataset

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param page: Page number
        :type page: int
        :param size: Page size
        :type size: int
        :param status: Dataset version status filter
        :type status: StatusType
        :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._list_dataset_versions_serialize(
            dataset_id=dataset_id,
            page=page,
            size=size,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseListDatasetVersionResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )  # type: ignore

    @validate_call
    def list_dataset_versions_without_preload_content(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        page: Annotated[StrictInt | None, Field(description="Page number")] = None,
        size: Annotated[StrictInt | None, Field(description="Page size")] = None,
        status: Annotated[StatusType | None, Field(description="Dataset version status filter")] = None,
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List dataset versions

        Get paginated list of dataset versions for a specific dataset

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param page: Page number
        :type page: int
        :param size: Page size
        :type size: int
        :param status: Dataset version status filter
        :type status: StatusType
        :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._list_dataset_versions_serialize(
            dataset_id=dataset_id,
            page=page,
            size=size,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseListDatasetVersionResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        return response_data.response

    def _list_dataset_versions_serialize(
        self,
        dataset_id,
        page,
        size,
        status,
        _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, str | None] = _headers or {}
        _form_params: list[tuple[str, str]] = []
        _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {}
        _body_params: bytes | None = None

        # process the path parameters
        if dataset_id is not None:
            _path_params["dataset_id"] = dataset_id
        # process the query parameters
        if page is not None:
            _query_params.append(("page", page))

        if size is not None:
            _query_params.append(("size", size))

        if status is not None:
            _query_params.append(("status", status.value))

        # 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] = ["BearerAuth"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/api/v2/datasets/{dataset_id}/versions",
            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 list_datasets(
        self,
        page: Annotated[StrictInt | None, Field(description="Page number")] = None,
        size: Annotated[StrictInt | None, Field(description="Page size")] = None,
        type: Annotated[StrictStr | None, Field(description="Dataset type filter")] = None,
        is_public: Annotated[StrictBool | None, Field(description="Dataset public visibility filter")] = None,
        status: Annotated[StatusType | None, Field(description="Dataset status filter")] = None,
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GenericResponseListDatasetResp:
        """List datasets

        Get paginated list of datasets with pagination and filtering

        :param page: Page number
        :type page: int
        :param size: Page size
        :type size: int
        :param type: Dataset type filter
        :type type: str
        :param is_public: Dataset public visibility filter
        :type is_public: bool
        :param status: Dataset status filter
        :type status: StatusType
        :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._list_datasets_serialize(
            page=page,
            size=size,
            type=type,
            is_public=is_public,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseListDatasetResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data  # type: ignore

    @validate_call
    def list_datasets_with_http_info(
        self,
        page: Annotated[StrictInt | None, Field(description="Page number")] = None,
        size: Annotated[StrictInt | None, Field(description="Page size")] = None,
        type: Annotated[StrictStr | None, Field(description="Dataset type filter")] = None,
        is_public: Annotated[StrictBool | None, Field(description="Dataset public visibility filter")] = None,
        status: Annotated[StatusType | None, Field(description="Dataset status filter")] = None,
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GenericResponseListDatasetResp]:
        """List datasets

        Get paginated list of datasets with pagination and filtering

        :param page: Page number
        :type page: int
        :param size: Page size
        :type size: int
        :param type: Dataset type filter
        :type type: str
        :param is_public: Dataset public visibility filter
        :type is_public: bool
        :param status: Dataset status filter
        :type status: StatusType
        :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._list_datasets_serialize(
            page=page,
            size=size,
            type=type,
            is_public=is_public,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseListDatasetResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )  # type: ignore

    @validate_call
    def list_datasets_without_preload_content(
        self,
        page: Annotated[StrictInt | None, Field(description="Page number")] = None,
        size: Annotated[StrictInt | None, Field(description="Page size")] = None,
        type: Annotated[StrictStr | None, Field(description="Dataset type filter")] = None,
        is_public: Annotated[StrictBool | None, Field(description="Dataset public visibility filter")] = None,
        status: Annotated[StatusType | None, Field(description="Dataset status filter")] = None,
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List datasets

        Get paginated list of datasets with pagination and filtering

        :param page: Page number
        :type page: int
        :param size: Page size
        :type size: int
        :param type: Dataset type filter
        :type type: str
        :param is_public: Dataset public visibility filter
        :type is_public: bool
        :param status: Dataset status filter
        :type status: StatusType
        :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._list_datasets_serialize(
            page=page,
            size=size,
            type=type,
            is_public=is_public,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseListDatasetResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        return response_data.response

    def _list_datasets_serialize(
        self,
        page,
        size,
        type,
        is_public,
        status,
        _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, str | None] = _headers or {}
        _form_params: list[tuple[str, str]] = []
        _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {}
        _body_params: bytes | None = None

        # process the path parameters
        # process the query parameters
        if page is not None:
            _query_params.append(("page", page))

        if size is not None:
            _query_params.append(("size", size))

        if type is not None:
            _query_params.append(("type", type))

        if is_public is not None:
            _query_params.append(("is_public", is_public))

        if status is not None:
            _query_params.append(("status", status.value))

        # 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] = ["BearerAuth"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/api/v2/datasets",
            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 manage_dataset_version_injections(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        version_id: Annotated[StrictInt, Field(description="Dataset Version ID")],
        manage: Annotated[ManageDatasetVersionInjectionReq, Field(description="Injection management request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GenericResponseDatasetVersionDetailResp:
        """Manage dataset injections

        Add or remove injections for a dataset

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param version_id: Dataset Version ID (required)
        :type version_id: int
        :param manage: Injection management request (required)
        :type manage: ManageDatasetVersionInjectionReq
        :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._manage_dataset_version_injections_serialize(
            dataset_id=dataset_id,
            version_id=version_id,
            manage=manage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseDatasetVersionDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data  # type: ignore

    @validate_call
    def manage_dataset_version_injections_with_http_info(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        version_id: Annotated[StrictInt, Field(description="Dataset Version ID")],
        manage: Annotated[ManageDatasetVersionInjectionReq, Field(description="Injection management request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GenericResponseDatasetVersionDetailResp]:
        """Manage dataset injections

        Add or remove injections for a dataset

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param version_id: Dataset Version ID (required)
        :type version_id: int
        :param manage: Injection management request (required)
        :type manage: ManageDatasetVersionInjectionReq
        :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._manage_dataset_version_injections_serialize(
            dataset_id=dataset_id,
            version_id=version_id,
            manage=manage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseDatasetVersionDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )  # type: ignore

    @validate_call
    def manage_dataset_version_injections_without_preload_content(
        self,
        dataset_id: Annotated[StrictInt, Field(description="Dataset ID")],
        version_id: Annotated[StrictInt, Field(description="Dataset Version ID")],
        manage: Annotated[ManageDatasetVersionInjectionReq, Field(description="Injection management request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Manage dataset injections

        Add or remove injections for a dataset

        :param dataset_id: Dataset ID (required)
        :type dataset_id: int
        :param version_id: Dataset Version ID (required)
        :type version_id: int
        :param manage: Injection management request (required)
        :type manage: ManageDatasetVersionInjectionReq
        :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._manage_dataset_version_injections_serialize(
            dataset_id=dataset_id,
            version_id=version_id,
            manage=manage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseDatasetVersionDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "404": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        return response_data.response

    def _manage_dataset_version_injections_serialize(
        self,
        dataset_id,
        version_id,
        manage,
        _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, str | None] = _headers or {}
        _form_params: list[tuple[str, str]] = []
        _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {}
        _body_params: bytes | None = None

        # process the path parameters
        if dataset_id is not None:
            _path_params["dataset_id"] = dataset_id
        if version_id is not None:
            _path_params["version_id"] = version_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if manage is not None:
            _body_params = manage

        # 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] = ["BearerAuth"]

        return self.api_client.param_serialize(
            method="PATCH",
            resource_path="/api/v2/datasets/{dataset_id}/version/{version_id}/injections",
            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 search_datasets(
        self,
        request: Annotated[SearchDatasetReq, Field(description="Dataset search request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GenericResponseListDatasetDetailResp:
        """Search datasets

        Search datasets with advanced filtering options

        :param request: Dataset search request (required)
        :type request: SearchDatasetReq
        :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._search_datasets_serialize(
            request=request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseListDatasetDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data  # type: ignore

    @validate_call
    def search_datasets_with_http_info(
        self,
        request: Annotated[SearchDatasetReq, Field(description="Dataset search request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GenericResponseListDatasetDetailResp]:
        """Search datasets

        Search datasets with advanced filtering options

        :param request: Dataset search request (required)
        :type request: SearchDatasetReq
        :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._search_datasets_serialize(
            request=request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseListDatasetDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )  # type: ignore

    @validate_call
    def search_datasets_without_preload_content(
        self,
        request: Annotated[SearchDatasetReq, Field(description="Dataset search request")],
        _request_timeout: None
        | Annotated[StrictFloat, Field(gt=0)]
        | tuple[Annotated[StrictStr, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None,
        _request_auth: dict[StrictStr, Any] | None = None,
        _content_type: StrictStr | None = None,
        _headers: dict[StrictStr, Any] | None = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search datasets

        Search datasets with advanced filtering options

        :param request: Dataset search request (required)
        :type request: SearchDatasetReq
        :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._search_datasets_serialize(
            request=request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: dict[str, str | None] = {
            "200": "GenericResponseListDatasetDetailResp",
            "400": "GenericResponseAny",
            "401": "GenericResponseAny",
            "403": "GenericResponseAny",
            "500": "GenericResponseAny",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

        assert response_data is not None and isinstance(response_data, RESTResponse), (
            "Response data must be of type RESTResponse"
        )
        return response_data.response

    def _search_datasets_serialize(
        self,
        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, str | None] = _headers or {}
        _form_params: list[tuple[str, str]] = []
        _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {}
        _body_params: bytes | None = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if request is not None:
            _body_params = 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] = ["BearerAuth"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/api/v2/datasets/search",
            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,
        )
