# coding: utf-8

"""
    Marketing Emails

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: v3
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from hubspot.marketing.emails.api_client import ApiClient
from hubspot.marketing.emails.exceptions import ApiTypeError, ApiValueError  # noqa: F401


class MarketingEmailsApi(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 archive(self, email_id, **kwargs):  # noqa: E501
        """Delete a marketing email.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.archive(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The ID of the marketing email to delete. (required)
        :type email_id: str
        :param archived: Whether to return only results that have been archived.
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs["_return_http_data_only"] = True
        return self.archive_with_http_info(email_id, **kwargs)  # noqa: E501

    def archive_with_http_info(self, email_id, **kwargs):  # noqa: E501
        """Delete a marketing email.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.archive_with_http_info(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The ID of the marketing email to delete. (required)
        :type email_id: str
        :param archived: Whether to return only results that have been archived.
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        local_var_params = locals()

        all_params = ["email_id", "archived"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 archive" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `archive`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []
        if local_var_params.get("archived") is not None:  # noqa: E501
            query_params.append(("archived", local_var_params["archived"]))  # noqa: E501

        header_params = dict(local_var_params.get("_headers", {}))

        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 = ["oauth2"]  # noqa: E501

        response_types_map = {}

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}",
            "DELETE",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def clone(self, content_clone_request_v_next, **kwargs):  # noqa: E501
        """Clone a marketing email.  # noqa: E501

        This will create a duplicate email with the same properties as the original, with the exception of a unique ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.clone(content_clone_request_v_next, async_req=True)
        >>> result = thread.get()

        :param content_clone_request_v_next: (required)
        :type content_clone_request_v_next: ContentCloneRequestVNext
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.clone_with_http_info(content_clone_request_v_next, **kwargs)  # noqa: E501

    def clone_with_http_info(self, content_clone_request_v_next, **kwargs):  # noqa: E501
        """Clone a marketing email.  # noqa: E501

        This will create a duplicate email with the same properties as the original, with the exception of a unique ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.clone_with_http_info(content_clone_request_v_next, async_req=True)
        >>> result = thread.get()

        :param content_clone_request_v_next: (required)
        :type content_clone_request_v_next: ContentCloneRequestVNext
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["content_clone_request_v_next"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 clone" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'content_clone_request_v_next' is set
        if self.api_client.client_side_validation and local_var_params.get("content_clone_request_v_next") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `content_clone_request_v_next` when calling `clone`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

        body_params = None
        if "content_clone_request_v_next" in local_var_params:
            body_params = local_var_params["content_clone_request_v_next"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"])  # noqa: E501

        # HTTP header `Content-Type`
        content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params))  # noqa: E501
        if content_types_list:
            header_params["Content-Type"] = content_types_list

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "PublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/clone",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def create(self, email_create_request, **kwargs):  # noqa: E501
        """Create a new marketing email.  # noqa: E501

        Use this endpoint to create a new marketing email.  # 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(email_create_request, async_req=True)
        >>> result = thread.get()

        :param email_create_request: (required)
        :type email_create_request: EmailCreateRequest
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.create_with_http_info(email_create_request, **kwargs)  # noqa: E501

    def create_with_http_info(self, email_create_request, **kwargs):  # noqa: E501
        """Create a new marketing email.  # noqa: E501

        Use this endpoint to create a new marketing email.  # 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_with_http_info(email_create_request, async_req=True)
        >>> result = thread.get()

        :param email_create_request: (required)
        :type email_create_request: EmailCreateRequest
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["email_create_request"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_create_request' is set
        if self.api_client.client_side_validation and local_var_params.get("email_create_request") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_create_request` when calling `create`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

        body_params = None
        if "email_create_request" in local_var_params:
            body_params = local_var_params["email_create_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"])  # noqa: E501

        # HTTP header `Content-Type`
        content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params))  # noqa: E501
        if content_types_list:
            header_params["Content-Type"] = content_types_list

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            201: "PublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def create_ab_test_variation(self, ab_test_create_request_v_next, **kwargs):  # noqa: E501
        """Create an A/B test variation of a marketing email.  # noqa: E501

        Create a variation of a marketing email for an A/B test. The new variation will be created as a draft. If an active variation already exists, a new one won't be created.  # 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_ab_test_variation(ab_test_create_request_v_next, async_req=True)
        >>> result = thread.get()

        :param ab_test_create_request_v_next: (required)
        :type ab_test_create_request_v_next: AbTestCreateRequestVNext
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.create_ab_test_variation_with_http_info(ab_test_create_request_v_next, **kwargs)  # noqa: E501

    def create_ab_test_variation_with_http_info(self, ab_test_create_request_v_next, **kwargs):  # noqa: E501
        """Create an A/B test variation of a marketing email.  # noqa: E501

        Create a variation of a marketing email for an A/B test. The new variation will be created as a draft. If an active variation already exists, a new one won't be created.  # 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_ab_test_variation_with_http_info(ab_test_create_request_v_next, async_req=True)
        >>> result = thread.get()

        :param ab_test_create_request_v_next: (required)
        :type ab_test_create_request_v_next: AbTestCreateRequestVNext
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["ab_test_create_request_v_next"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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_ab_test_variation" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'ab_test_create_request_v_next' is set
        if self.api_client.client_side_validation and local_var_params.get("ab_test_create_request_v_next") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `ab_test_create_request_v_next` when calling `create_ab_test_variation`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

        body_params = None
        if "ab_test_create_request_v_next" in local_var_params:
            body_params = local_var_params["ab_test_create_request_v_next"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"])  # noqa: E501

        # HTTP header `Content-Type`
        content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params))  # noqa: E501
        if content_types_list:
            header_params["Content-Type"] = content_types_list

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            201: "PublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/ab-test/create-variation",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def get_ab_test_variation(self, email_id, **kwargs):  # noqa: E501
        """Get the variation of a an A/B marketing email  # noqa: E501

        This endpoint lets you obtain the variation of an A/B marketing email. If the email is variation A (master) it will return variation B (variant) and vice versa.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_ab_test_variation(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The ID of an A/B marketing email. (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.get_ab_test_variation_with_http_info(email_id, **kwargs)  # noqa: E501

    def get_ab_test_variation_with_http_info(self, email_id, **kwargs):  # noqa: E501
        """Get the variation of a an A/B marketing email  # noqa: E501

        This endpoint lets you obtain the variation of an A/B marketing email. If the email is variation A (master) it will return variation B (variant) and vice versa.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_ab_test_variation_with_http_info(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The ID of an A/B marketing email. (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["email_id"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 get_ab_test_variation" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `get_ab_test_variation`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "PublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/ab-test/get-variation",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def get_by_id(self, email_id, **kwargs):  # noqa: E501
        """Get the details of a specified marketing email.  # noqa: E501

        Get the details for a marketing email.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_by_id(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param include_stats: Include statistics with email
        :type include_stats: bool
        :param marketing_campaign_names:
        :type marketing_campaign_names: bool
        :param workflow_names:
        :type workflow_names: bool
        :param included_properties:
        :type included_properties: list[str]
        :param archived: Whether to return only results that have been archived.
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.get_by_id_with_http_info(email_id, **kwargs)  # noqa: E501

    def get_by_id_with_http_info(self, email_id, **kwargs):  # noqa: E501
        """Get the details of a specified marketing email.  # noqa: E501

        Get the details for a marketing email.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_by_id_with_http_info(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param include_stats: Include statistics with email
        :type include_stats: bool
        :param marketing_campaign_names:
        :type marketing_campaign_names: bool
        :param workflow_names:
        :type workflow_names: bool
        :param included_properties:
        :type included_properties: list[str]
        :param archived: Whether to return only results that have been archived.
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["email_id", "include_stats", "marketing_campaign_names", "workflow_names", "included_properties", "archived"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 get_by_id" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `get_by_id`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []
        if local_var_params.get("include_stats") is not None:  # noqa: E501
            query_params.append(("includeStats", local_var_params["include_stats"]))  # noqa: E501
        if local_var_params.get("marketing_campaign_names") is not None:  # noqa: E501
            query_params.append(("marketingCampaignNames", local_var_params["marketing_campaign_names"]))  # noqa: E501
        if local_var_params.get("workflow_names") is not None:  # noqa: E501
            query_params.append(("workflowNames", local_var_params["workflow_names"]))  # noqa: E501
        if local_var_params.get("included_properties") is not None:  # noqa: E501
            query_params.append(("includedProperties", local_var_params["included_properties"]))  # noqa: E501
            collection_formats["includedProperties"] = "multi"  # noqa: E501
        if local_var_params.get("archived") is not None:  # noqa: E501
            query_params.append(("archived", local_var_params["archived"]))  # noqa: E501

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "PublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def get_draft(self, email_id, **kwargs):  # noqa: E501
        """Get draft version of a marketing email  # noqa: E501

        Get the draft version of an email (if it exists). If no draft version exists, the published email is returned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_draft(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.get_draft_with_http_info(email_id, **kwargs)  # noqa: E501

    def get_draft_with_http_info(self, email_id, **kwargs):  # noqa: E501
        """Get draft version of a marketing email  # noqa: E501

        Get the draft version of an email (if it exists). If no draft version exists, the published email is returned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_draft_with_http_info(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["email_id"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 get_draft" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `get_draft`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "PublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/draft",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def get_page(self, **kwargs):  # noqa: E501
        """Get all marketing emails for a HubSpot account.  # noqa: E501

        The results can be filtered, allowing you to find a specific set of emails. See the table below for a full list of filtering options.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_page(async_req=True)
        >>> result = thread.get()

        :param created_at: Only return emails created at exactly the specified time.
        :type created_at: datetime
        :param created_after: Only return emails created after the specified time.
        :type created_after: datetime
        :param created_before: Only return emails created before the specified time.
        :type created_before: datetime
        :param updated_at: Only return emails last updated at exactly the specified time.
        :type updated_at: datetime
        :param updated_after: Only return emails last updated after the specified time.
        :type updated_after: datetime
        :param updated_before: Only return emails last updated before the specified time.
        :type updated_before: datetime
        :param sort: Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default.
        :type sort: list[str]
        :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results.
        :type after: str
        :param limit: The maximum number of results to return. Default is 100.
        :type limit: int
        :param include_stats: Include statistics with emails.
        :type include_stats: bool
        :param marketing_campaign_names:
        :type marketing_campaign_names: bool
        :param workflow_names:
        :type workflow_names: bool
        :param type: Email types to be filtered by. Multiple types can be included. All emails will be returned if not present.
        :type type: str
        :param is_published: Filter by published/draft emails. All emails will be returned if not present.
        :type is_published: bool
        :param included_properties:
        :type included_properties: list[str]
        :param archived: Specifies whether to return archived emails. Defaults to `false`.
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: CollectionResponseWithTotalPublicEmailForwardPaging
        """
        kwargs["_return_http_data_only"] = True
        return self.get_page_with_http_info(**kwargs)  # noqa: E501

    def get_page_with_http_info(self, **kwargs):  # noqa: E501
        """Get all marketing emails for a HubSpot account.  # noqa: E501

        The results can be filtered, allowing you to find a specific set of emails. See the table below for a full list of filtering options.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_page_with_http_info(async_req=True)
        >>> result = thread.get()

        :param created_at: Only return emails created at exactly the specified time.
        :type created_at: datetime
        :param created_after: Only return emails created after the specified time.
        :type created_after: datetime
        :param created_before: Only return emails created before the specified time.
        :type created_before: datetime
        :param updated_at: Only return emails last updated at exactly the specified time.
        :type updated_at: datetime
        :param updated_after: Only return emails last updated after the specified time.
        :type updated_after: datetime
        :param updated_before: Only return emails last updated before the specified time.
        :type updated_before: datetime
        :param sort: Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default.
        :type sort: list[str]
        :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results.
        :type after: str
        :param limit: The maximum number of results to return. Default is 100.
        :type limit: int
        :param include_stats: Include statistics with emails.
        :type include_stats: bool
        :param marketing_campaign_names:
        :type marketing_campaign_names: bool
        :param workflow_names:
        :type workflow_names: bool
        :param type: Email types to be filtered by. Multiple types can be included. All emails will be returned if not present.
        :type type: str
        :param is_published: Filter by published/draft emails. All emails will be returned if not present.
        :type is_published: bool
        :param included_properties:
        :type included_properties: list[str]
        :param archived: Specifies whether to return archived emails. Defaults to `false`.
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(CollectionResponseWithTotalPublicEmailForwardPaging, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = [
            "created_at",
            "created_after",
            "created_before",
            "updated_at",
            "updated_after",
            "updated_before",
            "sort",
            "after",
            "limit",
            "include_stats",
            "marketing_campaign_names",
            "workflow_names",
            "type",
            "is_published",
            "included_properties",
            "archived",
        ]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 get_page" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]

        collection_formats = {}

        path_params = {}

        query_params = []
        if local_var_params.get("created_at") is not None:  # noqa: E501
            query_params.append(("createdAt", local_var_params["created_at"]))  # noqa: E501
        if local_var_params.get("created_after") is not None:  # noqa: E501
            query_params.append(("createdAfter", local_var_params["created_after"]))  # noqa: E501
        if local_var_params.get("created_before") is not None:  # noqa: E501
            query_params.append(("createdBefore", local_var_params["created_before"]))  # noqa: E501
        if local_var_params.get("updated_at") is not None:  # noqa: E501
            query_params.append(("updatedAt", local_var_params["updated_at"]))  # noqa: E501
        if local_var_params.get("updated_after") is not None:  # noqa: E501
            query_params.append(("updatedAfter", local_var_params["updated_after"]))  # noqa: E501
        if local_var_params.get("updated_before") is not None:  # noqa: E501
            query_params.append(("updatedBefore", local_var_params["updated_before"]))  # noqa: E501
        if local_var_params.get("sort") is not None:  # noqa: E501
            query_params.append(("sort", local_var_params["sort"]))  # noqa: E501
            collection_formats["sort"] = "multi"  # noqa: E501
        if local_var_params.get("after") is not None:  # noqa: E501
            query_params.append(("after", local_var_params["after"]))  # noqa: E501
        if local_var_params.get("limit") is not None:  # noqa: E501
            query_params.append(("limit", local_var_params["limit"]))  # noqa: E501
        if local_var_params.get("include_stats") is not None:  # noqa: E501
            query_params.append(("includeStats", local_var_params["include_stats"]))  # noqa: E501
        if local_var_params.get("marketing_campaign_names") is not None:  # noqa: E501
            query_params.append(("marketingCampaignNames", local_var_params["marketing_campaign_names"]))  # noqa: E501
        if local_var_params.get("workflow_names") is not None:  # noqa: E501
            query_params.append(("workflowNames", local_var_params["workflow_names"]))  # noqa: E501
        if local_var_params.get("type") is not None:  # noqa: E501
            query_params.append(("type", local_var_params["type"]))  # noqa: E501
        if local_var_params.get("is_published") is not None:  # noqa: E501
            query_params.append(("isPublished", local_var_params["is_published"]))  # noqa: E501
        if local_var_params.get("included_properties") is not None:  # noqa: E501
            query_params.append(("includedProperties", local_var_params["included_properties"]))  # noqa: E501
            collection_formats["includedProperties"] = "multi"  # noqa: E501
        if local_var_params.get("archived") is not None:  # noqa: E501
            query_params.append(("archived", local_var_params["archived"]))  # noqa: E501

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "CollectionResponseWithTotalPublicEmailForwardPaging",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def get_revision_by_id(self, email_id, revision_id, **kwargs):  # noqa: E501
        """Get a revision of a marketing email.  # noqa: E501

        Get a specific revision of a marketing email.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_revision_by_id(email_id, revision_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param revision_id: The ID of a revision. (required)
        :type revision_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: VersionPublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.get_revision_by_id_with_http_info(email_id, revision_id, **kwargs)  # noqa: E501

    def get_revision_by_id_with_http_info(self, email_id, revision_id, **kwargs):  # noqa: E501
        """Get a revision of a marketing email.  # noqa: E501

        Get a specific revision of a marketing email.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_revision_by_id_with_http_info(email_id, revision_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param revision_id: The ID of a revision. (required)
        :type revision_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(VersionPublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["email_id", "revision_id"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 get_revision_by_id" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `get_revision_by_id`")  # noqa: E501
        # verify the required parameter 'revision_id' is set
        if self.api_client.client_side_validation and local_var_params.get("revision_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `revision_id` when calling `get_revision_by_id`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501
        if "revision_id" in local_var_params:
            path_params["revisionId"] = local_var_params["revision_id"]  # noqa: E501

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "VersionPublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/revisions/{revisionId}",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def get_revisions(self, email_id, **kwargs):  # noqa: E501
        """Get revisions of a marketing email  # noqa: E501

        Get a list of all versions of a marketing email, with each entry including the full state of that particular version. The current revision has the ID -1.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_revisions(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results.
        :type after: str
        :param before: The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results.
        :type before: str
        :param limit: The maximum number of results to return. Default is 100.
        :type limit: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: CollectionResponseWithTotalVersionPublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.get_revisions_with_http_info(email_id, **kwargs)  # noqa: E501

    def get_revisions_with_http_info(self, email_id, **kwargs):  # noqa: E501
        """Get revisions of a marketing email  # noqa: E501

        Get a list of all versions of a marketing email, with each entry including the full state of that particular version. The current revision has the ID -1.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_revisions_with_http_info(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results.
        :type after: str
        :param before: The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results.
        :type before: str
        :param limit: The maximum number of results to return. Default is 100.
        :type limit: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(CollectionResponseWithTotalVersionPublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["email_id", "after", "before", "limit"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 get_revisions" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `get_revisions`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []
        if local_var_params.get("after") is not None:  # noqa: E501
            query_params.append(("after", local_var_params["after"]))  # noqa: E501
        if local_var_params.get("before") is not None:  # noqa: E501
            query_params.append(("before", local_var_params["before"]))  # noqa: E501
        if local_var_params.get("limit") is not None:  # noqa: E501
            query_params.append(("limit", local_var_params["limit"]))  # noqa: E501

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "CollectionResponseWithTotalVersionPublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/revisions",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def publish_or_send(self, email_id, **kwargs):  # noqa: E501
        """Publish or send a marketing email.  # noqa: E501

        If you have a Marketing Hub Enterprise account or the transactional email add-on, you can use this endpoint to publish an automated email or send/schedule a regular email.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.publish_or_send(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs["_return_http_data_only"] = True
        return self.publish_or_send_with_http_info(email_id, **kwargs)  # noqa: E501

    def publish_or_send_with_http_info(self, email_id, **kwargs):  # noqa: E501
        """Publish or send a marketing email.  # noqa: E501

        If you have a Marketing Hub Enterprise account or the transactional email add-on, you can use this endpoint to publish an automated email or send/schedule a regular email.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.publish_or_send_with_http_info(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        local_var_params = locals()

        all_params = ["email_id"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 publish_or_send" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `publish_or_send`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        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 = ["oauth2"]  # noqa: E501

        response_types_map = {}

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/publish",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def reset_draft(self, email_id, **kwargs):  # noqa: E501
        """Reset Draft  # noqa: E501

        Resets the draft back to a copy of the live object.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.reset_draft(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs["_return_http_data_only"] = True
        return self.reset_draft_with_http_info(email_id, **kwargs)  # noqa: E501

    def reset_draft_with_http_info(self, email_id, **kwargs):  # noqa: E501
        """Reset Draft  # noqa: E501

        Resets the draft back to a copy of the live object.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.reset_draft_with_http_info(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        local_var_params = locals()

        all_params = ["email_id"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 reset_draft" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `reset_draft`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        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 = ["oauth2"]  # noqa: E501

        response_types_map = {}

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/draft/reset",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def restore_draft_revision(self, email_id, revision_id, **kwargs):  # noqa: E501
        """Restore a revision of a marketing email to DRAFT state  # noqa: E501

        Restores a previous revision of a marketing email to DRAFT state. If there is currently something in the draft for that object, it is overwritten.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.restore_draft_revision(email_id, revision_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param revision_id: The ID of a revision. (required)
        :type revision_id: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.restore_draft_revision_with_http_info(email_id, revision_id, **kwargs)  # noqa: E501

    def restore_draft_revision_with_http_info(self, email_id, revision_id, **kwargs):  # noqa: E501
        """Restore a revision of a marketing email to DRAFT state  # noqa: E501

        Restores a previous revision of a marketing email to DRAFT state. If there is currently something in the draft for that object, it is overwritten.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.restore_draft_revision_with_http_info(email_id, revision_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param revision_id: The ID of a revision. (required)
        :type revision_id: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["email_id", "revision_id"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 restore_draft_revision" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `restore_draft_revision`")  # noqa: E501
        # verify the required parameter 'revision_id' is set
        if self.api_client.client_side_validation and local_var_params.get("revision_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `revision_id` when calling `restore_draft_revision`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501
        if "revision_id" in local_var_params:
            path_params["revisionId"] = local_var_params["revision_id"]  # noqa: E501

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "PublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/revisions/{revisionId}/restore-to-draft",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def restore_revision(self, email_id, revision_id, **kwargs):  # noqa: E501
        """Restore a revision of a marketing email  # noqa: E501

        Restores a previous revision of a marketing email. The current revision becomes old, and the restored revision is given a new version number.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.restore_revision(email_id, revision_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param revision_id: The ID of a revision. (required)
        :type revision_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs["_return_http_data_only"] = True
        return self.restore_revision_with_http_info(email_id, revision_id, **kwargs)  # noqa: E501

    def restore_revision_with_http_info(self, email_id, revision_id, **kwargs):  # noqa: E501
        """Restore a revision of a marketing email  # noqa: E501

        Restores a previous revision of a marketing email. The current revision becomes old, and the restored revision is given a new version number.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.restore_revision_with_http_info(email_id, revision_id, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param revision_id: The ID of a revision. (required)
        :type revision_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        local_var_params = locals()

        all_params = ["email_id", "revision_id"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 restore_revision" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `restore_revision`")  # noqa: E501
        # verify the required parameter 'revision_id' is set
        if self.api_client.client_side_validation and local_var_params.get("revision_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `revision_id` when calling `restore_revision`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501
        if "revision_id" in local_var_params:
            path_params["revisionId"] = local_var_params["revision_id"]  # noqa: E501

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        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 = ["oauth2"]  # noqa: E501

        response_types_map = {}

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/revisions/{revisionId}/restore",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def unpublish_or_cancel(self, email_id, **kwargs):  # noqa: E501
        """Unpublish or cancel a marketing email.  # noqa: E501

        If you have a Marketing Hub Enterprise account or the transactional email add-on, you can use this endpoint to unpublish an automated email or cancel a regular email. If the email is already in the process of being sent, canceling might not be possible.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.unpublish_or_cancel(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs["_return_http_data_only"] = True
        return self.unpublish_or_cancel_with_http_info(email_id, **kwargs)  # noqa: E501

    def unpublish_or_cancel_with_http_info(self, email_id, **kwargs):  # noqa: E501
        """Unpublish or cancel a marketing email.  # noqa: E501

        If you have a Marketing Hub Enterprise account or the transactional email add-on, you can use this endpoint to unpublish an automated email or cancel a regular email. If the email is already in the process of being sent, canceling might not be possible.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.unpublish_or_cancel_with_http_info(email_id, async_req=True)
        >>> result = thread.get()

        :param email_id: (required)
        :type email_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        local_var_params = locals()

        all_params = ["email_id"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 unpublish_or_cancel" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `unpublish_or_cancel`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        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 = ["oauth2"]  # noqa: E501

        response_types_map = {}

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/unpublish",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def update(self, email_id, email_update_request, **kwargs):  # noqa: E501
        """Update a marketing email.  # noqa: E501

        Change properties of a marketing email.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.update(email_id, email_update_request, async_req=True)
        >>> result = thread.get()

        :param email_id: The ID of the marketing email that should get updated (required)
        :type email_id: str
        :param email_update_request: A marketing email object with properties that should overwrite the corresponding properties of the marketing email. (required)
        :type email_update_request: EmailUpdateRequest
        :param archived: Whether to return only results that have been archived.
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.update_with_http_info(email_id, email_update_request, **kwargs)  # noqa: E501

    def update_with_http_info(self, email_id, email_update_request, **kwargs):  # noqa: E501
        """Update a marketing email.  # noqa: E501

        Change properties of a marketing email.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.update_with_http_info(email_id, email_update_request, async_req=True)
        >>> result = thread.get()

        :param email_id: The ID of the marketing email that should get updated (required)
        :type email_id: str
        :param email_update_request: A marketing email object with properties that should overwrite the corresponding properties of the marketing email. (required)
        :type email_update_request: EmailUpdateRequest
        :param archived: Whether to return only results that have been archived.
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["email_id", "email_update_request", "archived"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 update" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `update`")  # noqa: E501
        # verify the required parameter 'email_update_request' is set
        if self.api_client.client_side_validation and local_var_params.get("email_update_request") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_update_request` when calling `update`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []
        if local_var_params.get("archived") is not None:  # noqa: E501
            query_params.append(("archived", local_var_params["archived"]))  # noqa: E501

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

        body_params = None
        if "email_update_request" in local_var_params:
            body_params = local_var_params["email_update_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"])  # noqa: E501

        # HTTP header `Content-Type`
        content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "PATCH", body_params))  # noqa: E501
        if content_types_list:
            header_params["Content-Type"] = content_types_list

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "PublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}",
            "PATCH",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def upsert_draft(self, email_id, email_update_request, **kwargs):  # noqa: E501
        """Create or update draft version  # noqa: E501

        Create or update the draft version of a marketing email. If no draft exists, the system creates a draft from the current “live” email then applies the request body to that draft. The draft version only lives on the buffer—the email is not cloned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.upsert_draft(email_id, email_update_request, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param email_update_request: A marketing email object with properties that should overwrite the corresponding properties in the email's current draft. (required)
        :type email_update_request: EmailUpdateRequest
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PublicEmail
        """
        kwargs["_return_http_data_only"] = True
        return self.upsert_draft_with_http_info(email_id, email_update_request, **kwargs)  # noqa: E501

    def upsert_draft_with_http_info(self, email_id, email_update_request, **kwargs):  # noqa: E501
        """Create or update draft version  # noqa: E501

        Create or update the draft version of a marketing email. If no draft exists, the system creates a draft from the current “live” email then applies the request body to that draft. The draft version only lives on the buffer—the email is not cloned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.upsert_draft_with_http_info(email_id, email_update_request, async_req=True)
        >>> result = thread.get()

        :param email_id: The marketing email ID. (required)
        :type email_id: str
        :param email_update_request: A marketing email object with properties that should overwrite the corresponding properties in the email's current draft. (required)
        :type email_update_request: EmailUpdateRequest
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["email_id", "email_update_request"]
        all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])

        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 upsert_draft" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'email_id' is set
        if self.api_client.client_side_validation and local_var_params.get("email_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_id` when calling `upsert_draft`")  # noqa: E501
        # verify the required parameter 'email_update_request' is set
        if self.api_client.client_side_validation and local_var_params.get("email_update_request") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `email_update_request` when calling `upsert_draft`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "email_id" in local_var_params:
            path_params["emailId"] = local_var_params["email_id"]  # noqa: E501

        query_params = []

        header_params = dict(local_var_params.get("_headers", {}))

        form_params = []
        local_var_files = {}

        body_params = None
        if "email_update_request" in local_var_params:
            body_params = local_var_params["email_update_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"])  # noqa: E501

        # HTTP header `Content-Type`
        content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "PATCH", body_params))  # noqa: E501
        if content_types_list:
            header_params["Content-Type"] = content_types_list

        # Authentication setting
        auth_settings = ["oauth2"]  # noqa: E501

        response_types_map = {
            200: "PublicEmail",
        }

        return self.api_client.call_api(
            "/marketing/v3/emails/{emailId}/draft",
            "PATCH",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            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,
            _request_auth=local_var_params.get("_request_auth"),
        )
