"""
    Flex Comms API 2.0

    Communication centralised around construction data  # noqa: E501

    The version of the OpenAPI document: 2.0
    Contact: info@xbim.net
    Generated by: https://openapi-generator.tech
"""


import re  # noqa: F401
import sys  # noqa: F401

from xbim_flex.comms.api_client import ApiClient, Endpoint as _Endpoint
from xbim_flex.comms.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    none_type,
    validate_and_convert_types
)


class InboundMailApi(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
        self.post_endpoint = _Endpoint(
            settings={
                'response_type': None,
                'auth': [],
                'endpoint_path': "/{region}/comms/2.0/InboundMail",
                'operation_id': 'post',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'region',
                    'dkim',
                    'to',
                    'html',
                    '_from',
                    'text',
                    'sender_ip',
                    'envelope',
                    'attachments',
                    'subject',
                    'charsets',
                    'spf',
                    'headers',
                    'attachment_info',
                    'content_ids',
                    'content_list',
                ],
                'required': [
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'region':
                        (str,),
                    'dkim':
                        (str,),
                    'to':
                        (str,),
                    'html':
                        (str,),
                    '_from':
                        (str,),
                    'text':
                        (str,),
                    'sender_ip':
                        (str,),
                    'envelope':
                        (str,),
                    'attachments':
                        (int,),
                    'subject':
                        (str,),
                    'charsets':
                        (str,),
                    'spf':
                        (str,),
                    'headers':
                        (str,),
                    'attachment_info':
                        (str,),
                    'content_ids':
                        (str,),
                    'content_list':
                        (str,),
                },
                'attribute_map': {
                    'region': 'region',
                    'dkim': 'Dkim',
                    'to': 'To',
                    'html': 'Html',
                    '_from': 'From',
                    'text': 'Text',
                    'sender_ip': 'SenderIp',
                    'envelope': 'Envelope',
                    'attachments': 'Attachments',
                    'subject': 'Subject',
                    'charsets': 'Charsets',
                    'spf': 'Spf',
                    'headers': 'Headers',
                    'attachment_info': 'attachment-info',
                    'content_ids': 'content-ids',
                    'content_list': 'ContentList',
                },
                'location_map': {
                    'region': 'path',
                    'dkim': 'form',
                    'to': 'form',
                    'html': 'form',
                    '_from': 'form',
                    'text': 'form',
                    'sender_ip': 'form',
                    'envelope': 'form',
                    'attachments': 'form',
                    'subject': 'form',
                    'charsets': 'form',
                    'spf': 'form',
                    'headers': 'form',
                    'attachment_info': 'form',
                    'content_ids': 'form',
                    'content_list': 'form',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [
                    'multipart/form-data'
                ]
            },
            api_client=api_client
        )

    def post(
        self,
        region="UK",
        **kwargs
    ):
        """Post InboundMail   # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Handles inbound Email messages from Sendgrid.. Return Type:  <br/><br/>    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.post(region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            dkim (str): [optional]
            to (str): [optional]
            html (str): [optional]
            _from (str): [optional]
            text (str): [optional]
            sender_ip (str): [optional]
            envelope (str): [optional]
            attachments (int): [optional]
            subject (str): [optional]
            charsets (str): [optional]
            spf (str): [optional]
            headers (str): [optional]
            attachment_info (str): [optional]
            content_ids (str): [optional]
            content_list (str): [optional]
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): 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.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            None
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['region'] = \
            region
        return self.post_endpoint.call_with_http_info(**kwargs)

