Module mailslurp_client.api.o_auth_connection_api

MailSlurp API

MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - Homepage - Get an API KEY - Generated SDK Clients - Examples repository # noqa: E501

The version of the OpenAPI document: 6.5.2 Contact: contact@mailslurp.dev Generated by: https://openapi-generator.tech

Classes

class OAuthConnectionApi (api_client=None)

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

Do not edit the class manually.

Expand source code
class OAuthConnectionApi(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()
        self.api_client = api_client

    def create_o_auth_connection(self, redirect_base, o_auth_connection_type, **kwargs):  # noqa: E501
        """Create an OAuth connection  # noqa: E501

        Configure an inbox for OAuth sync with MailSlurp  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_o_auth_connection(redirect_base, o_auth_connection_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str redirect_base: (required)
        :param str o_auth_connection_type: (required)
        :param str email_address:
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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: CreateOAuthConnectionResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.create_o_auth_connection_with_http_info(redirect_base, o_auth_connection_type, **kwargs)  # noqa: E501

    def create_o_auth_connection_with_http_info(self, redirect_base, o_auth_connection_type, **kwargs):  # noqa: E501
        """Create an OAuth connection  # noqa: E501

        Configure an inbox for OAuth sync with MailSlurp  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_o_auth_connection_with_http_info(redirect_base, o_auth_connection_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str redirect_base: (required)
        :param str o_auth_connection_type: (required)
        :param str email_address:
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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: tuple(CreateOAuthConnectionResult, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'redirect_base',
            'o_auth_connection_type',
            'email_address'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_o_auth_connection" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'redirect_base' is set
        if self.api_client.client_side_validation and ('redirect_base' not in local_var_params or  # noqa: E501
                                                        local_var_params['redirect_base'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `redirect_base` when calling `create_o_auth_connection`")  # noqa: E501
        # verify the required parameter 'o_auth_connection_type' is set
        if self.api_client.client_side_validation and ('o_auth_connection_type' not in local_var_params or  # noqa: E501
                                                        local_var_params['o_auth_connection_type'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `o_auth_connection_type` when calling `create_o_auth_connection`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'redirect_base' in local_var_params and local_var_params['redirect_base'] is not None:  # noqa: E501
            query_params.append(('redirectBase', local_var_params['redirect_base']))  # noqa: E501
        if 'o_auth_connection_type' in local_var_params and local_var_params['o_auth_connection_type'] is not None:  # noqa: E501
            query_params.append(('oAuthConnectionType', local_var_params['o_auth_connection_type']))  # noqa: E501
        if 'email_address' in local_var_params and local_var_params['email_address'] is not None:  # noqa: E501
            query_params.append(('emailAddress', local_var_params['email_address']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['*/*'])  # noqa: E501

        # Authentication setting
        auth_settings = ['API_KEY']  # noqa: E501

        return self.api_client.call_api(
            '/oauth-connection', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CreateOAuthConnectionResult',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def exchange_authorization_token_and_create_or_update_inbox(self, authorization_code, redirect_uri, **kwargs):  # noqa: E501
        """Exchange authorization code for access token and create inbox  # noqa: E501

        Exchange an OAuth code for an access token and create an inbox connection in MailSlurp  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.exchange_authorization_token_and_create_or_update_inbox(authorization_code, redirect_uri, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str authorization_code: (required)
        :param str redirect_uri: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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: CreateOAuthExchangeResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.exchange_authorization_token_and_create_or_update_inbox_with_http_info(authorization_code, redirect_uri, **kwargs)  # noqa: E501

    def exchange_authorization_token_and_create_or_update_inbox_with_http_info(self, authorization_code, redirect_uri, **kwargs):  # noqa: E501
        """Exchange authorization code for access token and create inbox  # noqa: E501

        Exchange an OAuth code for an access token and create an inbox connection in MailSlurp  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.exchange_authorization_token_and_create_or_update_inbox_with_http_info(authorization_code, redirect_uri, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str authorization_code: (required)
        :param str redirect_uri: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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: tuple(CreateOAuthExchangeResult, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'authorization_code',
            'redirect_uri'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method exchange_authorization_token_and_create_or_update_inbox" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'authorization_code' is set
        if self.api_client.client_side_validation and ('authorization_code' not in local_var_params or  # noqa: E501
                                                        local_var_params['authorization_code'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `authorization_code` when calling `exchange_authorization_token_and_create_or_update_inbox`")  # noqa: E501
        # verify the required parameter 'redirect_uri' is set
        if self.api_client.client_side_validation and ('redirect_uri' not in local_var_params or  # noqa: E501
                                                        local_var_params['redirect_uri'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `redirect_uri` when calling `exchange_authorization_token_and_create_or_update_inbox`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'authorization_code' in local_var_params and local_var_params['authorization_code'] is not None:  # noqa: E501
            query_params.append(('authorizationCode', local_var_params['authorization_code']))  # noqa: E501
        if 'redirect_uri' in local_var_params and local_var_params['redirect_uri'] is not None:  # noqa: E501
            query_params.append(('redirectUri', local_var_params['redirect_uri']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['*/*'])  # noqa: E501

        # Authentication setting
        auth_settings = ['API_KEY']  # noqa: E501

        return self.api_client.call_api(
            '/oauth-connection/oauth-exchange/google', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CreateOAuthExchangeResult',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

Methods

def create_o_auth_connection(self, redirect_base, o_auth_connection_type, **kwargs)

Create an OAuth connection # noqa: E501

Configure an inbox for OAuth sync with MailSlurp # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.create_o_auth_connection(redirect_base, o_auth_connection_type, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param str redirect_base: (required) :param str o_auth_connection_type: (required) :param str email_address: :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :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: CreateOAuthConnectionResult If the method is called asynchronously, returns the request thread.

def create_o_auth_connection_with_http_info(self, redirect_base, o_auth_connection_type, **kwargs)

Create an OAuth connection # noqa: E501

Configure an inbox for OAuth sync with MailSlurp # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.create_o_auth_connection_with_http_info(redirect_base, o_auth_connection_type, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param str redirect_base: (required) :param str o_auth_connection_type: (required) :param str email_address: :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :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: tuple(CreateOAuthConnectionResult, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread.

def exchange_authorization_token_and_create_or_update_inbox(self, authorization_code, redirect_uri, **kwargs)

Exchange authorization code for access token and create inbox # noqa: E501

Exchange an OAuth code for an access token and create an inbox connection in MailSlurp # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.exchange_authorization_token_and_create_or_update_inbox(authorization_code, redirect_uri, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param str authorization_code: (required) :param str redirect_uri: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :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: CreateOAuthExchangeResult If the method is called asynchronously, returns the request thread.

def exchange_authorization_token_and_create_or_update_inbox_with_http_info(self, authorization_code, redirect_uri, **kwargs)

Exchange authorization code for access token and create inbox # noqa: E501

Exchange an OAuth code for an access token and create an inbox connection in MailSlurp # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.exchange_authorization_token_and_create_or_update_inbox_with_http_info(authorization_code, redirect_uri, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param str authorization_code: (required) :param str redirect_uri: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :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: tuple(CreateOAuthExchangeResult, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread.