# coding: utf-8

"""
    Synctera API

    <h2>Let's build something great.</h2><p>Welcome to the official reference documentation for Synctera APIs. Our APIs are the best way to automate your company's banking needs and are designed to be easy to understand and implement.</p><p>We're continuously growing this library and what you see here is just the start, but if you need something specific or have a question, <a class='text-blue-600' href='https://synctera.com/contact' target='_blank' rel='noreferrer'>contact us</a>.</p>  # noqa: E501

    The version of the OpenAPI document: 1.41.3
    Contact: dev@swadesh.co
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""


import re  # noqa: F401

from pydantic import validate_arguments, ValidationError
from typing_extensions import Annotated

from datetime import date

from pydantic import Field, StrictBool, StrictInt, StrictStr, conint, conlist

from typing import Optional

from synctera_client_v1.models.all_transaction_subtypes import AllTransactionSubtypes
from synctera_client_v1.models.paginated_transactions import PaginatedTransactions
from synctera_client_v1.models.transaction1 import Transaction1
from synctera_client_v1.models.transaction_statuses import TransactionStatuses
from synctera_client_v1.models.transaction_types import TransactionTypes

from synctera_client_v1.api_client import ApiClient
from synctera_client_v1.exceptions import (  # noqa: F401
    ApiTypeError,
    ApiValueError
)


class TransactionsBetaApi(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 get_transaction_by_id(self, id : Annotated[StrictStr, Field(..., description="Transaction ID")], **kwargs) -> Transaction1:  # noqa: E501
        """Get a transaction by ID  # noqa: E501

        > 🚧 Beta > This is a Beta endpoint. Feedback from the community is welcome. We may make breaking changes to this endpoint.  Get a transaction by its uuid   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_transaction_by_id(id, async_req=True)
        >>> result = thread.get()

        :param id: Transaction ID (required)
        :type id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: 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: Transaction1
        """
        kwargs['_return_http_data_only'] = True
        return self.get_transaction_by_id_with_http_info(id, **kwargs)  # noqa: E501

    @validate_arguments
    def get_transaction_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Transaction ID")], **kwargs):  # noqa: E501
        """Get a transaction by ID  # noqa: E501

        > 🚧 Beta > This is a Beta endpoint. Feedback from the community is welcome. We may make breaking changes to this endpoint.  Get a transaction by its uuid   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_transaction_by_id_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param id: Transaction ID (required)
        :type id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: 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(Transaction1, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'id'
        ]
        _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 get_transaction_by_id" % _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', {}))
        # 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 = ['bearerAuth']  # noqa: E501

        _response_types_map = {
            '200': "Transaction1",
            '400': "Error",
            '401': "Error",
            '403': "Error",
            '422': "Error",
            '500': "Error",
        }

        return self.api_client.call_api(
            '/transactions/{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 list_transactions(self, posted_amount : Annotated[Optional[StrictInt], Field(description="Only return transactions equal to the given `posted_amount`")] = None, include_child_transactions : Annotated[Optional[StrictBool], Field(description="Include transactions from sub-accounts when listing transactions for a given account")] = None, amount : Annotated[Optional[StrictInt], Field(description="Only return transactions equal to the given `amount`")] = None, posted_date : Annotated[Optional[date], Field(description="Only return transactions matching the given `posted_date`")] = None, amount_lt : Annotated[Optional[StrictInt], Field(description="Only return transactions with `amount` less than `amount_lt`")] = None, type : Annotated[Optional[conlist(TransactionTypes)], Field(description="Only return transactions matching the given type")] = None, posted_amount_gte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `posted_amount` greater than or equal to `posted_amount_gte`")] = None, posted_amount_lt : Annotated[Optional[StrictInt], Field(description="Only return transactions with `posted_amount` less than `posted_amount_lt`")] = None, posted_amount_lte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `posted_amount` less than or equal to `posted_amount_lte`")] = None, status : Annotated[Optional[conlist(TransactionStatuses)], Field(description="Only return transactions with the given status or statuses")] = None, internal_account_id : Annotated[Optional[StrictStr], Field(description="Only return transactions matching the given `internal_account_id`")] = None, account_id : Annotated[Optional[StrictStr], Field(description="Account ID")] = None, pending_amount_lte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `pending_amount` less than or equal to `pending_amount_lte`")] = None, amount_gte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `amount` greater than or equal to `amount_gte`")] = None, group_id : Annotated[Optional[StrictStr], Field(description="Only return transactions matching the given `group_id`")] = None, pending_amount_gte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `pending_amount` greater than or equal to `pending_amount_gte`")] = None, exclude_jit_transactions : Annotated[Optional[StrictBool], Field(description="Hide \"JIT funding\" transactions from results")] = None, page_token : Optional[StrictStr] = None, card_id : Annotated[Optional[StrictStr], Field(description="Card ID")] = None, pending_amount : Annotated[Optional[StrictInt], Field(description="Only return transactions equal to the given `pending_amount`")] = None, account_source : Annotated[Optional[StrictStr], Field(description="Determines whether to return only transactions against customer accounts (`CUSTOMER`) vs internal accounts (`INTERNAL`). The default is to return all transactions if no `account_source` is specified.")] = None, posted_date_from : Annotated[Optional[date], Field(description="Only return transactions later than the given `posted_date`")] = None, posted_amount_gt : Annotated[Optional[StrictInt], Field(description="only return transactions with `posted_amount` greater than `posted_amount_gt`")] = None, pending_amount_gt : Annotated[Optional[StrictInt], Field(description="only return transactions with `pending_amount` greater than `pending_amount_gt`")] = None, limit : Optional[conint(strict=True, ge=1)] = None, amount_gt : Annotated[Optional[StrictInt], Field(description="Only return transactions with `amount` greater than `amount_gt`")] = None, posted_date_to : Annotated[Optional[date], Field(description="Only return transactions up to the given `posted_date`")] = None, amount_lte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `amount` less than or equal to `amount_lte`")] = None, subtype : Annotated[Optional[conlist(AllTransactionSubtypes)], Field(description="Only return transactions matching the given subtype")] = None, pending_amount_lt : Annotated[Optional[StrictInt], Field(description="Only return transactions with `pending_amount` less than `pending_amount_lt`")] = None, **kwargs) -> PaginatedTransactions:  # noqa: E501
        """List Transactions  # noqa: E501

        > 🚧 Beta > This is a Beta endpoint. Feedback from the community is welcome. We may make breaking changes to this endpoint.  Get paginated list of transactions matching the provided filters   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.list_transactions(posted_amount, include_child_transactions, amount, posted_date, amount_lt, type, posted_amount_gte, posted_amount_lt, posted_amount_lte, status, internal_account_id, account_id, pending_amount_lte, amount_gte, group_id, pending_amount_gte, exclude_jit_transactions, page_token, card_id, pending_amount, account_source, posted_date_from, posted_amount_gt, pending_amount_gt, limit, amount_gt, posted_date_to, amount_lte, subtype, pending_amount_lt, async_req=True)
        >>> result = thread.get()

        :param posted_amount: Only return transactions equal to the given `posted_amount`
        :type posted_amount: int
        :param include_child_transactions: Include transactions from sub-accounts when listing transactions for a given account
        :type include_child_transactions: bool
        :param amount: Only return transactions equal to the given `amount`
        :type amount: int
        :param posted_date: Only return transactions matching the given `posted_date`
        :type posted_date: date
        :param amount_lt: Only return transactions with `amount` less than `amount_lt`
        :type amount_lt: int
        :param type: Only return transactions matching the given type
        :type type: List[TransactionTypes]
        :param posted_amount_gte: Only return transactions with `posted_amount` greater than or equal to `posted_amount_gte`
        :type posted_amount_gte: int
        :param posted_amount_lt: Only return transactions with `posted_amount` less than `posted_amount_lt`
        :type posted_amount_lt: int
        :param posted_amount_lte: Only return transactions with `posted_amount` less than or equal to `posted_amount_lte`
        :type posted_amount_lte: int
        :param status: Only return transactions with the given status or statuses
        :type status: List[TransactionStatuses]
        :param internal_account_id: Only return transactions matching the given `internal_account_id`
        :type internal_account_id: str
        :param account_id: Account ID
        :type account_id: str
        :param pending_amount_lte: Only return transactions with `pending_amount` less than or equal to `pending_amount_lte`
        :type pending_amount_lte: int
        :param amount_gte: Only return transactions with `amount` greater than or equal to `amount_gte`
        :type amount_gte: int
        :param group_id: Only return transactions matching the given `group_id`
        :type group_id: str
        :param pending_amount_gte: Only return transactions with `pending_amount` greater than or equal to `pending_amount_gte`
        :type pending_amount_gte: int
        :param exclude_jit_transactions: Hide \"JIT funding\" transactions from results
        :type exclude_jit_transactions: bool
        :param page_token:
        :type page_token: str
        :param card_id: Card ID
        :type card_id: str
        :param pending_amount: Only return transactions equal to the given `pending_amount`
        :type pending_amount: int
        :param account_source: Determines whether to return only transactions against customer accounts (`CUSTOMER`) vs internal accounts (`INTERNAL`). The default is to return all transactions if no `account_source` is specified.
        :type account_source: str
        :param posted_date_from: Only return transactions later than the given `posted_date`
        :type posted_date_from: date
        :param posted_amount_gt: only return transactions with `posted_amount` greater than `posted_amount_gt`
        :type posted_amount_gt: int
        :param pending_amount_gt: only return transactions with `pending_amount` greater than `pending_amount_gt`
        :type pending_amount_gt: int
        :param limit:
        :type limit: int
        :param amount_gt: Only return transactions with `amount` greater than `amount_gt`
        :type amount_gt: int
        :param posted_date_to: Only return transactions up to the given `posted_date`
        :type posted_date_to: date
        :param amount_lte: Only return transactions with `amount` less than or equal to `amount_lte`
        :type amount_lte: int
        :param subtype: Only return transactions matching the given subtype
        :type subtype: List[AllTransactionSubtypes]
        :param pending_amount_lt: Only return transactions with `pending_amount` less than `pending_amount_lt`
        :type pending_amount_lt: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: 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: PaginatedTransactions
        """
        kwargs['_return_http_data_only'] = True
        return self.list_transactions_with_http_info(posted_amount, include_child_transactions, amount, posted_date, amount_lt, type, posted_amount_gte, posted_amount_lt, posted_amount_lte, status, internal_account_id, account_id, pending_amount_lte, amount_gte, group_id, pending_amount_gte, exclude_jit_transactions, page_token, card_id, pending_amount, account_source, posted_date_from, posted_amount_gt, pending_amount_gt, limit, amount_gt, posted_date_to, amount_lte, subtype, pending_amount_lt, **kwargs)  # noqa: E501

    @validate_arguments
    def list_transactions_with_http_info(self, posted_amount : Annotated[Optional[StrictInt], Field(description="Only return transactions equal to the given `posted_amount`")] = None, include_child_transactions : Annotated[Optional[StrictBool], Field(description="Include transactions from sub-accounts when listing transactions for a given account")] = None, amount : Annotated[Optional[StrictInt], Field(description="Only return transactions equal to the given `amount`")] = None, posted_date : Annotated[Optional[date], Field(description="Only return transactions matching the given `posted_date`")] = None, amount_lt : Annotated[Optional[StrictInt], Field(description="Only return transactions with `amount` less than `amount_lt`")] = None, type : Annotated[Optional[conlist(TransactionTypes)], Field(description="Only return transactions matching the given type")] = None, posted_amount_gte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `posted_amount` greater than or equal to `posted_amount_gte`")] = None, posted_amount_lt : Annotated[Optional[StrictInt], Field(description="Only return transactions with `posted_amount` less than `posted_amount_lt`")] = None, posted_amount_lte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `posted_amount` less than or equal to `posted_amount_lte`")] = None, status : Annotated[Optional[conlist(TransactionStatuses)], Field(description="Only return transactions with the given status or statuses")] = None, internal_account_id : Annotated[Optional[StrictStr], Field(description="Only return transactions matching the given `internal_account_id`")] = None, account_id : Annotated[Optional[StrictStr], Field(description="Account ID")] = None, pending_amount_lte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `pending_amount` less than or equal to `pending_amount_lte`")] = None, amount_gte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `amount` greater than or equal to `amount_gte`")] = None, group_id : Annotated[Optional[StrictStr], Field(description="Only return transactions matching the given `group_id`")] = None, pending_amount_gte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `pending_amount` greater than or equal to `pending_amount_gte`")] = None, exclude_jit_transactions : Annotated[Optional[StrictBool], Field(description="Hide \"JIT funding\" transactions from results")] = None, page_token : Optional[StrictStr] = None, card_id : Annotated[Optional[StrictStr], Field(description="Card ID")] = None, pending_amount : Annotated[Optional[StrictInt], Field(description="Only return transactions equal to the given `pending_amount`")] = None, account_source : Annotated[Optional[StrictStr], Field(description="Determines whether to return only transactions against customer accounts (`CUSTOMER`) vs internal accounts (`INTERNAL`). The default is to return all transactions if no `account_source` is specified.")] = None, posted_date_from : Annotated[Optional[date], Field(description="Only return transactions later than the given `posted_date`")] = None, posted_amount_gt : Annotated[Optional[StrictInt], Field(description="only return transactions with `posted_amount` greater than `posted_amount_gt`")] = None, pending_amount_gt : Annotated[Optional[StrictInt], Field(description="only return transactions with `pending_amount` greater than `pending_amount_gt`")] = None, limit : Optional[conint(strict=True, ge=1)] = None, amount_gt : Annotated[Optional[StrictInt], Field(description="Only return transactions with `amount` greater than `amount_gt`")] = None, posted_date_to : Annotated[Optional[date], Field(description="Only return transactions up to the given `posted_date`")] = None, amount_lte : Annotated[Optional[StrictInt], Field(description="Only return transactions with `amount` less than or equal to `amount_lte`")] = None, subtype : Annotated[Optional[conlist(AllTransactionSubtypes)], Field(description="Only return transactions matching the given subtype")] = None, pending_amount_lt : Annotated[Optional[StrictInt], Field(description="Only return transactions with `pending_amount` less than `pending_amount_lt`")] = None, **kwargs):  # noqa: E501
        """List Transactions  # noqa: E501

        > 🚧 Beta > This is a Beta endpoint. Feedback from the community is welcome. We may make breaking changes to this endpoint.  Get paginated list of transactions matching the provided filters   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.list_transactions_with_http_info(posted_amount, include_child_transactions, amount, posted_date, amount_lt, type, posted_amount_gte, posted_amount_lt, posted_amount_lte, status, internal_account_id, account_id, pending_amount_lte, amount_gte, group_id, pending_amount_gte, exclude_jit_transactions, page_token, card_id, pending_amount, account_source, posted_date_from, posted_amount_gt, pending_amount_gt, limit, amount_gt, posted_date_to, amount_lte, subtype, pending_amount_lt, async_req=True)
        >>> result = thread.get()

        :param posted_amount: Only return transactions equal to the given `posted_amount`
        :type posted_amount: int
        :param include_child_transactions: Include transactions from sub-accounts when listing transactions for a given account
        :type include_child_transactions: bool
        :param amount: Only return transactions equal to the given `amount`
        :type amount: int
        :param posted_date: Only return transactions matching the given `posted_date`
        :type posted_date: date
        :param amount_lt: Only return transactions with `amount` less than `amount_lt`
        :type amount_lt: int
        :param type: Only return transactions matching the given type
        :type type: List[TransactionTypes]
        :param posted_amount_gte: Only return transactions with `posted_amount` greater than or equal to `posted_amount_gte`
        :type posted_amount_gte: int
        :param posted_amount_lt: Only return transactions with `posted_amount` less than `posted_amount_lt`
        :type posted_amount_lt: int
        :param posted_amount_lte: Only return transactions with `posted_amount` less than or equal to `posted_amount_lte`
        :type posted_amount_lte: int
        :param status: Only return transactions with the given status or statuses
        :type status: List[TransactionStatuses]
        :param internal_account_id: Only return transactions matching the given `internal_account_id`
        :type internal_account_id: str
        :param account_id: Account ID
        :type account_id: str
        :param pending_amount_lte: Only return transactions with `pending_amount` less than or equal to `pending_amount_lte`
        :type pending_amount_lte: int
        :param amount_gte: Only return transactions with `amount` greater than or equal to `amount_gte`
        :type amount_gte: int
        :param group_id: Only return transactions matching the given `group_id`
        :type group_id: str
        :param pending_amount_gte: Only return transactions with `pending_amount` greater than or equal to `pending_amount_gte`
        :type pending_amount_gte: int
        :param exclude_jit_transactions: Hide \"JIT funding\" transactions from results
        :type exclude_jit_transactions: bool
        :param page_token:
        :type page_token: str
        :param card_id: Card ID
        :type card_id: str
        :param pending_amount: Only return transactions equal to the given `pending_amount`
        :type pending_amount: int
        :param account_source: Determines whether to return only transactions against customer accounts (`CUSTOMER`) vs internal accounts (`INTERNAL`). The default is to return all transactions if no `account_source` is specified.
        :type account_source: str
        :param posted_date_from: Only return transactions later than the given `posted_date`
        :type posted_date_from: date
        :param posted_amount_gt: only return transactions with `posted_amount` greater than `posted_amount_gt`
        :type posted_amount_gt: int
        :param pending_amount_gt: only return transactions with `pending_amount` greater than `pending_amount_gt`
        :type pending_amount_gt: int
        :param limit:
        :type limit: int
        :param amount_gt: Only return transactions with `amount` greater than `amount_gt`
        :type amount_gt: int
        :param posted_date_to: Only return transactions up to the given `posted_date`
        :type posted_date_to: date
        :param amount_lte: Only return transactions with `amount` less than or equal to `amount_lte`
        :type amount_lte: int
        :param subtype: Only return transactions matching the given subtype
        :type subtype: List[AllTransactionSubtypes]
        :param pending_amount_lt: Only return transactions with `pending_amount` less than `pending_amount_lt`
        :type pending_amount_lt: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: 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(PaginatedTransactions, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'posted_amount',
            'include_child_transactions',
            'amount',
            'posted_date',
            'amount_lt',
            'type',
            'posted_amount_gte',
            'posted_amount_lt',
            'posted_amount_lte',
            'status',
            'internal_account_id',
            'account_id',
            'pending_amount_lte',
            'amount_gte',
            'group_id',
            'pending_amount_gte',
            'exclude_jit_transactions',
            'page_token',
            'card_id',
            'pending_amount',
            'account_source',
            'posted_date_from',
            'posted_amount_gt',
            'pending_amount_gt',
            'limit',
            'amount_gt',
            'posted_date_to',
            'amount_lte',
            'subtype',
            'pending_amount_lt'
        ]
        _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 list_transactions" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

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

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

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

        if _params.get('posted_date') is not None:  # noqa: E501
            if isinstance(_params['posted_date'], datetime):
                _query_parame.append(('posted_date', _params['posted_date'].strftime(self.api_client.configuration.date_format)))
            else:
                _query_params.append(('posted_date', _params['posted_date']))

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

        if _params.get('type') is not None:  # noqa: E501
            _query_params.append(('type', _params['type']))
            _collection_formats['type'] = 'csv'

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

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

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

        if _params.get('status') is not None:  # noqa: E501
            _query_params.append(('status', _params['status']))
            _collection_formats['status'] = 'csv'

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

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

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

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

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

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

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

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

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

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

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

        if _params.get('posted_date_from') is not None:  # noqa: E501
            if isinstance(_params['posted_date_from'], datetime):
                _query_parame.append(('posted_date_from', _params['posted_date_from'].strftime(self.api_client.configuration.date_format)))
            else:
                _query_params.append(('posted_date_from', _params['posted_date_from']))

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

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

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

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

        if _params.get('posted_date_to') is not None:  # noqa: E501
            if isinstance(_params['posted_date_to'], datetime):
                _query_parame.append(('posted_date_to', _params['posted_date_to'].strftime(self.api_client.configuration.date_format)))
            else:
                _query_params.append(('posted_date_to', _params['posted_date_to']))

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

        if _params.get('subtype') is not None:  # noqa: E501
            _query_params.append(('subtype', _params['subtype']))
            _collection_formats['subtype'] = 'csv'

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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # 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 = ['bearerAuth']  # noqa: E501

        _response_types_map = {
            '200': "PaginatedTransactions",
            '400': "Error",
            '401': "Error",
            '403': "Error",
            '422': "Error",
            '500': "Error",
        }

        return self.api_client.call_api(
            '/transactions', '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'))
