# coding: utf-8

"""
    Automio API

    Documentation of API endpoints of Automio for SDK

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

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

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

from pydantic import Field, StrictStr
from typing import Any, Optional
from typing_extensions import Annotated
from automio.models.integration import Integration
from automio.models.invoke_parallel_call200_response import InvokeParallelCall200Response
from automio.models.invoke_parallel_call_for_connection200_response import InvokeParallelCallForConnection200Response
from automio.models.invoke_parallel_call_for_connection_request import InvokeParallelCallForConnectionRequest
from automio.models.invoke_parallel_call_request import InvokeParallelCallRequest

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


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

    Do not edit the class manually.
    """

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


    @validate_call
    def integrations_call_create(
        self,
        integration_id: StrictStr,
        integration: Integration,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> Integration:
        """Make a basic API call to the integration's endpoint

        Make a basic API call to the integration's endpoint using the specified method and parameters.

        :param integration_id: (required)
        :type integration_id: str
        :param integration: (required)
        :type integration: Integration
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._integrations_call_create_serialize(
            integration_id=integration_id,
            integration=integration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def integrations_call_create_with_http_info(
        self,
        integration_id: StrictStr,
        integration: Integration,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[Integration]:
        """Make a basic API call to the integration's endpoint

        Make a basic API call to the integration's endpoint using the specified method and parameters.

        :param integration_id: (required)
        :type integration_id: str
        :param integration: (required)
        :type integration: Integration
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._integrations_call_create_serialize(
            integration_id=integration_id,
            integration=integration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def integrations_call_create_without_preload_content(
        self,
        integration_id: StrictStr,
        integration: Integration,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Make a basic API call to the integration's endpoint

        Make a basic API call to the integration's endpoint using the specified method and parameters.

        :param integration_id: (required)
        :type integration_id: str
        :param integration: (required)
        :type integration: Integration
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._integrations_call_create_serialize(
            integration_id=integration_id,
            integration=integration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _integrations_call_create_serialize(
        self,
        integration_id,
        integration,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if integration_id is not None:
            _path_params['integration_id'] = integration_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if integration is not None:
            _body_params = integration


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json', 
                        'application/x-www-form-urlencoded', 
                        'multipart/form-data'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/integrations/{integration_id}/call/',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def invoke_parallel_call(
        self,
        integration_id: StrictStr,
        x_app_id: Annotated[Any, Field(description="The ID of the application")],
        table: Annotated[Optional[Any], Field(description="Table name to use for account resolution and validation.")] = None,
        invoke_parallel_call_request: Optional[InvokeParallelCallRequest] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> InvokeParallelCall200Response:
        """Invoke parallel API calls with connection IDs per data object

        Make parallel API calls where each data object contains its own connection_id. Requests are grouped by connection and executed in parallel within each group.

        :param integration_id: (required)
        :type integration_id: str
        :param x_app_id: The ID of the application (required)
        :type x_app_id: InvokeParallelCallTableParameter
        :param table: Table name to use for account resolution and validation.
        :type table: InvokeParallelCallTableParameter
        :param invoke_parallel_call_request:
        :type invoke_parallel_call_request: InvokeParallelCallRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._invoke_parallel_call_serialize(
            integration_id=integration_id,
            x_app_id=x_app_id,
            table=table,
            invoke_parallel_call_request=invoke_parallel_call_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def invoke_parallel_call_with_http_info(
        self,
        integration_id: StrictStr,
        x_app_id: Annotated[Any, Field(description="The ID of the application")],
        table: Annotated[Optional[Any], Field(description="Table name to use for account resolution and validation.")] = None,
        invoke_parallel_call_request: Optional[InvokeParallelCallRequest] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[InvokeParallelCall200Response]:
        """Invoke parallel API calls with connection IDs per data object

        Make parallel API calls where each data object contains its own connection_id. Requests are grouped by connection and executed in parallel within each group.

        :param integration_id: (required)
        :type integration_id: str
        :param x_app_id: The ID of the application (required)
        :type x_app_id: InvokeParallelCallTableParameter
        :param table: Table name to use for account resolution and validation.
        :type table: InvokeParallelCallTableParameter
        :param invoke_parallel_call_request:
        :type invoke_parallel_call_request: InvokeParallelCallRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._invoke_parallel_call_serialize(
            integration_id=integration_id,
            x_app_id=x_app_id,
            table=table,
            invoke_parallel_call_request=invoke_parallel_call_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def invoke_parallel_call_without_preload_content(
        self,
        integration_id: StrictStr,
        x_app_id: Annotated[Any, Field(description="The ID of the application")],
        table: Annotated[Optional[Any], Field(description="Table name to use for account resolution and validation.")] = None,
        invoke_parallel_call_request: Optional[InvokeParallelCallRequest] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Invoke parallel API calls with connection IDs per data object

        Make parallel API calls where each data object contains its own connection_id. Requests are grouped by connection and executed in parallel within each group.

        :param integration_id: (required)
        :type integration_id: str
        :param x_app_id: The ID of the application (required)
        :type x_app_id: InvokeParallelCallTableParameter
        :param table: Table name to use for account resolution and validation.
        :type table: InvokeParallelCallTableParameter
        :param invoke_parallel_call_request:
        :type invoke_parallel_call_request: InvokeParallelCallRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._invoke_parallel_call_serialize(
            integration_id=integration_id,
            x_app_id=x_app_id,
            table=table,
            invoke_parallel_call_request=invoke_parallel_call_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _invoke_parallel_call_serialize(
        self,
        integration_id,
        x_app_id,
        table,
        invoke_parallel_call_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if integration_id is not None:
            _path_params['integration_id'] = integration_id
        # process the query parameters
        if table is not None:
            
            _query_params.append(('table', table))
            
        # process the header parameters
        if x_app_id is not None:
            _header_params['x-app-id'] = x_app_id
        # process the form parameters
        # process the body parameter
        if invoke_parallel_call_request is not None:
            _body_params = invoke_parallel_call_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/integrations/{integration_id}/parallel_call/',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def invoke_parallel_call_for_connection(
        self,
        connection_id: Annotated[Any, Field(description="Unique identifier for the integration provider account. Defaults to the primary key of the account object. Alternative identifiers may be used based on authentication type: OAuth (email or UID), API Keys (key name), or Basic Authentication (username).")],
        integration_id: StrictStr,
        x_app_id: Annotated[Any, Field(description="The ID of the application")],
        organization_id: Annotated[Optional[Any], Field(description="External organization ID to use for the API calls. If not provided, the user's organization will be used.")] = None,
        table: Annotated[Optional[Any], Field(description="Table name to use for account resolution and validation.")] = None,
        invoke_parallel_call_for_connection_request: Optional[InvokeParallelCallForConnectionRequest] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> InvokeParallelCallForConnection200Response:
        """Invoke a parallel API call for each data object in POST.data_list

        Forward the request to the integration's parallel call endpoint to initiate request for every data object in POST.data_list.

        :param connection_id: Unique identifier for the integration provider account. Defaults to the primary key of the account object. Alternative identifiers may be used based on authentication type: OAuth (email or UID), API Keys (key name), or Basic Authentication (username). (required)
        :type connection_id: InvokeParallelCallTableParameter
        :param integration_id: (required)
        :type integration_id: str
        :param x_app_id: The ID of the application (required)
        :type x_app_id: InvokeParallelCallTableParameter
        :param organization_id: External organization ID to use for the API calls. If not provided, the user's organization will be used.
        :type organization_id: InvokeParallelCallTableParameter
        :param table: Table name to use for account resolution and validation.
        :type table: InvokeParallelCallTableParameter
        :param invoke_parallel_call_for_connection_request:
        :type invoke_parallel_call_for_connection_request: InvokeParallelCallForConnectionRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._invoke_parallel_call_for_connection_serialize(
            connection_id=connection_id,
            integration_id=integration_id,
            x_app_id=x_app_id,
            organization_id=organization_id,
            table=table,
            invoke_parallel_call_for_connection_request=invoke_parallel_call_for_connection_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def invoke_parallel_call_for_connection_with_http_info(
        self,
        connection_id: Annotated[Any, Field(description="Unique identifier for the integration provider account. Defaults to the primary key of the account object. Alternative identifiers may be used based on authentication type: OAuth (email or UID), API Keys (key name), or Basic Authentication (username).")],
        integration_id: StrictStr,
        x_app_id: Annotated[Any, Field(description="The ID of the application")],
        organization_id: Annotated[Optional[Any], Field(description="External organization ID to use for the API calls. If not provided, the user's organization will be used.")] = None,
        table: Annotated[Optional[Any], Field(description="Table name to use for account resolution and validation.")] = None,
        invoke_parallel_call_for_connection_request: Optional[InvokeParallelCallForConnectionRequest] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[InvokeParallelCallForConnection200Response]:
        """Invoke a parallel API call for each data object in POST.data_list

        Forward the request to the integration's parallel call endpoint to initiate request for every data object in POST.data_list.

        :param connection_id: Unique identifier for the integration provider account. Defaults to the primary key of the account object. Alternative identifiers may be used based on authentication type: OAuth (email or UID), API Keys (key name), or Basic Authentication (username). (required)
        :type connection_id: InvokeParallelCallTableParameter
        :param integration_id: (required)
        :type integration_id: str
        :param x_app_id: The ID of the application (required)
        :type x_app_id: InvokeParallelCallTableParameter
        :param organization_id: External organization ID to use for the API calls. If not provided, the user's organization will be used.
        :type organization_id: InvokeParallelCallTableParameter
        :param table: Table name to use for account resolution and validation.
        :type table: InvokeParallelCallTableParameter
        :param invoke_parallel_call_for_connection_request:
        :type invoke_parallel_call_for_connection_request: InvokeParallelCallForConnectionRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._invoke_parallel_call_for_connection_serialize(
            connection_id=connection_id,
            integration_id=integration_id,
            x_app_id=x_app_id,
            organization_id=organization_id,
            table=table,
            invoke_parallel_call_for_connection_request=invoke_parallel_call_for_connection_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def invoke_parallel_call_for_connection_without_preload_content(
        self,
        connection_id: Annotated[Any, Field(description="Unique identifier for the integration provider account. Defaults to the primary key of the account object. Alternative identifiers may be used based on authentication type: OAuth (email or UID), API Keys (key name), or Basic Authentication (username).")],
        integration_id: StrictStr,
        x_app_id: Annotated[Any, Field(description="The ID of the application")],
        organization_id: Annotated[Optional[Any], Field(description="External organization ID to use for the API calls. If not provided, the user's organization will be used.")] = None,
        table: Annotated[Optional[Any], Field(description="Table name to use for account resolution and validation.")] = None,
        invoke_parallel_call_for_connection_request: Optional[InvokeParallelCallForConnectionRequest] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Invoke a parallel API call for each data object in POST.data_list

        Forward the request to the integration's parallel call endpoint to initiate request for every data object in POST.data_list.

        :param connection_id: Unique identifier for the integration provider account. Defaults to the primary key of the account object. Alternative identifiers may be used based on authentication type: OAuth (email or UID), API Keys (key name), or Basic Authentication (username). (required)
        :type connection_id: InvokeParallelCallTableParameter
        :param integration_id: (required)
        :type integration_id: str
        :param x_app_id: The ID of the application (required)
        :type x_app_id: InvokeParallelCallTableParameter
        :param organization_id: External organization ID to use for the API calls. If not provided, the user's organization will be used.
        :type organization_id: InvokeParallelCallTableParameter
        :param table: Table name to use for account resolution and validation.
        :type table: InvokeParallelCallTableParameter
        :param invoke_parallel_call_for_connection_request:
        :type invoke_parallel_call_for_connection_request: InvokeParallelCallForConnectionRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._invoke_parallel_call_for_connection_serialize(
            connection_id=connection_id,
            integration_id=integration_id,
            x_app_id=x_app_id,
            organization_id=organization_id,
            table=table,
            invoke_parallel_call_for_connection_request=invoke_parallel_call_for_connection_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _invoke_parallel_call_for_connection_serialize(
        self,
        connection_id,
        integration_id,
        x_app_id,
        organization_id,
        table,
        invoke_parallel_call_for_connection_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if integration_id is not None:
            _path_params['integration_id'] = integration_id
        # process the query parameters
        if connection_id is not None:
            
            _query_params.append(('connection_id', connection_id))
            
        if organization_id is not None:
            
            _query_params.append(('organization_id', organization_id))
            
        if table is not None:
            
            _query_params.append(('table', table))
            
        # process the header parameters
        if x_app_id is not None:
            _header_params['x-app-id'] = x_app_id
        # process the form parameters
        # process the body parameter
        if invoke_parallel_call_for_connection_request is not None:
            _body_params = invoke_parallel_call_for_connection_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/integrations/{integration_id}/parallel_call_for_connection/',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


