# coding: utf-8

"""
    Train Journey

    Demonstrate feature of Aladdin Graph services using train journeys, stations and trains.  # noqa: E501

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

    Do not edit the class manually.
"""


import re  # noqa: F401
import io
import warnings

from pydantic import validate_arguments, ValidationError
from typing_extensions import Annotated

from datetime import datetime

from pydantic import Field, StrictInt, StrictStr, conlist

from typing import Any, Dict, Optional

from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.train_journey_api_cancel_longrunning_operation_request import TrainJourneyAPICancelLongrunningOperationRequest
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_batch_create_train_journeys_request import V1BatchCreateTrainJourneysRequest
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_batch_create_train_journeys_response import V1BatchCreateTrainJourneysResponse
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_batch_delete_train_journeys_request import V1BatchDeleteTrainJourneysRequest
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_batch_delete_train_journeys_response import V1BatchDeleteTrainJourneysResponse
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_batch_update_train_journeys_request import V1BatchUpdateTrainJourneysRequest
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_batch_update_train_journeys_response import V1BatchUpdateTrainJourneysResponse
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_filter_train_journeys_request import V1FilterTrainJourneysRequest
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_filter_train_journeys_response import V1FilterTrainJourneysResponse
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_list_train_journeys_response import V1ListTrainJourneysResponse
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_longrunning_operation import V1LongrunningOperation
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.models.v1_train_journey import V1TrainJourney

from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.api_client import ApiClient
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.api_response import ApiResponse
from aladdinsdk.api.codegen.reference_architecture.demo.train_journey.v1.TrainJourneyAPI.exceptions import (  # noqa: F401
    ApiTypeError,
    ApiValueError
)


class DefaultTrainJourneyAPI(object):
    """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):
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client

    @validate_arguments
    def train_journey_api_batch_create_train_journeys(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : V1BatchCreateTrainJourneysRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> V1BatchCreateTrainJourneysResponse:  # noqa: E501
        """Batch Create train journeys  # noqa: E501

        Batch Create new train journeys  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_batch_create_train_journeys(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: (required)
        :type body: V1BatchCreateTrainJourneysRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1BatchCreateTrainJourneysResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_batch_create_train_journeys_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_batch_create_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_batch_create_train_journeys_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : V1BatchCreateTrainJourneysRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Batch Create train journeys  # noqa: E501

        Batch Create new train journeys  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_batch_create_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: (required)
        :type body: V1BatchCreateTrainJourneysRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1BatchCreateTrainJourneysResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'body',
            'vnd_com_blackrock_channel'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_batch_create_train_journeys" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        if _params['body'] is not None:
            _body_params = _params['body']

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

        # set the HTTP header `Content-Type`
        _content_types_list = _params.get('_content_type',
            self.api_client.select_header_content_type(
                ['application/json']))
        if _content_types_list:
                _header_params['Content-Type'] = _content_types_list

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1BatchCreateTrainJourneysResponse",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys:batchCreate', 'POST',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_batch_delete_train_journeys(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : V1BatchDeleteTrainJourneysRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> V1BatchDeleteTrainJourneysResponse:  # noqa: E501
        """Batch Delete train journeys  # noqa: E501

        Batch Delete specific train journeys.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_batch_delete_train_journeys(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: (required)
        :type body: V1BatchDeleteTrainJourneysRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1BatchDeleteTrainJourneysResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_batch_delete_train_journeys_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_batch_delete_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_batch_delete_train_journeys_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : V1BatchDeleteTrainJourneysRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Batch Delete train journeys  # noqa: E501

        Batch Delete specific train journeys.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_batch_delete_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: (required)
        :type body: V1BatchDeleteTrainJourneysRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1BatchDeleteTrainJourneysResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'body',
            'vnd_com_blackrock_channel'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_batch_delete_train_journeys" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        if _params['body'] is not None:
            _body_params = _params['body']

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

        # set the HTTP header `Content-Type`
        _content_types_list = _params.get('_content_type',
            self.api_client.select_header_content_type(
                ['application/json']))
        if _content_types_list:
                _header_params['Content-Type'] = _content_types_list

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1BatchDeleteTrainJourneysResponse",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys:batchDelete', 'POST',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_batch_update_train_journeys(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : V1BatchUpdateTrainJourneysRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> V1BatchUpdateTrainJourneysResponse:  # noqa: E501
        """Batch Update existing train journeys  # noqa: E501

        Batch Update existing train journeys. If any train journeys do not exist, returns NOT_FOUND  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_batch_update_train_journeys(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: (required)
        :type body: V1BatchUpdateTrainJourneysRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1BatchUpdateTrainJourneysResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_batch_update_train_journeys_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_batch_update_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_batch_update_train_journeys_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : V1BatchUpdateTrainJourneysRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Batch Update existing train journeys  # noqa: E501

        Batch Update existing train journeys. If any train journeys do not exist, returns NOT_FOUND  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_batch_update_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: (required)
        :type body: V1BatchUpdateTrainJourneysRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1BatchUpdateTrainJourneysResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'body',
            'vnd_com_blackrock_channel'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_batch_update_train_journeys" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        if _params['body'] is not None:
            _body_params = _params['body']

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

        # set the HTTP header `Content-Type`
        _content_types_list = _params.get('_content_type',
            self.api_client.select_header_content_type(
                ['application/json']))
        if _content_types_list:
                _header_params['Content-Type'] = _content_types_list

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1BatchUpdateTrainJourneysResponse",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys:batchUpdate', 'POST',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_cancel_longrunning_operation(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="The id of the operation resource to be cancelled.")], body : TrainJourneyAPICancelLongrunningOperationRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> object:  # noqa: E501
        """Starts asynchronous cancellation on a long-running operation  # noqa: E501

        Starts asynchronous cancellation on a long-running operation.  The server makes a best effort to cancel the operation, but success is not guaranteed.  If the server doesn't support this method, it returns `Code.UNIMPLEMENTED`.  Clients can use [LongrunningOperationAPI.GetOperation] or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an [Operation.error][.Operation.error] value with a [Status.code] of 1, corresponding to `Code.CANCELLED`.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_cancel_longrunning_operation(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: The id of the operation resource to be cancelled. (required)
        :type id: str
        :param body: (required)
        :type body: TrainJourneyAPICancelLongrunningOperationRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: object
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_cancel_longrunning_operation_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_cancel_longrunning_operation_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, body, vnd_com_blackrock_channel, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_cancel_longrunning_operation_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="The id of the operation resource to be cancelled.")], body : TrainJourneyAPICancelLongrunningOperationRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Starts asynchronous cancellation on a long-running operation  # noqa: E501

        Starts asynchronous cancellation on a long-running operation.  The server makes a best effort to cancel the operation, but success is not guaranteed.  If the server doesn't support this method, it returns `Code.UNIMPLEMENTED`.  Clients can use [LongrunningOperationAPI.GetOperation] or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an [Operation.error][.Operation.error] value with a [Status.code] of 1, corresponding to `Code.CANCELLED`.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_cancel_longrunning_operation_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: The id of the operation resource to be cancelled. (required)
        :type id: str
        :param body: (required)
        :type body: TrainJourneyAPICancelLongrunningOperationRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'id',
            'body',
            'vnd_com_blackrock_channel'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_cancel_longrunning_operation" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']


        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        if _params['body'] is not None:
            _body_params = _params['body']

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

        # set the HTTP header `Content-Type`
        _content_types_list = _params.get('_content_type',
            self.api_client.select_header_content_type(
                ['application/json']))
        if _content_types_list:
                _header_params['Content-Type'] = _content_types_list

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "object",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/longRunningOperations/{id}:cancel', 'POST',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_create_train_journey(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : Annotated[V1TrainJourney, Field(..., description="The train journey to create.")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> V1TrainJourney:  # noqa: E501
        """Create a train journey  # noqa: E501

        Create a new train journey.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_create_train_journey(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: The train journey to create. (required)
        :type body: V1TrainJourney
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1TrainJourney
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_create_train_journey_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_create_train_journey_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_create_train_journey_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : Annotated[V1TrainJourney, Field(..., description="The train journey to create.")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Create a train journey  # noqa: E501

        Create a new train journey.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_create_train_journey_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: The train journey to create. (required)
        :type body: V1TrainJourney
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1TrainJourney, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'body',
            'vnd_com_blackrock_channel'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_create_train_journey" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        if _params['body'] is not None:
            _body_params = _params['body']

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

        # set the HTTP header `Content-Type`
        _content_types_list = _params.get('_content_type',
            self.api_client.select_header_content_type(
                ['application/json']))
        if _content_types_list:
                _header_params['Content-Type'] = _content_types_list

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1TrainJourney",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys', 'POST',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_delete_train_journey(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="Name of the train journey")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> object:  # noqa: E501
        """Delete a train journey  # noqa: E501

        Delete the specific train journey.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_delete_train_journey(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: Name of the train journey (required)
        :type id: str
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: object
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_delete_train_journey_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_delete_train_journey_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_delete_train_journey_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="Name of the train journey")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Delete a train journey  # noqa: E501

        Delete the specific train journey.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_delete_train_journey_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: Name of the train journey (required)
        :type id: str
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'id',
            'vnd_com_blackrock_channel'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_delete_train_journey" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']


        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "object",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys/{id}', 'DELETE',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_filter_train_journeys(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : V1FilterTrainJourneysRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> V1FilterTrainJourneysResponse:  # noqa: E501
        """Filter train journeys  # noqa: E501

        List train journeys matching a filter for train journeys using the provided filter criteria.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_filter_train_journeys(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: (required)
        :type body: V1FilterTrainJourneysRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1FilterTrainJourneysResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_filter_train_journeys_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_filter_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_filter_train_journeys_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], body : V1FilterTrainJourneysRequest, vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Filter train journeys  # noqa: E501

        List train journeys matching a filter for train journeys using the provided filter criteria.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_filter_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, body, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param body: (required)
        :type body: V1FilterTrainJourneysRequest
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1FilterTrainJourneysResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'body',
            'vnd_com_blackrock_channel'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_filter_train_journeys" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        if _params['body'] is not None:
            _body_params = _params['body']

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

        # set the HTTP header `Content-Type`
        _content_types_list = _params.get('_content_type',
            self.api_client.select_header_content_type(
                ['application/json']))
        if _content_types_list:
                _header_params['Content-Type'] = _content_types_list

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1FilterTrainJourneysResponse",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys:filter', 'POST',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_get_longrunning_operation(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="Id of the LongrunningOperation")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> V1LongrunningOperation:  # noqa: E501
        """Gets the state of a long-running operation  # noqa: E501

        Clients can use this method to poll the operation result at intervals as recommended by the API service.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_get_longrunning_operation(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: Id of the LongrunningOperation (required)
        :type id: str
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1LongrunningOperation
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_get_longrunning_operation_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_get_longrunning_operation_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_get_longrunning_operation_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="Id of the LongrunningOperation")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Gets the state of a long-running operation  # noqa: E501

        Clients can use this method to poll the operation result at intervals as recommended by the API service.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_get_longrunning_operation_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: Id of the LongrunningOperation (required)
        :type id: str
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1LongrunningOperation, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'id',
            'vnd_com_blackrock_channel'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_get_longrunning_operation" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']


        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1LongrunningOperation",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/longRunningOperations/{id}', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_get_train_journey(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="Train journey id")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, expand_mask_expands : Annotated[Optional[conlist(StrictStr)], Field(description="The set of expands - key-value pair strings of format 'resource:slice_to_expand_with'.")] = None, **kwargs) -> V1TrainJourney:  # noqa: E501
        """Get a train journey  # noqa: E501

        Retrieve the specific train journey.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_get_train_journey(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, expand_mask_expands, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: Train journey id (required)
        :type id: str
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param expand_mask_expands: The set of expands - key-value pair strings of format 'resource:slice_to_expand_with'.
        :type expand_mask_expands: List[str]
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1TrainJourney
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_get_train_journey_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_get_train_journey_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, expand_mask_expands, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_get_train_journey_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="Train journey id")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, expand_mask_expands : Annotated[Optional[conlist(StrictStr)], Field(description="The set of expands - key-value pair strings of format 'resource:slice_to_expand_with'.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Get a train journey  # noqa: E501

        Retrieve the specific train journey.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_get_train_journey_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, expand_mask_expands, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: Train journey id (required)
        :type id: str
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param expand_mask_expands: The set of expands - key-value pair strings of format 'resource:slice_to_expand_with'.
        :type expand_mask_expands: List[str]
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1TrainJourney, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'id',
            'vnd_com_blackrock_channel',
            'expand_mask_expands'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_get_train_journey" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']


        # process the query parameters
        _query_params = []
        if _params.get('expand_mask_expands') is not None:  # noqa: E501
            _query_params.append(('expandMask.expands', _params['expand_mask_expands']))
            _collection_formats['expandMask.expands'] = 'multi'

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1TrainJourney",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys/{id}', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_list_train_journeys(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, page_size : Annotated[Optional[StrictInt], Field(description="The maximum number of train journeys to return. The service may return fewer than this value. If unspecified, at most 10 train journeys will be returned. The maximum value is 10; values above 10 will be coerced to 10.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="A page token, received from a previous 'ListTrainJourneys' call. Provide this to retrieve the subsequent page.  When paginating, all other parameters provided to 'ListTrainJourneys' must match the call that provided the page token.")] = None, **kwargs) -> V1ListTrainJourneysResponse:  # noqa: E501
        """Retrieve a list of train journeys  # noqa: E501

        Obtain a list of train journeys. Supports pagination  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_list_train_journeys(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, vnd_com_blackrock_channel, page_size, page_token, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param page_size: The maximum number of train journeys to return. The service may return fewer than this value. If unspecified, at most 10 train journeys will be returned. The maximum value is 10; values above 10 will be coerced to 10.
        :type page_size: int
        :param page_token: A page token, received from a previous 'ListTrainJourneys' call. Provide this to retrieve the subsequent page.  When paginating, all other parameters provided to 'ListTrainJourneys' must match the call that provided the page token.
        :type page_token: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1ListTrainJourneysResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_list_train_journeys_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_list_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, vnd_com_blackrock_channel, page_size, page_token, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_list_train_journeys_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, page_size : Annotated[Optional[StrictInt], Field(description="The maximum number of train journeys to return. The service may return fewer than this value. If unspecified, at most 10 train journeys will be returned. The maximum value is 10; values above 10 will be coerced to 10.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="A page token, received from a previous 'ListTrainJourneys' call. Provide this to retrieve the subsequent page.  When paginating, all other parameters provided to 'ListTrainJourneys' must match the call that provided the page token.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Retrieve a list of train journeys  # noqa: E501

        Obtain a list of train journeys. Supports pagination  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_list_train_journeys_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, vnd_com_blackrock_channel, page_size, page_token, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param page_size: The maximum number of train journeys to return. The service may return fewer than this value. If unspecified, at most 10 train journeys will be returned. The maximum value is 10; values above 10 will be coerced to 10.
        :type page_size: int
        :param page_token: A page token, received from a previous 'ListTrainJourneys' call. Provide this to retrieve the subsequent page.  When paginating, all other parameters provided to 'ListTrainJourneys' must match the call that provided the page token.
        :type page_token: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1ListTrainJourneysResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'vnd_com_blackrock_channel',
            'page_size',
            'page_token'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_list_train_journeys" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        if _params.get('page_size') is not None:  # noqa: E501
            _query_params.append(('pageSize', _params['page_size']))

        if _params.get('page_token') is not None:  # noqa: E501
            _query_params.append(('pageToken', _params['page_token']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1ListTrainJourneysResponse",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_run_train_journey_simulation(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="Name of the train journey to simulate")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> V1LongrunningOperation:  # noqa: E501
        """Run a train journey simulation  # noqa: E501

        Simulate an existing train journey in real time. This returns a long-running operation that will contain a SimulateTrainJourneyResponse when done.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_run_train_journey_simulation(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: Name of the train journey to simulate (required)
        :type id: str
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1LongrunningOperation
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_run_train_journey_simulation_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_run_train_journey_simulation_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_run_train_journey_simulation_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], id : Annotated[StrictStr, Field(..., description="Name of the train journey to simulate")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Run a train journey simulation  # noqa: E501

        Simulate an existing train journey in real time. This returns a long-running operation that will contain a SimulateTrainJourneyResponse when done.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_run_train_journey_simulation_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, id, vnd_com_blackrock_channel, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param id: Name of the train journey to simulate (required)
        :type id: str
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1LongrunningOperation, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'id',
            'vnd_com_blackrock_channel'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_run_train_journey_simulation" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']


        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1LongrunningOperation",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys/{id}:run', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def train_journey_api_update_train_journey(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], train_journey_id : Annotated[StrictStr, Field(..., description="ID describes the computer or human assigned resource identifier.")], body : Annotated[V1TrainJourney, Field(..., description="The train journey to update.")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, update_mask : Annotated[Optional[StrictStr], Field(description="List of fields to be updated.")] = None, **kwargs) -> V1TrainJourney:  # noqa: E501
        """Update an existing train journey  # noqa: E501

        Update a train journey. If the train journey does not exists, returns NOT_FOUND  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_update_train_journey(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, train_journey_id, body, vnd_com_blackrock_channel, update_mask, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param train_journey_id: ID describes the computer or human assigned resource identifier. (required)
        :type train_journey_id: str
        :param body: The train journey to update. (required)
        :type body: V1TrainJourney
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param update_mask: List of fields to be updated.
        :type update_mask: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: V1TrainJourney
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the train_journey_api_update_train_journey_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.train_journey_api_update_train_journey_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, train_journey_id, body, vnd_com_blackrock_channel, update_mask, **kwargs)  # noqa: E501

    @validate_arguments
    def train_journey_api_update_train_journey_with_http_info(self, vnd_com_blackrock_request_id : Annotated[StrictStr, Field(..., description="A unique identifier for this request.")], vnd_com_blackrock_origin_timestamp : Annotated[datetime, Field(..., description="Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231.")], train_journey_id : Annotated[StrictStr, Field(..., description="ID describes the computer or human assigned resource identifier.")], body : Annotated[V1TrainJourney, Field(..., description="The train journey to update.")], vnd_com_blackrock_channel : Annotated[Optional[StrictStr], Field(description="The channel to send the request to")] = None, update_mask : Annotated[Optional[StrictStr], Field(description="List of fields to be updated.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Update an existing train journey  # noqa: E501

        Update a train journey. If the train journey does not exists, returns NOT_FOUND  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.train_journey_api_update_train_journey_with_http_info(vnd_com_blackrock_request_id, vnd_com_blackrock_origin_timestamp, train_journey_id, body, vnd_com_blackrock_channel, update_mask, async_req=True)
        >>> result = thread.get()

        :param vnd_com_blackrock_request_id: A unique identifier for this request. (required)
        :type vnd_com_blackrock_request_id: str
        :param vnd_com_blackrock_origin_timestamp: Timestamp assigned to this request at origin, in \"HTTP-date\" format as defined by RFC 7231. (required)
        :type vnd_com_blackrock_origin_timestamp: datetime
        :param train_journey_id: ID describes the computer or human assigned resource identifier. (required)
        :type train_journey_id: str
        :param body: The train journey to update. (required)
        :type body: V1TrainJourney
        :param vnd_com_blackrock_channel: The channel to send the request to
        :type vnd_com_blackrock_channel: str
        :param update_mask: List of fields to be updated.
        :type update_mask: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(V1TrainJourney, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'vnd_com_blackrock_request_id',
            'vnd_com_blackrock_origin_timestamp',
            'train_journey_id',
            'body',
            'vnd_com_blackrock_channel',
            'update_mask'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method train_journey_api_update_train_journey" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['train_journey_id']:
            _path_params['trainJourney.id'] = _params['train_journey_id']


        # process the query parameters
        _query_params = []
        if _params.get('update_mask') is not None:  # noqa: E501
            _query_params.append(('updateMask', _params['update_mask']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        if _params['vnd_com_blackrock_request_id']:
            _header_params['VND.com.blackrock.Request-ID'] = _params['vnd_com_blackrock_request_id']

        if _params['vnd_com_blackrock_origin_timestamp']:
            _header_params['VND.com.blackrock.Origin-Timestamp'] = _params['vnd_com_blackrock_origin_timestamp']

        if _params['vnd_com_blackrock_channel']:
            _header_params['VND.com.blackrock.Channel'] = _params['vnd_com_blackrock_channel']

        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        if _params['body'] is not None:
            _body_params = _params['body']

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

        # set the HTTP header `Content-Type`
        _content_types_list = _params.get('_content_type',
            self.api_client.select_header_content_type(
                ['application/json']))
        if _content_types_list:
                _header_params['Content-Type'] = _content_types_list

        # authentication setting
        _auth_settings = ['APIKeyHeader', 'OAuth2ClientCredentials', 'basicAuth', 'OAuth2AccessCode', 'ClientKeyHeader']  # noqa: E501

        _response_types_map = {
            '200': "V1TrainJourney",
            '400': "TrainJourneyAPIGetLongrunningOperation400Response",
            '401': "TrainJourneyAPIGetLongrunningOperation400Response",
            '403': "TrainJourneyAPIGetLongrunningOperation400Response",
            '404': "TrainJourneyAPIGetLongrunningOperation400Response",
        }

        return self.api_client.call_api(
            '/trainJourneys/{trainJourney.id}', 'PATCH',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))
