def __init__(self, api_key='', api_client = None):
     self.api_key = api_key
     if api_client:
         self.api_client = api_client
     else:
         self.api_client = ApiClient()
Ejemplo n.º 2
0
class InboundApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, api_key='', api_client=None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def add_domain(self, body={}, **kwargs):  # noqa: E501
        """Add inbound domain  # noqa: E501

        Add an inbound domain to your account.  # noqa: E501
        """
        (data) = self.add_domain_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def add_domain_with_http_info(self, body, **kwargs):  # noqa: E501
        """Add inbound domain  # noqa: E501

        Add an inbound domain to your account.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method add_domain" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/inbound/add-domain',
            'POST',
            body=body_params,
            response_type='InlineResponse2006')  # noqa: E501

    def add_route(self, body={}, **kwargs):  # noqa: E501
        """Add mailbox route  # noqa: E501

        Add a new mailbox route to an inbound domain.  # noqa: E501
        """
        (data) = self.add_route_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def add_route_with_http_info(self, body, **kwargs):  # noqa: E501
        """Add mailbox route  # noqa: E501

        Add a new mailbox route to an inbound domain.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method add_route" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/inbound/add-route',
            'POST',
            body=body_params,
            response_type='InlineResponse20010')  # noqa: E501

    def check_domain(self, body={}, **kwargs):  # noqa: E501
        """Check domain settings  # noqa: E501

        Check the MX settings for an inbound domain. The domain must have already been added with the add-domain call.  # noqa: E501
        """
        (data) = self.check_domain_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def check_domain_with_http_info(self, body, **kwargs):  # noqa: E501
        """Check domain settings  # noqa: E501

        Check the MX settings for an inbound domain. The domain must have already been added with the add-domain call.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method check_domain" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/inbound/check-domain',
            'POST',
            body=body_params,
            response_type='InlineResponse2007')  # noqa: E501

    def delete_domain(self, body={}, **kwargs):  # noqa: E501
        """Delete inbound domain  # noqa: E501

        Delete an inbound domain from the account. All mail will stop routing for this domain immediately.  # noqa: E501
        """
        (data) = self.delete_domain_with_http_info(body,
                                                   **kwargs)  # noqa: E501
        return data

    def delete_domain_with_http_info(self, body, **kwargs):  # noqa: E501
        """Delete inbound domain  # noqa: E501

        Delete an inbound domain from the account. All mail will stop routing for this domain immediately.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method delete_domain" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/inbound/delete-domain',
            'POST',
            body=body_params,
            response_type='InlineResponse2008')  # noqa: E501

    def delete_route(self, body={}, **kwargs):  # noqa: E501
        """Delete mailbox route  # noqa: E501

        Delete an existing inbound mailbox route.  # noqa: E501
        """
        (data) = self.delete_route_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def delete_route_with_http_info(self, body, **kwargs):  # noqa: E501
        """Delete mailbox route  # noqa: E501

        Delete an existing inbound mailbox route.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method delete_route" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/inbound/delete-route',
            'POST',
            body=body_params,
            response_type='InlineResponse20012')  # noqa: E501

    def domains(self, body={}, **kwargs):  # noqa: E501
        """List inbound domains  # noqa: E501

        List the domains that have been configured for inbound delivery.  # noqa: E501
        """
        (data) = self.domains_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def domains_with_http_info(self, body, **kwargs):  # noqa: E501
        """List inbound domains  # noqa: E501

        List the domains that have been configured for inbound delivery.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method domains" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/inbound/domains',
            'POST',
            body=body_params,
            response_type='list[InlineResponse2005]')  # noqa: E501

    def routes(self, body={}, **kwargs):  # noqa: E501
        """List mailbox routes  # noqa: E501

        List the mailbox routes defined for an inbound domain.  # noqa: E501
        """
        (data) = self.routes_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def routes_with_http_info(self, body, **kwargs):  # noqa: E501
        """List mailbox routes  # noqa: E501

        List the mailbox routes defined for an inbound domain.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method routes" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/inbound/routes',
            'POST',
            body=body_params,
            response_type='list[InlineResponse2009]')  # noqa: E501

    def send_raw(self, body={}, **kwargs):  # noqa: E501
        """Send mime document  # noqa: E501

        Take a raw MIME document destined for a domain with inbound domains set up, and send it to the inbound hook exactly as if it had been sent over SMTP.  # noqa: E501
        """
        (data) = self.send_raw_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def send_raw_with_http_info(self, body, **kwargs):  # noqa: E501
        """Send mime document  # noqa: E501

        Take a raw MIME document destined for a domain with inbound domains set up, and send it to the inbound hook exactly as if it had been sent over SMTP.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method send_raw" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/inbound/send-raw',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20013]')  # noqa: E501

    def update_route(self, body={}, **kwargs):  # noqa: E501
        """Update mailbox route  # noqa: E501

        Update the pattern or webhook of an existing inbound mailbox route. If null is provided for any fields, the values will remain unchanged.  # noqa: E501
        """
        (data) = self.update_route_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def update_route_with_http_info(self, body, **kwargs):  # noqa: E501
        """Update mailbox route  # noqa: E501

        Update the pattern or webhook of an existing inbound mailbox route. If null is provided for any fields, the values will remain unchanged.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method update_route" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/inbound/update-route',
            'POST',
            body=body_params,
            response_type='InlineResponse20011')  # noqa: E501
class WebhooksApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_key='', api_client = None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def add(self, body = {}, **kwargs):  # noqa: E501
        """Add webhook  # noqa: E501

        Add a new webhook.  # noqa: E501
        """
        (data) = self.add_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def add_with_http_info(self, body, **kwargs):  # noqa: E501
        """Add webhook  # noqa: E501

        Add a new webhook.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method add" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/webhooks/add', 'POST',
            body=body_params,
            response_type='InlineResponse20072') # noqa: E501

    def delete(self, body = {}, **kwargs):  # noqa: E501
        """Delete webhook  # noqa: E501

        Delete an existing webhook.  # noqa: E501
        """
        (data) = self.delete_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def delete_with_http_info(self, body, **kwargs):  # noqa: E501
        """Delete webhook  # noqa: E501

        Delete an existing webhook.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/webhooks/delete', 'POST',
            body=body_params,
            response_type='InlineResponse20075') # noqa: E501

    def info(self, body = {}, **kwargs):  # noqa: E501
        """Get webhook info  # noqa: E501

        Given the ID of an existing webhook, return the data about it.  # noqa: E501
        """
        (data) = self.info_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def info_with_http_info(self, body, **kwargs):  # noqa: E501
        """Get webhook info  # noqa: E501

        Given the ID of an existing webhook, return the data about it.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method info" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/webhooks/info', 'POST',
            body=body_params,
            response_type='InlineResponse20073') # noqa: E501

    def list(self, body = {}, **kwargs):  # noqa: E501
        """List webhooks  # noqa: E501

        Get the list of all webhooks defined on the account.  # noqa: E501
        """
        (data) = self.list_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def list_with_http_info(self, body, **kwargs):  # noqa: E501
        """List webhooks  # noqa: E501

        Get the list of all webhooks defined on the account.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/webhooks/list', 'POST',
            body=body_params,
            response_type='list[InlineResponse20071]') # noqa: E501

    def update(self, body = {}, **kwargs):  # noqa: E501
        """Update webhook  # noqa: E501

        Update an existing webhook.  # noqa: E501
        """
        (data) = self.update_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def update_with_http_info(self, body, **kwargs):  # noqa: E501
        """Update webhook  # noqa: E501

        Update an existing webhook.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/webhooks/update', 'POST',
            body=body_params,
            response_type='InlineResponse20074') # noqa: E501
class UsersApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_key='', api_client = None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def info(self, body = {}, **kwargs):  # noqa: E501
        """Get user info  # noqa: E501

        Return the information about the API-connected user.  # noqa: E501
        """
        (data) = self.info_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def info_with_http_info(self, body, **kwargs):  # noqa: E501
        """Get user info  # noqa: E501

        Return the information about the API-connected user.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method info" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/users/info', 'POST',
            body=body_params,
            response_type='InlineResponse20069') # noqa: E501

    def ping(self, body = {}, **kwargs):  # noqa: E501
        """Ping  # noqa: E501

        Validate an API key and respond to a ping.  # noqa: E501
        """
        (data) = self.ping_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def ping_with_http_info(self, body, **kwargs):  # noqa: E501
        """Ping  # noqa: E501

        Validate an API key and respond to a ping.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method ping" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/users/ping', 'POST',
            body=body_params,
            response_type='str') # noqa: E501

    def ping2(self, body = {}, **kwargs):  # noqa: E501
        """Ping 2  # noqa: E501

        Validate an API key and respond to a ping (JSON parser version).  # noqa: E501
        """
        (data) = self.ping2_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def ping2_with_http_info(self, body, **kwargs):  # noqa: E501
        """Ping 2  # noqa: E501

        Validate an API key and respond to a ping (JSON parser version).  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method ping2" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/users/ping2', 'POST',
            body=body_params,
            response_type='InlineResponse20070') # noqa: E501

    def senders(self, body = {}, **kwargs):  # noqa: E501
        """List account senders  # noqa: E501

        Return the senders that have tried to use this account, both verified and unverified.  # noqa: E501
        """
        (data) = self.senders_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def senders_with_http_info(self, body, **kwargs):  # noqa: E501
        """List account senders  # noqa: E501

        Return the senders that have tried to use this account, both verified and unverified.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method senders" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/users/senders', 'POST',
            body=body_params,
            response_type='list[InlineResponse20040]') # noqa: E501
Ejemplo n.º 5
0
class ExportsApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, api_key='', api_client=None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def activity(self, body={}, **kwargs):  # noqa: E501
        """Export activity history  # noqa: E501

        Begins an export of your activity history. The activity will be exported to a zip archive containing a single file named activity.csv in the same format as you would be able to export from your account's activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data.  # noqa: E501
        """
        (data) = self.activity_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def activity_with_http_info(self, body, **kwargs):  # noqa: E501
        """Export activity history  # noqa: E501

        Begins an export of your activity history. The activity will be exported to a zip archive containing a single file named activity.csv in the same format as you would be able to export from your account's activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method activity" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/exports/activity',
            'POST',
            body=body_params,
            response_type='InlineResponse2004')  # noqa: E501

    def info(self, body={}, **kwargs):  # noqa: E501
        """View export info  # noqa: E501

        Returns information about an export job. If the export job's state is 'complete', the returned data will include a URL you can use to fetch the results. Every export job produces a zip archive, but the format of the archive is distinct for each job type. The api calls that initiate exports include more details about the output format for that job type.  # noqa: E501
        """
        (data) = self.info_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def info_with_http_info(self, body, **kwargs):  # noqa: E501
        """View export info  # noqa: E501

        Returns information about an export job. If the export job's state is 'complete', the returned data will include a URL you can use to fetch the results. Every export job produces a zip archive, but the format of the archive is distinct for each job type. The api calls that initiate exports include more details about the output format for that job type.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method info" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/exports/info',
            'POST',
            body=body_params,
            response_type='InlineResponse200')  # noqa: E501

    def list(self, body={}, **kwargs):  # noqa: E501
        """List exports  # noqa: E501

        Returns a list of your exports.  # noqa: E501
        """
        (data) = self.list_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def list_with_http_info(self, body, **kwargs):  # noqa: E501
        """List exports  # noqa: E501

        Returns a list of your exports.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method list" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/exports/list',
            'POST',
            body=body_params,
            response_type='list[InlineResponse2001]')  # noqa: E501

    def rejects(self, body={}, **kwargs):  # noqa: E501
        """Export blacklist  # noqa: E501

        Begins an export of your rejection blacklist. The blacklist will be exported to a zip archive containing a single file named rejects.csv that includes the following fields: email, reason, detail, created_at, expires_at, last_event_at, expires_at.  # noqa: E501
        """
        (data) = self.rejects_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def rejects_with_http_info(self, body, **kwargs):  # noqa: E501
        """Export blacklist  # noqa: E501

        Begins an export of your rejection blacklist. The blacklist will be exported to a zip archive containing a single file named rejects.csv that includes the following fields: email, reason, detail, created_at, expires_at, last_event_at, expires_at.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method rejects" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/exports/rejects',
            'POST',
            body=body_params,
            response_type='InlineResponse2002')  # noqa: E501

    def whitelist(self, body={}, **kwargs):  # noqa: E501
        """Export whitelist  # noqa: E501

        Begins an export of your rejection whitelist. The whitelist will be exported to a zip archive containing a single file named whitelist.csv that includes the following fields: email, detail, created_at.  # noqa: E501
        """
        (data) = self.whitelist_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def whitelist_with_http_info(self, body, **kwargs):  # noqa: E501
        """Export whitelist  # noqa: E501

        Begins an export of your rejection whitelist. The whitelist will be exported to a zip archive containing a single file named whitelist.csv that includes the following fields: email, detail, created_at.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method whitelist" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/exports/whitelist',
            'POST',
            body=body_params,
            response_type='InlineResponse2003')  # noqa: E501
class WhitelistsApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_key='', api_client = None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def add(self, body = {}, **kwargs):  # noqa: E501
        """Add email to whitelist  # noqa: E501

        Adds an email to your email rejection whitelist. If the address is currently on your blacklist, that blacklist entry will be removed automatically.  # noqa: E501
        """
        (data) = self.add_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def add_with_http_info(self, body, **kwargs):  # noqa: E501
        """Add email to whitelist  # noqa: E501

        Adds an email to your email rejection whitelist. If the address is currently on your blacklist, that blacklist entry will be removed automatically.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method add" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/whitelists/add', 'POST',
            body=body_params,
            response_type='InlineResponse20076') # noqa: E501

    def delete(self, body = {}, **kwargs):  # noqa: E501
        """Remove email from whitelist  # noqa: E501

        Removes an email address from the whitelist.  # noqa: E501
        """
        (data) = self.delete_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def delete_with_http_info(self, body, **kwargs):  # noqa: E501
        """Remove email from whitelist  # noqa: E501

        Removes an email address from the whitelist.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/whitelists/delete', 'POST',
            body=body_params,
            response_type='InlineResponse20078') # noqa: E501

    def list(self, body = {}, **kwargs):  # noqa: E501
        """List whitelisted emails  # noqa: E501

        Retrieves your email rejection whitelist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results.  # noqa: E501
        """
        (data) = self.list_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def list_with_http_info(self, body, **kwargs):  # noqa: E501
        """List whitelisted emails  # noqa: E501

        Retrieves your email rejection whitelist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/whitelists/list', 'POST',
            body=body_params,
            response_type='list[InlineResponse20077]') # noqa: E501
class MessagesApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, api_key='', api_client=None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def cancel_scheduled(self, body={}, **kwargs):  # noqa: E501
        """Cancel scheduled email  # noqa: E501

        Cancels a scheduled email.  # noqa: E501
        """
        (data) = self.cancel_scheduled_with_http_info(body,
                                                      **kwargs)  # noqa: E501
        return data

    def cancel_scheduled_with_http_info(self, body, **kwargs):  # noqa: E501
        """Cancel scheduled email  # noqa: E501

        Cancels a scheduled email.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method cancel_scheduled" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/cancel-scheduled',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20032]')  # noqa: E501

    def content(self, body={}, **kwargs):  # noqa: E501
        """Get message content  # noqa: E501

        Get the full content of a recently sent message.  # noqa: E501
        """
        (data) = self.content_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def content_with_http_info(self, body, **kwargs):  # noqa: E501
        """Get message content  # noqa: E501

        Get the full content of a recently sent message.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method content" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/content',
            'POST',
            body=body_params,
            response_type='InlineResponse20030')  # noqa: E501

    def info(self, body={}, **kwargs):  # noqa: E501
        """Get message info  # noqa: E501

        Get the information for a single recently sent message.  # noqa: E501
        """
        (data) = self.info_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def info_with_http_info(self, body, **kwargs):  # noqa: E501
        """Get message info  # noqa: E501

        Get the information for a single recently sent message.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method info" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/info',
            'POST',
            body=body_params,
            response_type='InlineResponse20029')  # noqa: E501

    def list_scheduled(self, body={}, **kwargs):  # noqa: E501
        """List scheduled emails  # noqa: E501

        Queries your scheduled emails.  # noqa: E501
        """
        (data) = self.list_scheduled_with_http_info(body,
                                                    **kwargs)  # noqa: E501
        return data

    def list_scheduled_with_http_info(self, body, **kwargs):  # noqa: E501
        """List scheduled emails  # noqa: E501

        Queries your scheduled emails.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method list_scheduled" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/list-scheduled',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20032]')  # noqa: E501

    def parse(self, body={}, **kwargs):  # noqa: E501
        """Parse mime document  # noqa: E501

        Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces.  # noqa: E501
        """
        (data) = self.parse_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def parse_with_http_info(self, body, **kwargs):  # noqa: E501
        """Parse mime document  # noqa: E501

        Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method parse" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/parse',
            'POST',
            body=body_params,
            response_type='InlineResponse20031')  # noqa: E501

    def reschedule(self, body={}, **kwargs):  # noqa: E501
        """Reschedule email  # noqa: E501

        Reschedules a scheduled email.  # noqa: E501
        """
        (data) = self.reschedule_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def reschedule_with_http_info(self, body, **kwargs):  # noqa: E501
        """Reschedule email  # noqa: E501

        Reschedules a scheduled email.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method reschedule" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/reschedule',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20032]')  # noqa: E501

    def search(self, body={}, **kwargs):  # noqa: E501
        """Search messages by date  # noqa: E501

        Search recently sent messages and optionally narrow by date range, tags, senders, and API keys. If no date range is specified, results within the last 7 days are returned. This method may be called up to 20 times per minute. If you need the data more often, you can use /messages/info.json to get the information for a single message, or webhooks to push activity to your own application for querying.  # noqa: E501
        """
        (data) = self.search_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def search_with_http_info(self, body, **kwargs):  # noqa: E501
        """Search messages by date  # noqa: E501

        Search recently sent messages and optionally narrow by date range, tags, senders, and API keys. If no date range is specified, results within the last 7 days are returned. This method may be called up to 20 times per minute. If you need the data more often, you can use /messages/info.json to get the information for a single message, or webhooks to push activity to your own application for querying.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method search" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/search',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20027]')  # noqa: E501

    def search_time_series(self, body={}, **kwargs):  # noqa: E501
        """Search messages by hour  # noqa: E501

        Search the content of recently sent messages and return the aggregated hourly stats for matching messages.  # noqa: E501
        """
        (data) = self.search_time_series_with_http_info(body,
                                                        **kwargs)  # noqa: E501
        return data

    def search_time_series_with_http_info(self, body, **kwargs):  # noqa: E501
        """Search messages by hour  # noqa: E501

        Search the content of recently sent messages and return the aggregated hourly stats for matching messages.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method search_time_series" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/search-time-series',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20028]')  # noqa: E501

    def send(self, body={}, **kwargs):  # noqa: E501
        """Send new message  # noqa: E501

        Send a new transactional message through the Transactional API.  # noqa: E501
        """
        (data) = self.send_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def send_with_http_info(self, body, **kwargs):  # noqa: E501
        """Send new message  # noqa: E501

        Send a new transactional message through the Transactional API.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method send" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/send',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20025]')  # noqa: E501

    def send_raw(self, body={}, **kwargs):  # noqa: E501
        """Send mime document  # noqa: E501

        Take a raw MIME document for a message, and send it exactly as if it were sent through the Transactional API's SMTP servers.  # noqa: E501
        """
        (data) = self.send_raw_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def send_raw_with_http_info(self, body, **kwargs):  # noqa: E501
        """Send mime document  # noqa: E501

        Take a raw MIME document for a message, and send it exactly as if it were sent through the Transactional API's SMTP servers.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method send_raw" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api('/messages/send-raw',
                                        'POST',
                                        body=body_params,
                                        response_type='object')  # noqa: E501

    def send_template(self, body={}, **kwargs):  # noqa: E501
        """Send using message template  # noqa: E501

        Send a new transactional message through the Transactional API using a template.  # noqa: E501
        """
        (data) = self.send_template_with_http_info(body,
                                                   **kwargs)  # noqa: E501
        return data

    def send_template_with_http_info(self, body, **kwargs):  # noqa: E501
        """Send using message template  # noqa: E501

        Send a new transactional message through the Transactional API using a template.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method send_template" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/messages/send-template',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20026]')  # noqa: E501
class UrlsApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_key='', api_client = None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def add_tracking_domain(self, body = {}, **kwargs):  # noqa: E501
        """Add tracking domains  # noqa: E501

        Add a tracking domain to your account.  # noqa: E501
        """
        (data) = self.add_tracking_domain_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def add_tracking_domain_with_http_info(self, body, **kwargs):  # noqa: E501
        """Add tracking domains  # noqa: E501

        Add a tracking domain to your account.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method add_tracking_domain" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/urls/add-tracking-domain', 'POST',
            body=body_params,
            response_type='InlineResponse20068') # noqa: E501

    def check_tracking_domain(self, body = {}, **kwargs):  # noqa: E501
        """Check cname settings  # noqa: E501

        Checks the CNAME settings for a tracking domain. The domain must have been added already with the add-tracking-domain call.  # noqa: E501
        """
        (data) = self.check_tracking_domain_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def check_tracking_domain_with_http_info(self, body, **kwargs):  # noqa: E501
        """Check cname settings  # noqa: E501

        Checks the CNAME settings for a tracking domain. The domain must have been added already with the add-tracking-domain call.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method check_tracking_domain" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/urls/check-tracking-domain', 'POST',
            body=body_params,
            response_type='InlineResponse20068') # noqa: E501

    def list(self, body = {}, **kwargs):  # noqa: E501
        """List most clicked urls  # noqa: E501

        Get the 100 most clicked URLs.  # noqa: E501
        """
        (data) = self.list_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def list_with_http_info(self, body, **kwargs):  # noqa: E501
        """List most clicked urls  # noqa: E501

        Get the 100 most clicked URLs.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/urls/list', 'POST',
            body=body_params,
            response_type='list[InlineResponse20064]') # noqa: E501

    def search(self, body = {}, **kwargs):  # noqa: E501
        """Search most clicked urls  # noqa: E501

        Return the 100 most clicked URLs that match the search query given.  # noqa: E501
        """
        (data) = self.search_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def search_with_http_info(self, body, **kwargs):  # noqa: E501
        """Search most clicked urls  # noqa: E501

        Return the 100 most clicked URLs that match the search query given.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method search" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/urls/search', 'POST',
            body=body_params,
            response_type='list[InlineResponse20065]') # noqa: E501

    def time_series(self, body = {}, **kwargs):  # noqa: E501
        """Get url history  # noqa: E501

        Return the recent history (hourly stats for the last 30 days) for a URL  # noqa: E501
        """
        (data) = self.time_series_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def time_series_with_http_info(self, body, **kwargs):  # noqa: E501
        """Get url history  # noqa: E501

        Return the recent history (hourly stats for the last 30 days) for a URL  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method time_series" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/urls/time-series', 'POST',
            body=body_params,
            response_type='list[InlineResponse20066]') # noqa: E501

    def tracking_domains(self, body = {}, **kwargs):  # noqa: E501
        """List tracking domains  # noqa: E501

        Get the list of tracking domains set up for this account.  # noqa: E501
        """
        (data) = self.tracking_domains_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def tracking_domains_with_http_info(self, body, **kwargs):  # noqa: E501
        """List tracking domains  # noqa: E501

        Get the list of tracking domains set up for this account.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method tracking_domains" % key
                )
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/urls/tracking-domains', 'POST',
            body=body_params,
            response_type='list[InlineResponse20067]') # noqa: E501
class TemplatesApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, api_key='', api_client=None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def add(self, body={}, **kwargs):  # noqa: E501
        """Add template  # noqa: E501

        Add a new template.  # noqa: E501
        """
        (data) = self.add_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def add_with_http_info(self, body, **kwargs):  # noqa: E501
        """Add template  # noqa: E501

        Add a new template.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method add" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/templates/add',
            'POST',
            body=body_params,
            response_type='InlineResponse20057')  # noqa: E501

    def delete(self, body={}, **kwargs):  # noqa: E501
        """Delete template  # noqa: E501

        Delete a template.  # noqa: E501
        """
        (data) = self.delete_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def delete_with_http_info(self, body, **kwargs):  # noqa: E501
        """Delete template  # noqa: E501

        Delete a template.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method delete" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/templates/delete',
            'POST',
            body=body_params,
            response_type='InlineResponse20061')  # noqa: E501

    def info(self, body={}, **kwargs):  # noqa: E501
        """Get template info  # noqa: E501

        Get the information for an existing template.  # noqa: E501
        """
        (data) = self.info_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def info_with_http_info(self, body, **kwargs):  # noqa: E501
        """Get template info  # noqa: E501

        Get the information for an existing template.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method info" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/templates/info',
            'POST',
            body=body_params,
            response_type='InlineResponse20058')  # noqa: E501

    def list(self, body={}, **kwargs):  # noqa: E501
        """List templates  # noqa: E501

        Return a list of all the templates available to this user.  # noqa: E501
        """
        (data) = self.list_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def list_with_http_info(self, body, **kwargs):  # noqa: E501
        """List templates  # noqa: E501

        Return a list of all the templates available to this user.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method list" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/templates/list',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20062]')  # noqa: E501

    def publish(self, body={}, **kwargs):  # noqa: E501
        """Publish template content  # noqa: E501

        Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft.  # noqa: E501
        """
        (data) = self.publish_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def publish_with_http_info(self, body, **kwargs):  # noqa: E501
        """Publish template content  # noqa: E501

        Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method publish" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/templates/publish',
            'POST',
            body=body_params,
            response_type='InlineResponse20060')  # noqa: E501

    def render(self, body={}, **kwargs):  # noqa: E501
        """Render html template  # noqa: E501

        Inject content and optionally merge fields into a template, returning the HTML that results.  # noqa: E501
        """
        (data) = self.render_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def render_with_http_info(self, body, **kwargs):  # noqa: E501
        """Render html template  # noqa: E501

        Inject content and optionally merge fields into a template, returning the HTML that results.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method render" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/templates/render',
            'POST',
            body=body_params,
            response_type='InlineResponse20063')  # noqa: E501

    def time_series(self, body={}, **kwargs):  # noqa: E501
        """Get template history  # noqa: E501

        Return the recent history (hourly stats for the last 30 days) for a template.  # noqa: E501
        """
        (data) = self.time_series_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def time_series_with_http_info(self, body, **kwargs):  # noqa: E501
        """Get template history  # noqa: E501

        Return the recent history (hourly stats for the last 30 days) for a template.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method time_series" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/templates/time-series',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20046]')  # noqa: E501

    def update(self, body={}, **kwargs):  # noqa: E501
        """Update template  # noqa: E501

        Update the code for an existing template. If null is provided for any fields, the values will remain unchanged.  # noqa: E501
        """
        (data) = self.update_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def update_with_http_info(self, body, **kwargs):  # noqa: E501
        """Update template  # noqa: E501

        Update the code for an existing template. If null is provided for any fields, the values will remain unchanged.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method update" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/templates/update',
            'POST',
            body=body_params,
            response_type='InlineResponse20059')  # noqa: E501
class RejectsApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, api_key='', api_client=None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def add(self, body={}, **kwargs):  # noqa: E501
        """Add email to blacklist  # noqa: E501

        Adds an email to your email rejection blacklist. Addresses that you add manually will never expire and there is no reputation penalty for removing them from your blacklist. Attempting to blacklist an address that has been whitelisted will have no effect.  # noqa: E501
        """
        (data) = self.add_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def add_with_http_info(self, body, **kwargs):  # noqa: E501
        """Add email to blacklist  # noqa: E501

        Adds an email to your email rejection blacklist. Addresses that you add manually will never expire and there is no reputation penalty for removing them from your blacklist. Attempting to blacklist an address that has been whitelisted will have no effect.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method add" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/rejects/add',
            'POST',
            body=body_params,
            response_type='InlineResponse20037')  # noqa: E501

    def delete(self, body={}, **kwargs):  # noqa: E501
        """Delete email from blacklist  # noqa: E501

        Deletes an email rejection. There is no limit to how many rejections you can remove from your blacklist, but keep in mind that each deletion has an affect on your reputation.  # noqa: E501
        """
        (data) = self.delete_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def delete_with_http_info(self, body, **kwargs):  # noqa: E501
        """Delete email from blacklist  # noqa: E501

        Deletes an email rejection. There is no limit to how many rejections you can remove from your blacklist, but keep in mind that each deletion has an affect on your reputation.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method delete" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/rejects/delete',
            'POST',
            body=body_params,
            response_type='InlineResponse20039')  # noqa: E501

    def list(self, body={}, **kwargs):  # noqa: E501
        """List blacklisted emails  # noqa: E501

        Retrieves your email rejection blacklist. You can provide an email address to limit the results. Returns up to 1000 results. By default, entries that have expired are excluded from the results; set include_expired to true to include them.  # noqa: E501
        """
        (data) = self.list_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def list_with_http_info(self, body, **kwargs):  # noqa: E501
        """List blacklisted emails  # noqa: E501

        Retrieves your email rejection blacklist. You can provide an email address to limit the results. Returns up to 1000 results. By default, entries that have expired are excluded from the results; set include_expired to true to include them.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method list" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/rejects/list',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20038]')  # noqa: E501
Ejemplo n.º 11
0
class MetadataApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, api_key='', api_client=None):
        self.api_key = api_key
        if api_client:
            self.api_client = api_client
        else:
            self.api_client = ApiClient()

    def add(self, body={}, **kwargs):  # noqa: E501
        """Add metadata field  # noqa: E501

        Add a new custom metadata field to be indexed for the account.  # noqa: E501
        """
        (data) = self.add_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def add_with_http_info(self, body, **kwargs):  # noqa: E501
        """Add metadata field  # noqa: E501

        Add a new custom metadata field to be indexed for the account.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method add" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/metadata/add',
            'POST',
            body=body_params,
            response_type='InlineResponse20034')  # noqa: E501

    def delete(self, body={}, **kwargs):  # noqa: E501
        """Delete metadata field  # noqa: E501

        Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.  # noqa: E501
        """
        (data) = self.delete_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def delete_with_http_info(self, body, **kwargs):  # noqa: E501
        """Delete metadata field  # noqa: E501

        Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method delete" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/metadata/delete',
            'POST',
            body=body_params,
            response_type='InlineResponse20036')  # noqa: E501

    def list(self, body={}, **kwargs):  # noqa: E501
        """List metadata fields  # noqa: E501

        Get the list of custom metadata fields indexed for the account.  # noqa: E501
        """
        (data) = self.list_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def list_with_http_info(self, body, **kwargs):  # noqa: E501
        """List metadata fields  # noqa: E501

        Get the list of custom metadata fields indexed for the account.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method list" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/metadata/list',
            'POST',
            body=body_params,
            response_type='list[InlineResponse20033]')  # noqa: E501

    def update(self, body={}, **kwargs):  # noqa: E501
        """Update metadata field  # noqa: E501

        Update an existing custom metadata field.  # noqa: E501
        """
        (data) = self.update_with_http_info(body, **kwargs)  # noqa: E501
        return data

    def update_with_http_info(self, body, **kwargs):  # noqa: E501
        """Update metadata field  # noqa: E501

        Update an existing custom metadata field.  # noqa: E501
        """

        all_params = ['body']  # noqa: E501

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method update" % key)
            params[key] = val
        del params['kwargs']

        # add api_key to body params
        params['body']['key'] = self.api_key

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.api_client.call_api(
            '/metadata/update',
            'POST',
            body=body_params,
            response_type='InlineResponse20035')  # noqa: E501