# 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, StrictStr, field_validator
from typing import Optional
from typing_extensions import Annotated
from icat_plus_client.models.ewoks_session_id_jobs_post_request import EwoksSessionIdJobsPostRequest
from icat_plus_client.models.ewoks_session_id_jobs_put_request import EwoksSessionIdJobsPutRequest
from icat_plus_client.models.job import Job

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 EWOKSApi:
    """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 ewoks_session_id_jobs_get(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[Optional[StrictStr], Field(description="Metadata catalogue investigation identifier")] = None,
        dataset_ids: Annotated[Optional[StrictStr], Field(description="Metadata catalogue dataset identifier list (comma separated)")] = None,
        sample_ids: Annotated[Optional[StrictStr], Field(description="Metadata catalogue sample identifiers")] = None,
        job_id: Annotated[Optional[StrictStr], Field(description="The ewoks job identifier")] = None,
        skip: Annotated[Optional[StrictStr], Field(description="the number of entities that will be skipped")] = None,
        limit: Annotated[Optional[StrictStr], Field(description="limit the number of entities retrieved")] = None,
        status: Annotated[Optional[StrictStr], Field(description="list of status, comma separated")] = None,
        start_date: Annotated[Optional[StrictStr], Field(description="start date")] = None,
        end_date: Annotated[Optional[StrictStr], Field(description="end date")] = None,
        search: Annotated[Optional[StrictStr], Field(description="search over status, proposal, sample, datasetname, step name")] = 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,
        all: Annotated[Optional[StrictBool], Field(description="return all jobs the user access to, false by default")] = 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,
    ) -> None:
        """Returns a list of the jobs


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier
        :type investigation_id: str
        :param dataset_ids: Metadata catalogue dataset identifier list (comma separated)
        :type dataset_ids: str
        :param sample_ids: Metadata catalogue sample identifiers
        :type sample_ids: str
        :param job_id: The ewoks job identifier
        :type job_id: str
        :param skip: the number of entities that will be skipped
        :type skip: str
        :param limit: limit the number of entities retrieved
        :type limit: str
        :param status: list of status, comma separated
        :type status: str
        :param start_date: start date
        :type start_date: str
        :param end_date: end date
        :type end_date: str
        :param search: search over status, proposal, sample, datasetname, step name
        :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 all: return all jobs the user access to, false by default
        :type all: 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._ewoks_session_id_jobs_get_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            dataset_ids=dataset_ids,
            sample_ids=sample_ids,
            job_id=job_id,
            skip=skip,
            limit=limit,
            status=status,
            start_date=start_date,
            end_date=end_date,
            search=search,
            sort_by=sort_by,
            sort_order=sort_order,
            all=all,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': None,
            '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 ewoks_session_id_jobs_get_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[Optional[StrictStr], Field(description="Metadata catalogue investigation identifier")] = None,
        dataset_ids: Annotated[Optional[StrictStr], Field(description="Metadata catalogue dataset identifier list (comma separated)")] = None,
        sample_ids: Annotated[Optional[StrictStr], Field(description="Metadata catalogue sample identifiers")] = None,
        job_id: Annotated[Optional[StrictStr], Field(description="The ewoks job identifier")] = None,
        skip: Annotated[Optional[StrictStr], Field(description="the number of entities that will be skipped")] = None,
        limit: Annotated[Optional[StrictStr], Field(description="limit the number of entities retrieved")] = None,
        status: Annotated[Optional[StrictStr], Field(description="list of status, comma separated")] = None,
        start_date: Annotated[Optional[StrictStr], Field(description="start date")] = None,
        end_date: Annotated[Optional[StrictStr], Field(description="end date")] = None,
        search: Annotated[Optional[StrictStr], Field(description="search over status, proposal, sample, datasetname, step name")] = 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,
        all: Annotated[Optional[StrictBool], Field(description="return all jobs the user access to, false by default")] = 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[None]:
        """Returns a list of the jobs


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier
        :type investigation_id: str
        :param dataset_ids: Metadata catalogue dataset identifier list (comma separated)
        :type dataset_ids: str
        :param sample_ids: Metadata catalogue sample identifiers
        :type sample_ids: str
        :param job_id: The ewoks job identifier
        :type job_id: str
        :param skip: the number of entities that will be skipped
        :type skip: str
        :param limit: limit the number of entities retrieved
        :type limit: str
        :param status: list of status, comma separated
        :type status: str
        :param start_date: start date
        :type start_date: str
        :param end_date: end date
        :type end_date: str
        :param search: search over status, proposal, sample, datasetname, step name
        :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 all: return all jobs the user access to, false by default
        :type all: 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._ewoks_session_id_jobs_get_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            dataset_ids=dataset_ids,
            sample_ids=sample_ids,
            job_id=job_id,
            skip=skip,
            limit=limit,
            status=status,
            start_date=start_date,
            end_date=end_date,
            search=search,
            sort_by=sort_by,
            sort_order=sort_order,
            all=all,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': None,
            '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 ewoks_session_id_jobs_get_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        investigation_id: Annotated[Optional[StrictStr], Field(description="Metadata catalogue investigation identifier")] = None,
        dataset_ids: Annotated[Optional[StrictStr], Field(description="Metadata catalogue dataset identifier list (comma separated)")] = None,
        sample_ids: Annotated[Optional[StrictStr], Field(description="Metadata catalogue sample identifiers")] = None,
        job_id: Annotated[Optional[StrictStr], Field(description="The ewoks job identifier")] = None,
        skip: Annotated[Optional[StrictStr], Field(description="the number of entities that will be skipped")] = None,
        limit: Annotated[Optional[StrictStr], Field(description="limit the number of entities retrieved")] = None,
        status: Annotated[Optional[StrictStr], Field(description="list of status, comma separated")] = None,
        start_date: Annotated[Optional[StrictStr], Field(description="start date")] = None,
        end_date: Annotated[Optional[StrictStr], Field(description="end date")] = None,
        search: Annotated[Optional[StrictStr], Field(description="search over status, proposal, sample, datasetname, step name")] = 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,
        all: Annotated[Optional[StrictBool], Field(description="return all jobs the user access to, false by default")] = 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 a list of the jobs


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param investigation_id: Metadata catalogue investigation identifier
        :type investigation_id: str
        :param dataset_ids: Metadata catalogue dataset identifier list (comma separated)
        :type dataset_ids: str
        :param sample_ids: Metadata catalogue sample identifiers
        :type sample_ids: str
        :param job_id: The ewoks job identifier
        :type job_id: str
        :param skip: the number of entities that will be skipped
        :type skip: str
        :param limit: limit the number of entities retrieved
        :type limit: str
        :param status: list of status, comma separated
        :type status: str
        :param start_date: start date
        :type start_date: str
        :param end_date: end date
        :type end_date: str
        :param search: search over status, proposal, sample, datasetname, step name
        :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 all: return all jobs the user access to, false by default
        :type all: 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._ewoks_session_id_jobs_get_serialize(
            session_id=session_id,
            investigation_id=investigation_id,
            dataset_ids=dataset_ids,
            sample_ids=sample_ids,
            job_id=job_id,
            skip=skip,
            limit=limit,
            status=status,
            start_date=start_date,
            end_date=end_date,
            search=search,
            sort_by=sort_by,
            sort_order=sort_order,
            all=all,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _ewoks_session_id_jobs_get_serialize(
        self,
        session_id,
        investigation_id,
        dataset_ids,
        sample_ids,
        job_id,
        skip,
        limit,
        status,
        start_date,
        end_date,
        search,
        sort_by,
        sort_order,
        all,
        _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 dataset_ids is not None:
            
            _query_params.append(('datasetIds', dataset_ids))
            
        if sample_ids is not None:
            
            _query_params.append(('sampleIds', sample_ids))
            
        if job_id is not None:
            
            _query_params.append(('jobId', job_id))
            
        if skip is not None:
            
            _query_params.append(('skip', skip))
            
        if limit is not None:
            
            _query_params.append(('limit', limit))
            
        if status is not None:
            
            _query_params.append(('status', status))
            
        if start_date is not None:
            
            _query_params.append(('startDate', start_date))
            
        if end_date is not None:
            
            _query_params.append(('endDate', end_date))
            
        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 all is not None:
            
            _query_params.append(('all', all))
            
        # 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='/ewoks/{sessionId}/jobs',
            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 ewoks_session_id_jobs_post(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        identifier: Annotated[StrictStr, Field(description="Identifier of the workflow")],
        dataset_ids: Annotated[Optional[StrictStr], Field(description="Metadata catalogue dataset identifier list (comma separated)")] = None,
        ewoks_session_id_jobs_post_request: Annotated[Optional[EwoksSessionIdJobsPostRequest], Field(description="The dictionary with the input parameters")] = 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,
    ) -> None:
        """Launch a job


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param identifier: Identifier of the workflow (required)
        :type identifier: str
        :param dataset_ids: Metadata catalogue dataset identifier list (comma separated)
        :type dataset_ids: str
        :param ewoks_session_id_jobs_post_request: The dictionary with the input parameters
        :type ewoks_session_id_jobs_post_request: EwoksSessionIdJobsPostRequest
        :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._ewoks_session_id_jobs_post_serialize(
            session_id=session_id,
            identifier=identifier,
            dataset_ids=dataset_ids,
            ewoks_session_id_jobs_post_request=ewoks_session_id_jobs_post_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': None,
            '400': "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 ewoks_session_id_jobs_post_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        identifier: Annotated[StrictStr, Field(description="Identifier of the workflow")],
        dataset_ids: Annotated[Optional[StrictStr], Field(description="Metadata catalogue dataset identifier list (comma separated)")] = None,
        ewoks_session_id_jobs_post_request: Annotated[Optional[EwoksSessionIdJobsPostRequest], Field(description="The dictionary with the input parameters")] = 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[None]:
        """Launch a job


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param identifier: Identifier of the workflow (required)
        :type identifier: str
        :param dataset_ids: Metadata catalogue dataset identifier list (comma separated)
        :type dataset_ids: str
        :param ewoks_session_id_jobs_post_request: The dictionary with the input parameters
        :type ewoks_session_id_jobs_post_request: EwoksSessionIdJobsPostRequest
        :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._ewoks_session_id_jobs_post_serialize(
            session_id=session_id,
            identifier=identifier,
            dataset_ids=dataset_ids,
            ewoks_session_id_jobs_post_request=ewoks_session_id_jobs_post_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': None,
            '400': "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 ewoks_session_id_jobs_post_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        identifier: Annotated[StrictStr, Field(description="Identifier of the workflow")],
        dataset_ids: Annotated[Optional[StrictStr], Field(description="Metadata catalogue dataset identifier list (comma separated)")] = None,
        ewoks_session_id_jobs_post_request: Annotated[Optional[EwoksSessionIdJobsPostRequest], Field(description="The dictionary with the input parameters")] = 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:
        """Launch a job


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param identifier: Identifier of the workflow (required)
        :type identifier: str
        :param dataset_ids: Metadata catalogue dataset identifier list (comma separated)
        :type dataset_ids: str
        :param ewoks_session_id_jobs_post_request: The dictionary with the input parameters
        :type ewoks_session_id_jobs_post_request: EwoksSessionIdJobsPostRequest
        :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._ewoks_session_id_jobs_post_serialize(
            session_id=session_id,
            identifier=identifier,
            dataset_ids=dataset_ids,
            ewoks_session_id_jobs_post_request=ewoks_session_id_jobs_post_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _ewoks_session_id_jobs_post_serialize(
        self,
        session_id,
        identifier,
        dataset_ids,
        ewoks_session_id_jobs_post_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, Union[str, bytes]] = {}
        _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 dataset_ids is not None:
            
            _query_params.append(('datasetIds', dataset_ids))
            
        if identifier is not None:
            
            _query_params.append(('identifier', identifier))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if ewoks_session_id_jobs_post_request is not None:
            _body_params = ewoks_session_id_jobs_post_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    '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='/ewoks/{sessionId}/jobs',
            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 ewoks_session_id_jobs_put(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        ewoks_session_id_jobs_put_request: Annotated[EwoksSessionIdJobsPutRequest, Field(description="Job")],
        id: Annotated[Optional[StrictStr], Field(description="Mongo identifier of the job in ICAT+")] = 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,
    ) -> Job:
        """updates a job


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param ewoks_session_id_jobs_put_request: Job (required)
        :type ewoks_session_id_jobs_put_request: EwoksSessionIdJobsPutRequest
        :param id: Mongo identifier of the job in ICAT+
        :type 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._ewoks_session_id_jobs_put_serialize(
            session_id=session_id,
            ewoks_session_id_jobs_put_request=ewoks_session_id_jobs_put_request,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Job",
            '400': "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 ewoks_session_id_jobs_put_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        ewoks_session_id_jobs_put_request: Annotated[EwoksSessionIdJobsPutRequest, Field(description="Job")],
        id: Annotated[Optional[StrictStr], Field(description="Mongo identifier of the job in ICAT+")] = 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[Job]:
        """updates a job


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param ewoks_session_id_jobs_put_request: Job (required)
        :type ewoks_session_id_jobs_put_request: EwoksSessionIdJobsPutRequest
        :param id: Mongo identifier of the job in ICAT+
        :type 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._ewoks_session_id_jobs_put_serialize(
            session_id=session_id,
            ewoks_session_id_jobs_put_request=ewoks_session_id_jobs_put_request,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Job",
            '400': "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 ewoks_session_id_jobs_put_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        ewoks_session_id_jobs_put_request: Annotated[EwoksSessionIdJobsPutRequest, Field(description="Job")],
        id: Annotated[Optional[StrictStr], Field(description="Mongo identifier of the job in ICAT+")] = 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:
        """updates a job


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_id: str
        :param ewoks_session_id_jobs_put_request: Job (required)
        :type ewoks_session_id_jobs_put_request: EwoksSessionIdJobsPutRequest
        :param id: Mongo identifier of the job in ICAT+
        :type 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._ewoks_session_id_jobs_put_serialize(
            session_id=session_id,
            ewoks_session_id_jobs_put_request=ewoks_session_id_jobs_put_request,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _ewoks_session_id_jobs_put_serialize(
        self,
        session_id,
        ewoks_session_id_jobs_put_request,
        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 id is not None:
            
            _query_params.append(('id', id))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if ewoks_session_id_jobs_put_request is not None:
            _body_params = ewoks_session_id_jobs_put_request


        # 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='/ewoks/{sessionId}/jobs',
            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 ewoks_session_id_workflows_get(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        _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:
        """Returns a list with the content of the graph of each workflow


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_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._ewoks_session_id_workflows_get_serialize(
            session_id=session_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': None,
            '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 ewoks_session_id_workflows_get_with_http_info(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        _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]:
        """Returns a list with the content of the graph of each workflow


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_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._ewoks_session_id_workflows_get_serialize(
            session_id=session_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': None,
            '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 ewoks_session_id_workflows_get_without_preload_content(
        self,
        session_id: Annotated[StrictStr, Field(description="session identifier provided by the metadata catalogue")],
        _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 a list with the content of the graph of each workflow


        :param session_id: session identifier provided by the metadata catalogue (required)
        :type session_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._ewoks_session_id_workflows_get_serialize(
            session_id=session_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _ewoks_session_id_workflows_get_serialize(
        self,
        session_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
        # 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='/ewoks/{sessionId}/workflows',
            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
        )


