# coding: utf-8

"""
    Slack Web API

    One way to interact with the Slack platform is its HTTP RPC-based Web API, a collection of methods requiring OAuth 2.0-based user, bot, or workspace tokens blessed with related OAuth scopes.

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

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

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

from pydantic import Field, StrictBool, StrictStr
from typing import Optional
from typing_extensions import Annotated
from slack_ti.models.default_success_template import DefaultSuccessTemplate

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


class OauthApi:
    """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 oauth_access(
        self,
        client_id: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        client_secret: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        code: Annotated[Optional[StrictStr], Field(description="The `code` param returned via the OAuth callback.")] = None,
        redirect_uri: Annotated[Optional[StrictStr], Field(description="This must match the originally submitted URI (if one was sent).")] = None,
        single_channel: Annotated[Optional[StrictBool], Field(description="Request the user to add your app only to a single channel. Only valid with a [legacy workspace app](https://api.slack.com/legacy-workspace-apps).")] = 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__: Optional[StrictStr] = None,
    ) -> DefaultSuccessTemplate:
        """oauth_access

        Exchanges a temporary OAuth verifier code for an access token.

        :param client_id: Issued when you created your application.
        :type client_id: str
        :param client_secret: Issued when you created your application.
        :type client_secret: str
        :param code: The `code` param returned via the OAuth callback.
        :type code: str
        :param redirect_uri: This must match the originally submitted URI (if one was sent).
        :type redirect_uri: str
        :param single_channel: Request the user to add your app only to a single channel. Only valid with a [legacy workspace app](https://api.slack.com/legacy-workspace-apps).
        :type single_channel: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._oauth_access_serialize(
            client_id=client_id,
            client_secret=client_secret,
            code=code,
            redirect_uri=redirect_uri,
            single_channel=single_channel,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 oauth_access_with_http_info(
        self,
        client_id: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        client_secret: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        code: Annotated[Optional[StrictStr], Field(description="The `code` param returned via the OAuth callback.")] = None,
        redirect_uri: Annotated[Optional[StrictStr], Field(description="This must match the originally submitted URI (if one was sent).")] = None,
        single_channel: Annotated[Optional[StrictBool], Field(description="Request the user to add your app only to a single channel. Only valid with a [legacy workspace app](https://api.slack.com/legacy-workspace-apps).")] = 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__: Optional[StrictStr] = None,
    ) -> ApiResponse[DefaultSuccessTemplate]:
        """oauth_access

        Exchanges a temporary OAuth verifier code for an access token.

        :param client_id: Issued when you created your application.
        :type client_id: str
        :param client_secret: Issued when you created your application.
        :type client_secret: str
        :param code: The `code` param returned via the OAuth callback.
        :type code: str
        :param redirect_uri: This must match the originally submitted URI (if one was sent).
        :type redirect_uri: str
        :param single_channel: Request the user to add your app only to a single channel. Only valid with a [legacy workspace app](https://api.slack.com/legacy-workspace-apps).
        :type single_channel: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._oauth_access_serialize(
            client_id=client_id,
            client_secret=client_secret,
            code=code,
            redirect_uri=redirect_uri,
            single_channel=single_channel,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 oauth_access_without_preload_content(
        self,
        client_id: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        client_secret: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        code: Annotated[Optional[StrictStr], Field(description="The `code` param returned via the OAuth callback.")] = None,
        redirect_uri: Annotated[Optional[StrictStr], Field(description="This must match the originally submitted URI (if one was sent).")] = None,
        single_channel: Annotated[Optional[StrictBool], Field(description="Request the user to add your app only to a single channel. Only valid with a [legacy workspace app](https://api.slack.com/legacy-workspace-apps).")] = 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__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """oauth_access

        Exchanges a temporary OAuth verifier code for an access token.

        :param client_id: Issued when you created your application.
        :type client_id: str
        :param client_secret: Issued when you created your application.
        :type client_secret: str
        :param code: The `code` param returned via the OAuth callback.
        :type code: str
        :param redirect_uri: This must match the originally submitted URI (if one was sent).
        :type redirect_uri: str
        :param single_channel: Request the user to add your app only to a single channel. Only valid with a [legacy workspace app](https://api.slack.com/legacy-workspace-apps).
        :type single_channel: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._oauth_access_serialize(
            client_id=client_id,
            client_secret=client_secret,
            code=code,
            redirect_uri=redirect_uri,
            single_channel=single_channel,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _oauth_access_serialize(
        self,
        client_id,
        client_secret,
        code,
        redirect_uri,
        single_channel,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _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
        # process the query parameters
        if client_id is not None:
            
            _query_params.append(('client_id', client_id))
            
        if client_secret is not None:
            
            _query_params.append(('client_secret', client_secret))
            
        if code is not None:
            
            _query_params.append(('code', code))
            
        if redirect_uri is not None:
            
            _query_params.append(('redirect_uri', redirect_uri))
            
        if single_channel is not None:
            
            _query_params.append(('single_channel', single_channel))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


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


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/oauth.access',
            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 oauth_token(
        self,
        client_id: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        client_secret: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        code: Annotated[Optional[StrictStr], Field(description="The `code` param returned via the OAuth callback.")] = None,
        redirect_uri: Annotated[Optional[StrictStr], Field(description="This must match the originally submitted URI (if one was sent).")] = None,
        single_channel: Annotated[Optional[StrictBool], Field(description="Request the user to add your app only to a single channel.")] = 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__: Optional[StrictStr] = None,
    ) -> DefaultSuccessTemplate:
        """oauth_token

        Exchanges a temporary OAuth verifier code for a workspace token.

        :param client_id: Issued when you created your application.
        :type client_id: str
        :param client_secret: Issued when you created your application.
        :type client_secret: str
        :param code: The `code` param returned via the OAuth callback.
        :type code: str
        :param redirect_uri: This must match the originally submitted URI (if one was sent).
        :type redirect_uri: str
        :param single_channel: Request the user to add your app only to a single channel.
        :type single_channel: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._oauth_token_serialize(
            client_id=client_id,
            client_secret=client_secret,
            code=code,
            redirect_uri=redirect_uri,
            single_channel=single_channel,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 oauth_token_with_http_info(
        self,
        client_id: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        client_secret: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        code: Annotated[Optional[StrictStr], Field(description="The `code` param returned via the OAuth callback.")] = None,
        redirect_uri: Annotated[Optional[StrictStr], Field(description="This must match the originally submitted URI (if one was sent).")] = None,
        single_channel: Annotated[Optional[StrictBool], Field(description="Request the user to add your app only to a single channel.")] = 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__: Optional[StrictStr] = None,
    ) -> ApiResponse[DefaultSuccessTemplate]:
        """oauth_token

        Exchanges a temporary OAuth verifier code for a workspace token.

        :param client_id: Issued when you created your application.
        :type client_id: str
        :param client_secret: Issued when you created your application.
        :type client_secret: str
        :param code: The `code` param returned via the OAuth callback.
        :type code: str
        :param redirect_uri: This must match the originally submitted URI (if one was sent).
        :type redirect_uri: str
        :param single_channel: Request the user to add your app only to a single channel.
        :type single_channel: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._oauth_token_serialize(
            client_id=client_id,
            client_secret=client_secret,
            code=code,
            redirect_uri=redirect_uri,
            single_channel=single_channel,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 oauth_token_without_preload_content(
        self,
        client_id: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        client_secret: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        code: Annotated[Optional[StrictStr], Field(description="The `code` param returned via the OAuth callback.")] = None,
        redirect_uri: Annotated[Optional[StrictStr], Field(description="This must match the originally submitted URI (if one was sent).")] = None,
        single_channel: Annotated[Optional[StrictBool], Field(description="Request the user to add your app only to a single channel.")] = 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__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """oauth_token

        Exchanges a temporary OAuth verifier code for a workspace token.

        :param client_id: Issued when you created your application.
        :type client_id: str
        :param client_secret: Issued when you created your application.
        :type client_secret: str
        :param code: The `code` param returned via the OAuth callback.
        :type code: str
        :param redirect_uri: This must match the originally submitted URI (if one was sent).
        :type redirect_uri: str
        :param single_channel: Request the user to add your app only to a single channel.
        :type single_channel: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._oauth_token_serialize(
            client_id=client_id,
            client_secret=client_secret,
            code=code,
            redirect_uri=redirect_uri,
            single_channel=single_channel,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _oauth_token_serialize(
        self,
        client_id,
        client_secret,
        code,
        redirect_uri,
        single_channel,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _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
        # process the query parameters
        if client_id is not None:
            
            _query_params.append(('client_id', client_id))
            
        if client_secret is not None:
            
            _query_params.append(('client_secret', client_secret))
            
        if code is not None:
            
            _query_params.append(('code', code))
            
        if redirect_uri is not None:
            
            _query_params.append(('redirect_uri', redirect_uri))
            
        if single_channel is not None:
            
            _query_params.append(('single_channel', single_channel))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


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


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/oauth.token',
            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 oauth_v2_access_0(
        self,
        code: Annotated[StrictStr, Field(description="The `code` param returned via the OAuth callback.")],
        client_id: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        client_secret: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        redirect_uri: Annotated[Optional[StrictStr], Field(description="This must match the originally submitted URI (if one was sent).")] = 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__: Optional[StrictStr] = None,
    ) -> DefaultSuccessTemplate:
        """oauth_v2_access_0

        Exchanges a temporary OAuth verifier code for an access token.

        :param code: The `code` param returned via the OAuth callback. (required)
        :type code: str
        :param client_id: Issued when you created your application.
        :type client_id: str
        :param client_secret: Issued when you created your application.
        :type client_secret: str
        :param redirect_uri: This must match the originally submitted URI (if one was sent).
        :type redirect_uri: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._oauth_v2_access_0_serialize(
            code=code,
            client_id=client_id,
            client_secret=client_secret,
            redirect_uri=redirect_uri,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 oauth_v2_access_0_with_http_info(
        self,
        code: Annotated[StrictStr, Field(description="The `code` param returned via the OAuth callback.")],
        client_id: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        client_secret: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        redirect_uri: Annotated[Optional[StrictStr], Field(description="This must match the originally submitted URI (if one was sent).")] = 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__: Optional[StrictStr] = None,
    ) -> ApiResponse[DefaultSuccessTemplate]:
        """oauth_v2_access_0

        Exchanges a temporary OAuth verifier code for an access token.

        :param code: The `code` param returned via the OAuth callback. (required)
        :type code: str
        :param client_id: Issued when you created your application.
        :type client_id: str
        :param client_secret: Issued when you created your application.
        :type client_secret: str
        :param redirect_uri: This must match the originally submitted URI (if one was sent).
        :type redirect_uri: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._oauth_v2_access_0_serialize(
            code=code,
            client_id=client_id,
            client_secret=client_secret,
            redirect_uri=redirect_uri,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 oauth_v2_access_0_without_preload_content(
        self,
        code: Annotated[StrictStr, Field(description="The `code` param returned via the OAuth callback.")],
        client_id: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        client_secret: Annotated[Optional[StrictStr], Field(description="Issued when you created your application.")] = None,
        redirect_uri: Annotated[Optional[StrictStr], Field(description="This must match the originally submitted URI (if one was sent).")] = 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__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """oauth_v2_access_0

        Exchanges a temporary OAuth verifier code for an access token.

        :param code: The `code` param returned via the OAuth callback. (required)
        :type code: str
        :param client_id: Issued when you created your application.
        :type client_id: str
        :param client_secret: Issued when you created your application.
        :type client_secret: str
        :param redirect_uri: This must match the originally submitted URI (if one was sent).
        :type redirect_uri: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._oauth_v2_access_0_serialize(
            code=code,
            client_id=client_id,
            client_secret=client_secret,
            redirect_uri=redirect_uri,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _oauth_v2_access_0_serialize(
        self,
        code,
        client_id,
        client_secret,
        redirect_uri,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _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
        # process the query parameters
        if client_id is not None:
            
            _query_params.append(('client_id', client_id))
            
        if client_secret is not None:
            
            _query_params.append(('client_secret', client_secret))
            
        if code is not None:
            
            _query_params.append(('code', code))
            
        if redirect_uri is not None:
            
            _query_params.append(('redirect_uri', redirect_uri))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


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


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/oauth.v2.access',
            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__
        )


