# coding: utf-8

"""
    Marketing Events

    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.events.api_client import ApiClient
from hubspot.marketing.events.exceptions import ApiTypeError, ApiValueError  # noqa: F401


class BasicApi(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, external_event_id, external_account_id, **kwargs):  # noqa: E501
        """Delete Marketing Event by External Ids  # noqa: E501

        Deletes the existing Marketing Event with the specified externalAccountId, externalEventId, if it exists.  Only Marketing Events created by the same app can be deleted.  # 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(external_event_id, external_account_id, async_req=True)
        >>> result = thread.get()

        :param external_event_id: The id of the marketing event in the external event application (required)
        :type external_event_id: str
        :param external_account_id: The accountId that is associated with this marketing event in the external event application (required)
        :type external_account_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.archive_with_http_info(external_event_id, external_account_id, **kwargs)  # noqa: E501

    def archive_with_http_info(self, external_event_id, external_account_id, **kwargs):  # noqa: E501
        """Delete Marketing Event by External Ids  # noqa: E501

        Deletes the existing Marketing Event with the specified externalAccountId, externalEventId, if it exists.  Only Marketing Events created by the same app can be deleted.  # 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(external_event_id, external_account_id, async_req=True)
        >>> result = thread.get()

        :param external_event_id: The id of the marketing event in the external event application (required)
        :type external_event_id: str
        :param external_account_id: The accountId that is associated with this marketing event in the external event application (required)
        :type external_account_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 = ["external_event_id", "external_account_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 archive" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'external_event_id' is set
        if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `external_event_id` when calling `archive`")  # noqa: E501
        # verify the required parameter 'external_account_id' is set
        if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `external_account_id` when calling `archive`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "external_event_id" in local_var_params:
            path_params["externalEventId"] = local_var_params["external_event_id"]  # noqa: E501

        query_params = []
        if local_var_params.get("external_account_id") is not None:  # noqa: E501
            query_params.append(("externalAccountId", local_var_params["external_account_id"]))  # 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/marketing-events/events/{externalEventId}",
            "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 archive_by_object_id(self, object_id, **kwargs):  # noqa: E501
        """Delete Marketing Event by objectId  # noqa: E501

        Deletes the existing Marketing Event with the specified objectId, if it exists.  # 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_by_object_id(object_id, async_req=True)
        >>> result = thread.get()

        :param object_id: The internal ID of the marketing event in HubSpot (required)
        :type object_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.archive_by_object_id_with_http_info(object_id, **kwargs)  # noqa: E501

    def archive_by_object_id_with_http_info(self, object_id, **kwargs):  # noqa: E501
        """Delete Marketing Event by objectId  # noqa: E501

        Deletes the existing Marketing Event with the specified objectId, if it exists.  # 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_by_object_id_with_http_info(object_id, async_req=True)
        >>> result = thread.get()

        :param object_id: The internal ID of the marketing event in HubSpot (required)
        :type object_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 = ["object_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 archive_by_object_id" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'object_id' is set
        if self.api_client.client_side_validation and local_var_params.get("object_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `object_id` when calling `archive_by_object_id`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "object_id" in local_var_params:
            path_params["objectId"] = local_var_params["object_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/marketing-events/{objectId}",
            "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 create(self, marketing_event_create_request_params, **kwargs):  # noqa: E501
        """Create a marketing event  # noqa: E501

        Creates a new marketing event in HubSpot  # 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(marketing_event_create_request_params, async_req=True)
        >>> result = thread.get()

        :param marketing_event_create_request_params: (required)
        :type marketing_event_create_request_params: MarketingEventCreateRequestParams
        :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: MarketingEventDefaultResponse
        """
        kwargs["_return_http_data_only"] = True
        return self.create_with_http_info(marketing_event_create_request_params, **kwargs)  # noqa: E501

    def create_with_http_info(self, marketing_event_create_request_params, **kwargs):  # noqa: E501
        """Create a marketing event  # noqa: E501

        Creates a new marketing event in HubSpot  # 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(marketing_event_create_request_params, async_req=True)
        >>> result = thread.get()

        :param marketing_event_create_request_params: (required)
        :type marketing_event_create_request_params: MarketingEventCreateRequestParams
        :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(MarketingEventDefaultResponse, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["marketing_event_create_request_params"]
        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 'marketing_event_create_request_params' is set
        if self.api_client.client_side_validation and local_var_params.get("marketing_event_create_request_params") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `marketing_event_create_request_params` 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 "marketing_event_create_request_params" in local_var_params:
            body_params = local_var_params["marketing_event_create_request_params"]
        # 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: "MarketingEventDefaultResponse",
        }

        return self.api_client.call_api(
            "/marketing/v3/marketing-events/events",
            "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_all(self, **kwargs):  # noqa: E501
        """Get all marketing event  # noqa: E501

        Returns all Marketing Events available on the portal, along with their properties, regardless of whether they were created manually or through the application.  The marketing events returned by this endpoint are sorted by objectId.  # 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_all(async_req=True)
        >>> result = thread.get()

        :param after: The cursor indicating the position of the last retrieved item.
        :type after: str
        :param limit: The limit for response size. The default value is 10, the max number 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: CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging
        """
        kwargs["_return_http_data_only"] = True
        return self.get_all_with_http_info(**kwargs)  # noqa: E501

    def get_all_with_http_info(self, **kwargs):  # noqa: E501
        """Get all marketing event  # noqa: E501

        Returns all Marketing Events available on the portal, along with their properties, regardless of whether they were created manually or through the application.  The marketing events returned by this endpoint are sorted by objectId.  # 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_all_with_http_info(async_req=True)
        >>> result = thread.get()

        :param after: The cursor indicating the position of the last retrieved item.
        :type after: str
        :param limit: The limit for response size. The default value is 10, the max number 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(CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["after", "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_all" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]

        collection_formats = {}

        path_params = {}

        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("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: "CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging",
        }

        return self.api_client.call_api(
            "/marketing/v3/marketing-events/",
            "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_object_id(self, object_id, **kwargs):  # noqa: E501
        """Get Marketing Event by objectId  # noqa: E501

        Returns the details of a Marketing Event with the specified objectId, if it exists.  # 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_object_id(object_id, async_req=True)
        >>> result = thread.get()

        :param object_id: The internal ID of the marketing event in HubSpot (required)
        :type object_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: MarketingEventPublicReadResponseV2
        """
        kwargs["_return_http_data_only"] = True
        return self.get_by_object_id_with_http_info(object_id, **kwargs)  # noqa: E501

    def get_by_object_id_with_http_info(self, object_id, **kwargs):  # noqa: E501
        """Get Marketing Event by objectId  # noqa: E501

        Returns the details of a Marketing Event with the specified objectId, if it exists.  # 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_object_id_with_http_info(object_id, async_req=True)
        >>> result = thread.get()

        :param object_id: The internal ID of the marketing event in HubSpot (required)
        :type object_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(MarketingEventPublicReadResponseV2, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "object_id" in local_var_params:
            path_params["objectId"] = local_var_params["object_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: "MarketingEventPublicReadResponseV2",
        }

        return self.api_client.call_api(
            "/marketing/v3/marketing-events/{objectId}",
            "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_details(self, external_event_id, external_account_id, **kwargs):  # noqa: E501
        """Get Marketing Event by External IDs  # noqa: E501

        Returns the details of a Marketing Event with the specified externalAccountId, externalEventId, if it exists.  Only Marketing Events created by the same app making the request can be retrieved.  # 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_details(external_event_id, external_account_id, async_req=True)
        >>> result = thread.get()

        :param external_event_id: The id of the marketing event in the external event application (required)
        :type external_event_id: str
        :param external_account_id: The accountId that is associated with this marketing event in the external event application (required)
        :type external_account_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: MarketingEventPublicReadResponse
        """
        kwargs["_return_http_data_only"] = True
        return self.get_details_with_http_info(external_event_id, external_account_id, **kwargs)  # noqa: E501

    def get_details_with_http_info(self, external_event_id, external_account_id, **kwargs):  # noqa: E501
        """Get Marketing Event by External IDs  # noqa: E501

        Returns the details of a Marketing Event with the specified externalAccountId, externalEventId, if it exists.  Only Marketing Events created by the same app making the request can be retrieved.  # 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_details_with_http_info(external_event_id, external_account_id, async_req=True)
        >>> result = thread.get()

        :param external_event_id: The id of the marketing event in the external event application (required)
        :type external_event_id: str
        :param external_account_id: The accountId that is associated with this marketing event in the external event application (required)
        :type external_account_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(MarketingEventPublicReadResponse, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "external_event_id" in local_var_params:
            path_params["externalEventId"] = local_var_params["external_event_id"]  # noqa: E501

        query_params = []
        if local_var_params.get("external_account_id") is not None:  # noqa: E501
            query_params.append(("externalAccountId", local_var_params["external_account_id"]))  # 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: "MarketingEventPublicReadResponse",
        }

        return self.api_client.call_api(
            "/marketing/v3/marketing-events/events/{externalEventId}",
            "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 update(self, external_event_id, external_account_id, marketing_event_update_request_params, **kwargs):  # noqa: E501
        """Update Marketing Event by External IDs  # noqa: E501

        Updates the details of an existing Marketing Event identified by its externalAccountId, externalEventId if it exists.  Only Marketing Events created by the same app can be updated.  # 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(external_event_id, external_account_id, marketing_event_update_request_params, async_req=True)
        >>> result = thread.get()

        :param external_event_id: The id of the marketing event in the external event application (required)
        :type external_event_id: str
        :param external_account_id: The accountId that is associated with this marketing event in the external event application (required)
        :type external_account_id: str
        :param marketing_event_update_request_params: (required)
        :type marketing_event_update_request_params: MarketingEventUpdateRequestParams
        :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: MarketingEventPublicDefaultResponse
        """
        kwargs["_return_http_data_only"] = True
        return self.update_with_http_info(external_event_id, external_account_id, marketing_event_update_request_params, **kwargs)  # noqa: E501

    def update_with_http_info(self, external_event_id, external_account_id, marketing_event_update_request_params, **kwargs):  # noqa: E501
        """Update Marketing Event by External IDs  # noqa: E501

        Updates the details of an existing Marketing Event identified by its externalAccountId, externalEventId if it exists.  Only Marketing Events created by the same app can be updated.  # 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(external_event_id, external_account_id, marketing_event_update_request_params, async_req=True)
        >>> result = thread.get()

        :param external_event_id: The id of the marketing event in the external event application (required)
        :type external_event_id: str
        :param external_account_id: The accountId that is associated with this marketing event in the external event application (required)
        :type external_account_id: str
        :param marketing_event_update_request_params: (required)
        :type marketing_event_update_request_params: MarketingEventUpdateRequestParams
        :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(MarketingEventPublicDefaultResponse, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["external_event_id", "external_account_id", "marketing_event_update_request_params"]
        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 'external_event_id' is set
        if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `external_event_id` when calling `update`")  # noqa: E501
        # verify the required parameter 'external_account_id' is set
        if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `external_account_id` when calling `update`")  # noqa: E501
        # verify the required parameter 'marketing_event_update_request_params' is set
        if self.api_client.client_side_validation and local_var_params.get("marketing_event_update_request_params") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `marketing_event_update_request_params` when calling `update`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "external_event_id" in local_var_params:
            path_params["externalEventId"] = local_var_params["external_event_id"]  # noqa: E501

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

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "marketing_event_update_request_params" in local_var_params:
            body_params = local_var_params["marketing_event_update_request_params"]
        # 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: "MarketingEventPublicDefaultResponse",
        }

        return self.api_client.call_api(
            "/marketing/v3/marketing-events/events/{externalEventId}",
            "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 update_by_object_id(self, object_id, marketing_event_public_update_request_v2, **kwargs):  # noqa: E501
        """Update Marketing Event by objectId  # noqa: E501

        Updates the details of an existing Marketing Event identified by its objectId, if it exists.  # 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_by_object_id(object_id, marketing_event_public_update_request_v2, async_req=True)
        >>> result = thread.get()

        :param object_id: The internal ID of the marketing event in HubSpot (required)
        :type object_id: str
        :param marketing_event_public_update_request_v2: (required)
        :type marketing_event_public_update_request_v2: MarketingEventPublicUpdateRequestV2
        :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: MarketingEventPublicDefaultResponseV2
        """
        kwargs["_return_http_data_only"] = True
        return self.update_by_object_id_with_http_info(object_id, marketing_event_public_update_request_v2, **kwargs)  # noqa: E501

    def update_by_object_id_with_http_info(self, object_id, marketing_event_public_update_request_v2, **kwargs):  # noqa: E501
        """Update Marketing Event by objectId  # noqa: E501

        Updates the details of an existing Marketing Event identified by its objectId, if it exists.  # 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_by_object_id_with_http_info(object_id, marketing_event_public_update_request_v2, async_req=True)
        >>> result = thread.get()

        :param object_id: The internal ID of the marketing event in HubSpot (required)
        :type object_id: str
        :param marketing_event_public_update_request_v2: (required)
        :type marketing_event_public_update_request_v2: MarketingEventPublicUpdateRequestV2
        :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(MarketingEventPublicDefaultResponseV2, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "object_id" in local_var_params:
            path_params["objectId"] = local_var_params["object_id"]  # noqa: E501

        query_params = []

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "marketing_event_public_update_request_v2" in local_var_params:
            body_params = local_var_params["marketing_event_public_update_request_v2"]
        # 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: "MarketingEventPublicDefaultResponseV2",
        }

        return self.api_client.call_api(
            "/marketing/v3/marketing-events/{objectId}",
            "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(self, external_event_id, marketing_event_create_request_params, **kwargs):  # noqa: E501
        """Create or update a marketing event  # noqa: E501

        Upserts a marketing event If there is an existing marketing event with the specified ID, it will be updated; otherwise a new event will 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.upsert(external_event_id, marketing_event_create_request_params, async_req=True)
        >>> result = thread.get()

        :param external_event_id: The id of the marketing event in the external event application (required)
        :type external_event_id: str
        :param marketing_event_create_request_params: (required)
        :type marketing_event_create_request_params: MarketingEventCreateRequestParams
        :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: MarketingEventPublicDefaultResponse
        """
        kwargs["_return_http_data_only"] = True
        return self.upsert_with_http_info(external_event_id, marketing_event_create_request_params, **kwargs)  # noqa: E501

    def upsert_with_http_info(self, external_event_id, marketing_event_create_request_params, **kwargs):  # noqa: E501
        """Create or update a marketing event  # noqa: E501

        Upserts a marketing event If there is an existing marketing event with the specified ID, it will be updated; otherwise a new event will 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.upsert_with_http_info(external_event_id, marketing_event_create_request_params, async_req=True)
        >>> result = thread.get()

        :param external_event_id: The id of the marketing event in the external event application (required)
        :type external_event_id: str
        :param marketing_event_create_request_params: (required)
        :type marketing_event_create_request_params: MarketingEventCreateRequestParams
        :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(MarketingEventPublicDefaultResponse, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "external_event_id" in local_var_params:
            path_params["externalEventId"] = local_var_params["external_event_id"]  # noqa: E501

        query_params = []

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "marketing_event_create_request_params" in local_var_params:
            body_params = local_var_params["marketing_event_create_request_params"]
        # 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"], "PUT", 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: "MarketingEventPublicDefaultResponse",
        }

        return self.api_client.call_api(
            "/marketing/v3/marketing-events/events/{externalEventId}",
            "PUT",
            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"),
        )
