# coding: utf-8

"""
    ICAT+ API

    ICAT+ RESTful API with Swagger

    The version of the OpenAPI document: 1.0.0
    Contact: demariaa@esrf.fr
    Generated by OpenAPI Generator (https://openapi-generator.tech)

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

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

from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator
from typing import List, Optional, Union
from typing_extensions import Annotated
from icat_plus_client.models.samplemetadata_session_id_samples_delete200_response import SamplemetadataSessionIdSamplesDelete200Response
from icat_plus_client.models.samplemetadata_session_id_samples_prefix_get200_response import SamplemetadataSessionIdSamplesPrefixGet200Response
from icat_plus_client.models.samplemetadatasample import Samplemetadatasample
from icat_plus_client.models.samplemetadatasampleacquisition import Samplemetadatasampleacquisition

from icat_plus_client.api_client import ApiClient, RequestSerialized
from icat_plus_client.api_response import ApiResponse
from icat_plus_client.rest import RESTResponseType


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

    Do not edit the class manually.
    """

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


    @validate_call
    def samplemetadata_session_id_samples_acquisition_get(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        proposal: Annotated[StrictStr, Field(description="the name of the proposal")],
        beamline: Annotated[StrictStr, Field(description="the name of the instrument")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[Samplemetadatasampleacquisition]:
        """Returns the list of the samples metadata for a given beamline and proposal. It is used by Daiquiri.


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param proposal: the name of the proposal (required)
        :type proposal: str
        :param beamline: the name of the instrument (required)
        :type beamline: str
        :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._samplemetadata_session_id_samples_acquisition_get_serialize(
            session_id=session_id,
            proposal=proposal,
            beamline=beamline,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_acquisition_get_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        proposal: Annotated[StrictStr, Field(description="the name of the proposal")],
        beamline: Annotated[StrictStr, Field(description="the name of the instrument")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[Samplemetadatasampleacquisition]]:
        """Returns the list of the samples metadata for a given beamline and proposal. It is used by Daiquiri.


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param proposal: the name of the proposal (required)
        :type proposal: str
        :param beamline: the name of the instrument (required)
        :type beamline: str
        :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._samplemetadata_session_id_samples_acquisition_get_serialize(
            session_id=session_id,
            proposal=proposal,
            beamline=beamline,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_acquisition_get_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        proposal: Annotated[StrictStr, Field(description="the name of the proposal")],
        beamline: Annotated[StrictStr, Field(description="the name of the instrument")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the list of the samples metadata for a given beamline and proposal. It is used by Daiquiri.


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param proposal: the name of the proposal (required)
        :type proposal: str
        :param beamline: the name of the instrument (required)
        :type beamline: str
        :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._samplemetadata_session_id_samples_acquisition_get_serialize(
            session_id=session_id,
            proposal=proposal,
            beamline=beamline,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Samplemetadatasampleacquisition]",
            '403': "str",
            '500': "str",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _samplemetadata_session_id_samples_acquisition_get_serialize(
        self,
        session_id,
        proposal,
        beamline,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if session_id is not None:
            _path_params['sessionId'] = session_id
        # process the query parameters
        if proposal is not None:
            
            _query_params.append(('proposal', proposal))
            
        if beamline is not None:
            
            _query_params.append(('beamline', beamline))
            
        # 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', 
                    'text/plain'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/samplemetadata/{sessionId}/samples/acquisition',
            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 samplemetadata_session_id_samples_delete(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_ids: Annotated[StrictStr, Field(description="Sample metadata identifiers comma-separated")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> SamplemetadataSessionIdSamplesDelete200Response:
        """Delete samples with metadata information for the given sampleIds


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_ids: Sample metadata identifiers comma-separated (required)
        :type sample_ids: str
        :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._samplemetadata_session_id_samples_delete_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_ids=sample_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_delete_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_ids: Annotated[StrictStr, Field(description="Sample metadata identifiers comma-separated")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[SamplemetadataSessionIdSamplesDelete200Response]:
        """Delete samples with metadata information for the given sampleIds


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_ids: Sample metadata identifiers comma-separated (required)
        :type sample_ids: str
        :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._samplemetadata_session_id_samples_delete_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_ids=sample_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_delete_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_ids: Annotated[StrictStr, Field(description="Sample metadata identifiers comma-separated")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete samples with metadata information for the given sampleIds


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_ids: Sample metadata identifiers comma-separated (required)
        :type sample_ids: str
        :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._samplemetadata_session_id_samples_delete_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_ids=sample_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _samplemetadata_session_id_samples_delete_serialize(
        self,
        session_id,
        investigation_id,
        sample_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if session_id is not None:
            _path_params['sessionId'] = session_id
        # process the query parameters
        if investigation_id is not None:
            
            _query_params.append(('investigationId', investigation_id))
            
        if sample_ids is not None:
            
            _query_params.append(('sampleIds', sample_ids))
            
        # 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', 
                    'text/plain'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/samplemetadata/{sessionId}/samples',
            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 samplemetadata_session_id_samples_files_delete(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        file_ids: Annotated[StrictStr, Field(description="File identifiers, comma-separated list")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> Samplemetadatasample:
        """Delete metadata files


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param file_ids: File identifiers, comma-separated list (required)
        :type file_ids: str
        :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._samplemetadata_session_id_samples_files_delete_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_id=sample_id,
            file_ids=file_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_files_delete_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        file_ids: Annotated[StrictStr, Field(description="File identifiers, comma-separated list")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[Samplemetadatasample]:
        """Delete metadata files


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param file_ids: File identifiers, comma-separated list (required)
        :type file_ids: str
        :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._samplemetadata_session_id_samples_files_delete_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_id=sample_id,
            file_ids=file_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_files_delete_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        file_ids: Annotated[StrictStr, Field(description="File identifiers, comma-separated list")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete metadata files


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param file_ids: File identifiers, comma-separated list (required)
        :type file_ids: str
        :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._samplemetadata_session_id_samples_files_delete_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_id=sample_id,
            file_ids=file_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Samplemetadatasample",
            '403': "str",
            '404': "str",
            '500': "str",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _samplemetadata_session_id_samples_files_delete_serialize(
        self,
        session_id,
        investigation_id,
        sample_id,
        file_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if session_id is not None:
            _path_params['sessionId'] = session_id
        # process the query parameters
        if investigation_id is not None:
            
            _query_params.append(('investigationId', investigation_id))
            
        if sample_id is not None:
            
            _query_params.append(('sampleId', sample_id))
            
        if file_ids is not None:
            
            _query_params.append(('fileIds', file_ids))
            
        # 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', 
                    'text/plain'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/samplemetadata/{sessionId}/samples/files',
            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 samplemetadata_session_id_samples_files_get(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        file_id: Annotated[StrictStr, Field(description="File identifier")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """Download a metadata file


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param file_id: File identifier (required)
        :type file_id: str
        :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._samplemetadata_session_id_samples_files_get_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_id=sample_id,
            file_id=file_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_files_get_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        file_id: Annotated[StrictStr, Field(description="File identifier")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """Download a metadata file


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param file_id: File identifier (required)
        :type file_id: str
        :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._samplemetadata_session_id_samples_files_get_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_id=sample_id,
            file_id=file_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_files_get_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        file_id: Annotated[StrictStr, Field(description="File identifier")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Download a metadata file


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param file_id: File identifier (required)
        :type file_id: str
        :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._samplemetadata_session_id_samples_files_get_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_id=sample_id,
            file_id=file_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': None,
            '403': "str",
            '404': "str",
            '500': "str",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _samplemetadata_session_id_samples_files_get_serialize(
        self,
        session_id,
        investigation_id,
        sample_id,
        file_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, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, Union[str, bytes]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if session_id is not None:
            _path_params['sessionId'] = session_id
        # process the query parameters
        if investigation_id is not None:
            
            _query_params.append(('investigationId', investigation_id))
            
        if sample_id is not None:
            
            _query_params.append(('sampleId', sample_id))
            
        if file_id is not None:
            
            _query_params.append(('fileId', file_id))
            
        # 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(
                [
                    'text/plain'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/samplemetadata/{sessionId}/samples/files',
            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 samplemetadata_session_id_samples_files_post(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        metadataname: Annotated[StrictStr, Field(description="sampleMetadata name")],
        files: List[Union[StrictBytes, StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> Samplemetadatasample:
        """Upload one or more new files


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param metadataname: sampleMetadata name (required)
        :type metadataname: str
        :param files: (required)
        :type files: List[bytearray]
        :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._samplemetadata_session_id_samples_files_post_serialize(
            session_id=session_id,
            sample_id=sample_id,
            investigation_id=investigation_id,
            metadataname=metadataname,
            files=files,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_files_post_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        metadataname: Annotated[StrictStr, Field(description="sampleMetadata name")],
        files: List[Union[StrictBytes, StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[Samplemetadatasample]:
        """Upload one or more new files


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param metadataname: sampleMetadata name (required)
        :type metadataname: str
        :param files: (required)
        :type files: List[bytearray]
        :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._samplemetadata_session_id_samples_files_post_serialize(
            session_id=session_id,
            sample_id=sample_id,
            investigation_id=investigation_id,
            metadataname=metadataname,
            files=files,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_files_post_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        metadataname: Annotated[StrictStr, Field(description="sampleMetadata name")],
        files: List[Union[StrictBytes, StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Upload one or more new files


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param metadataname: sampleMetadata name (required)
        :type metadataname: str
        :param files: (required)
        :type files: List[bytearray]
        :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._samplemetadata_session_id_samples_files_post_serialize(
            session_id=session_id,
            sample_id=sample_id,
            investigation_id=investigation_id,
            metadataname=metadataname,
            files=files,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Samplemetadatasample",
            '403': "str",
            '404': "str",
            '500': "str",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _samplemetadata_session_id_samples_files_post_serialize(
        self,
        session_id,
        sample_id,
        investigation_id,
        metadataname,
        files,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'files': 'csv',
        }

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

        # process the path parameters
        if session_id is not None:
            _path_params['sessionId'] = session_id
        # process the query parameters
        if sample_id is not None:
            
            _query_params.append(('sampleId', sample_id))
            
        if investigation_id is not None:
            
            _query_params.append(('investigationId', investigation_id))
            
        if metadataname is not None:
            
            _query_params.append(('metadataname', metadataname))
            
        # process the header parameters
        # process the form parameters
        if files is not None:
            _files['files'] = files
        # 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', 
                    'text/plain'
                ]
            )

        # 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(
                    [
                        'multipart/form-data'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/samplemetadata/{sessionId}/samples/files',
            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 samplemetadata_session_id_samples_get(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_ids: Annotated[Optional[StrictStr], Field(description="Sample metadata identifiers comma-separated")] = None,
        limit: Annotated[Optional[StrictStr], Field(description="limit the number of entities retrieved")] = None,
        skip: Annotated[Optional[StrictStr], Field(description="the number of entities that will be skipped")] = None,
        search: Annotated[Optional[StrictStr], Field(description="text to be used for filtering the entities")] = None,
        sort_by: Annotated[Optional[StrictStr], Field(description="field to be sorted by")] = None,
        sort_order: Annotated[Optional[StrictStr], Field(description="order applied to the sorting (-1 or 1) (ascending or descending)")] = None,
        own_only: Annotated[Optional[StrictBool], Field(description="filter by user's sample")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> Samplemetadatasample:
        """Returns the list of the samples with metadata information, user from the sessionId


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_ids: Sample metadata identifiers comma-separated
        :type sample_ids: str
        :param limit: limit the number of entities retrieved
        :type limit: str
        :param skip: the number of entities that will be skipped
        :type skip: str
        :param search: text to be used for filtering the entities
        :type search: str
        :param sort_by: field to be sorted by
        :type sort_by: str
        :param sort_order: order applied to the sorting (-1 or 1) (ascending or descending)
        :type sort_order: str
        :param own_only: filter by user's sample
        :type own_only: bool
        :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._samplemetadata_session_id_samples_get_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_ids=sample_ids,
            limit=limit,
            skip=skip,
            search=search,
            sort_by=sort_by,
            sort_order=sort_order,
            own_only=own_only,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_get_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_ids: Annotated[Optional[StrictStr], Field(description="Sample metadata identifiers comma-separated")] = None,
        limit: Annotated[Optional[StrictStr], Field(description="limit the number of entities retrieved")] = None,
        skip: Annotated[Optional[StrictStr], Field(description="the number of entities that will be skipped")] = None,
        search: Annotated[Optional[StrictStr], Field(description="text to be used for filtering the entities")] = None,
        sort_by: Annotated[Optional[StrictStr], Field(description="field to be sorted by")] = None,
        sort_order: Annotated[Optional[StrictStr], Field(description="order applied to the sorting (-1 or 1) (ascending or descending)")] = None,
        own_only: Annotated[Optional[StrictBool], Field(description="filter by user's sample")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[Samplemetadatasample]:
        """Returns the list of the samples with metadata information, user from the sessionId


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_ids: Sample metadata identifiers comma-separated
        :type sample_ids: str
        :param limit: limit the number of entities retrieved
        :type limit: str
        :param skip: the number of entities that will be skipped
        :type skip: str
        :param search: text to be used for filtering the entities
        :type search: str
        :param sort_by: field to be sorted by
        :type sort_by: str
        :param sort_order: order applied to the sorting (-1 or 1) (ascending or descending)
        :type sort_order: str
        :param own_only: filter by user's sample
        :type own_only: bool
        :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._samplemetadata_session_id_samples_get_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_ids=sample_ids,
            limit=limit,
            skip=skip,
            search=search,
            sort_by=sort_by,
            sort_order=sort_order,
            own_only=own_only,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_get_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        sample_ids: Annotated[Optional[StrictStr], Field(description="Sample metadata identifiers comma-separated")] = None,
        limit: Annotated[Optional[StrictStr], Field(description="limit the number of entities retrieved")] = None,
        skip: Annotated[Optional[StrictStr], Field(description="the number of entities that will be skipped")] = None,
        search: Annotated[Optional[StrictStr], Field(description="text to be used for filtering the entities")] = None,
        sort_by: Annotated[Optional[StrictStr], Field(description="field to be sorted by")] = None,
        sort_order: Annotated[Optional[StrictStr], Field(description="order applied to the sorting (-1 or 1) (ascending or descending)")] = None,
        own_only: Annotated[Optional[StrictBool], Field(description="filter by user's sample")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the list of the samples with metadata information, user from the sessionId


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param sample_ids: Sample metadata identifiers comma-separated
        :type sample_ids: str
        :param limit: limit the number of entities retrieved
        :type limit: str
        :param skip: the number of entities that will be skipped
        :type skip: str
        :param search: text to be used for filtering the entities
        :type search: str
        :param sort_by: field to be sorted by
        :type sort_by: str
        :param sort_order: order applied to the sorting (-1 or 1) (ascending or descending)
        :type sort_order: str
        :param own_only: filter by user's sample
        :type own_only: bool
        :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._samplemetadata_session_id_samples_get_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            sample_ids=sample_ids,
            limit=limit,
            skip=skip,
            search=search,
            sort_by=sort_by,
            sort_order=sort_order,
            own_only=own_only,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _samplemetadata_session_id_samples_get_serialize(
        self,
        session_id,
        investigation_id,
        sample_ids,
        limit,
        skip,
        search,
        sort_by,
        sort_order,
        own_only,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if session_id is not None:
            _path_params['sessionId'] = session_id
        # process the query parameters
        if investigation_id is not None:
            
            _query_params.append(('investigationId', investigation_id))
            
        if sample_ids is not None:
            
            _query_params.append(('sampleIds', sample_ids))
            
        if limit is not None:
            
            _query_params.append(('limit', limit))
            
        if skip is not None:
            
            _query_params.append(('skip', skip))
            
        if search is not None:
            
            _query_params.append(('search', search))
            
        if sort_by is not None:
            
            _query_params.append(('sortBy', sort_by))
            
        if sort_order is not None:
            
            _query_params.append(('sortOrder', sort_order))
            
        if own_only is not None:
            
            _query_params.append(('ownOnly', own_only))
            
        # 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', 
                    'text/plain'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/samplemetadata/{sessionId}/samples',
            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 samplemetadata_session_id_samples_post(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        samplemetadatasample: Annotated[Samplemetadatasample, Field(description="sample")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> Samplemetadatasample:
        """Creates a new sample


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param samplemetadatasample: sample (required)
        :type samplemetadatasample: Samplemetadatasample
        :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._samplemetadata_session_id_samples_post_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            samplemetadatasample=samplemetadatasample,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_post_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        samplemetadatasample: Annotated[Samplemetadatasample, Field(description="sample")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[Samplemetadatasample]:
        """Creates a new sample


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param samplemetadatasample: sample (required)
        :type samplemetadatasample: Samplemetadatasample
        :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._samplemetadata_session_id_samples_post_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            samplemetadatasample=samplemetadatasample,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_post_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        samplemetadatasample: Annotated[Samplemetadatasample, Field(description="sample")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates a new sample


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param samplemetadatasample: sample (required)
        :type samplemetadatasample: Samplemetadatasample
        :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._samplemetadata_session_id_samples_post_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            samplemetadatasample=samplemetadatasample,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _samplemetadata_session_id_samples_post_serialize(
        self,
        session_id,
        investigation_id,
        samplemetadatasample,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if session_id is not None:
            _path_params['sessionId'] = session_id
        # process the query parameters
        if investigation_id is not None:
            
            _query_params.append(('investigationId', investigation_id))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if samplemetadatasample is not None:
            _body_params = samplemetadatasample


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

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/samplemetadata/{sessionId}/samples',
            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 samplemetadata_session_id_samples_prefix_get(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        rule: Annotated[StrictStr, Field(description="rule to be used for the sample prefix")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> SamplemetadataSessionIdSamplesPrefixGet200Response:
        """Returns the prefix of the sample name depending on the rule


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param rule: rule to be used for the sample prefix (required)
        :type rule: str
        :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._samplemetadata_session_id_samples_prefix_get_serialize(
            session_id=session_id,
            rule=rule,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_prefix_get_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        rule: Annotated[StrictStr, Field(description="rule to be used for the sample prefix")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[SamplemetadataSessionIdSamplesPrefixGet200Response]:
        """Returns the prefix of the sample name depending on the rule


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param rule: rule to be used for the sample prefix (required)
        :type rule: str
        :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._samplemetadata_session_id_samples_prefix_get_serialize(
            session_id=session_id,
            rule=rule,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_prefix_get_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        rule: Annotated[StrictStr, Field(description="rule to be used for the sample prefix")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the prefix of the sample name depending on the rule


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param rule: rule to be used for the sample prefix (required)
        :type rule: str
        :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._samplemetadata_session_id_samples_prefix_get_serialize(
            session_id=session_id,
            rule=rule,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _samplemetadata_session_id_samples_prefix_get_serialize(
        self,
        session_id,
        rule,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if session_id is not None:
            _path_params['sessionId'] = session_id
        # process the query parameters
        if rule is not None:
            
            _query_params.append(('rule', rule))
            
        # 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', 
                    'text/plain'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/samplemetadata/{sessionId}/samples/prefix',
            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 samplemetadata_session_id_samples_put(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        samplemetadatasample: Annotated[Samplemetadatasample, Field(description="sample")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> Samplemetadatasample:
        """Update an existing sample


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param samplemetadatasample: sample (required)
        :type samplemetadatasample: Samplemetadatasample
        :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._samplemetadata_session_id_samples_put_serialize(
            session_id=session_id,
            sample_id=sample_id,
            investigation_id=investigation_id,
            samplemetadatasample=samplemetadatasample,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_put_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        samplemetadatasample: Annotated[Samplemetadatasample, Field(description="sample")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[Samplemetadatasample]:
        """Update an existing sample


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param samplemetadatasample: sample (required)
        :type samplemetadatasample: Samplemetadatasample
        :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._samplemetadata_session_id_samples_put_serialize(
            session_id=session_id,
            sample_id=sample_id,
            investigation_id=investigation_id,
            samplemetadatasample=samplemetadatasample,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def samplemetadata_session_id_samples_put_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        sample_id: Annotated[StrictStr, Field(description="Sample metadata identifier")],
        investigation_id: Annotated[StrictStr, Field(description="Metadata catalogue investigation identifier")],
        samplemetadatasample: Annotated[Samplemetadatasample, Field(description="sample")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update an existing sample


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param sample_id: Sample metadata identifier (required)
        :type sample_id: str
        :param investigation_id: Metadata catalogue investigation identifier (required)
        :type investigation_id: str
        :param samplemetadatasample: sample (required)
        :type samplemetadatasample: Samplemetadatasample
        :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._samplemetadata_session_id_samples_put_serialize(
            session_id=session_id,
            sample_id=sample_id,
            investigation_id=investigation_id,
            samplemetadatasample=samplemetadatasample,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Samplemetadatasample",
            '403': "str",
            '404': "str",
            '500': "str",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _samplemetadata_session_id_samples_put_serialize(
        self,
        session_id,
        sample_id,
        investigation_id,
        samplemetadatasample,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if session_id is not None:
            _path_params['sessionId'] = session_id
        # process the query parameters
        if sample_id is not None:
            
            _query_params.append(('sampleId', sample_id))
            
        if investigation_id is not None:
            
            _query_params.append(('investigationId', investigation_id))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if samplemetadatasample is not None:
            _body_params = samplemetadatasample


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

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

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/samplemetadata/{sessionId}/samples',
            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
        )


