# coding: utf-8

"""
    Hubdb

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


class TablesApi(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_table(self, table_id_or_name, **kwargs):  # noqa: E501
        """Archive a table  # noqa: E501

        Archive (soft delete) an existing HubDB table. This archives both the published and draft versions.  # 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_table(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to archive. (required)
        :type table_id_or_name: 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_table_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def archive_table_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Archive a table  # noqa: E501

        Archive (soft delete) an existing HubDB table. This archives both the published and draft versions.  # 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_table_with_http_info(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to archive. (required)
        :type table_id_or_name: 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 = ["table_id_or_name"]
        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_table" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'table_id_or_name' is set
        if self.api_client.client_side_validation and local_var_params.get("table_id_or_name") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `table_id_or_name` when calling `archive_table`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # 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(
            "/cms/v3/hubdb/tables/{tableIdOrName}",
            "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_draft_table(self, table_id_or_name, hub_db_table_clone_request, **kwargs):  # noqa: E501
        """Clone a table  # noqa: E501

        Clone an existing HubDB table. The `newName` and `newLabel` of the new table can be sent as JSON in the request body. This will create the cloned table as a draft.  # 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_draft_table(table_id_or_name, hub_db_table_clone_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to clone. (required)
        :type table_id_or_name: str
        :param hub_db_table_clone_request: (required)
        :type hub_db_table_clone_request: HubDbTableCloneRequest
        :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: HubDbTableV3
        """
        kwargs["_return_http_data_only"] = True
        return self.clone_draft_table_with_http_info(table_id_or_name, hub_db_table_clone_request, **kwargs)  # noqa: E501

    def clone_draft_table_with_http_info(self, table_id_or_name, hub_db_table_clone_request, **kwargs):  # noqa: E501
        """Clone a table  # noqa: E501

        Clone an existing HubDB table. The `newName` and `newLabel` of the new table can be sent as JSON in the request body. This will create the cloned table as a draft.  # 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_draft_table_with_http_info(table_id_or_name, hub_db_table_clone_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to clone. (required)
        :type table_id_or_name: str
        :param hub_db_table_clone_request: (required)
        :type hub_db_table_clone_request: HubDbTableCloneRequest
        :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(HubDbTableV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

        query_params = []

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "hub_db_table_clone_request" in local_var_params:
            body_params = local_var_params["hub_db_table_clone_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 = {
            200: "HubDbTableV3",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/draft/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_table(self, hub_db_table_v3_request, **kwargs):  # noqa: E501
        """Create a new table  # noqa: E501

        Creates a new draft HubDB table given a JSON schema. The table name and label should be unique for each account.  # 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_table(hub_db_table_v3_request, async_req=True)
        >>> result = thread.get()

        :param hub_db_table_v3_request: (required)
        :type hub_db_table_v3_request: HubDbTableV3Request
        :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: HubDbTableV3
        """
        kwargs["_return_http_data_only"] = True
        return self.create_table_with_http_info(hub_db_table_v3_request, **kwargs)  # noqa: E501

    def create_table_with_http_info(self, hub_db_table_v3_request, **kwargs):  # noqa: E501
        """Create a new table  # noqa: E501

        Creates a new draft HubDB table given a JSON schema. The table name and label should be unique for each account.  # 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_table_with_http_info(hub_db_table_v3_request, async_req=True)
        >>> result = thread.get()

        :param hub_db_table_v3_request: (required)
        :type hub_db_table_v3_request: HubDbTableV3Request
        :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(HubDbTableV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables",
            "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 export_draft_table(self, table_id_or_name, **kwargs):  # noqa: E501
        """Export a draft table  # noqa: E501

        Exports the draft version of a table to CSV / EXCEL format.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.export_draft_table(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to export. (required)
        :type table_id_or_name: str
        :param format: The file format to export. Possible values include `CSV`, `XLSX`, and `XLS`.
        :type format: 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: file
        """
        kwargs["_return_http_data_only"] = True
        return self.export_draft_table_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def export_draft_table_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Export a draft table  # noqa: E501

        Exports the draft version of a table to CSV / EXCEL format.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.export_draft_table_with_http_info(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to export. (required)
        :type table_id_or_name: str
        :param format: The file format to export. Possible values include `CSV`, `XLSX`, and `XLS`.
        :type format: 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(file, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

        query_params = []
        if local_var_params.get("format") is not None:  # noqa: E501
            query_params.append(("format", local_var_params["format"]))  # 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/vnd.ms-excel", "text/csv", "*/*"])  # noqa: E501

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

        response_types_map = {
            200: "file",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/draft/export",
            "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 export_table(self, table_id_or_name, **kwargs):  # noqa: E501
        """Export a published version of a table  # noqa: E501

        Exports the published version of a table in a specified format.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.export_table(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to export. (required)
        :type table_id_or_name: str
        :param format: The file format to export. Possible values include `CSV`, `XLSX`, and `XLS`.
        :type format: 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: file
        """
        kwargs["_return_http_data_only"] = True
        return self.export_table_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def export_table_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Export a published version of a table  # noqa: E501

        Exports the published version of a table in a specified format.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.export_table_with_http_info(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to export. (required)
        :type table_id_or_name: str
        :param format: The file format to export. Possible values include `CSV`, `XLSX`, and `XLS`.
        :type format: 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(file, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

        query_params = []
        if local_var_params.get("format") is not None:  # noqa: E501
            query_params.append(("format", local_var_params["format"]))  # 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/vnd.ms-excel", "text/csv", "*/*"])  # noqa: E501

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

        response_types_map = {
            200: "file",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/export",
            "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_all_draft_tables(self, **kwargs):  # noqa: E501
        """Return all draft tables  # noqa: E501

        Returns the details for each draft table defined in the specified account, including column definitions.  # 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_draft_tables(async_req=True)
        >>> result = thread.get()

        :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 1000.
        :type limit: int
        :param created_at: Only return tables created at exactly the specified time.
        :type created_at: datetime
        :param created_after: Only return tables created after the specified time.
        :type created_after: datetime
        :param created_before: Only return tables created before the specified time.
        :type created_before: datetime
        :param updated_at: Only return tables last updated at exactly the specified time.
        :type updated_at: datetime
        :param updated_after: Only return tables last updated after the specified time.
        :type updated_after: datetime
        :param updated_before: Only return tables last updated before the specified time.
        :type updated_before: datetime
        :param content_type:
        :type content_type: str
        :param archived: Specifies whether to return archived tables. 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: CollectionResponseWithTotalHubDbTableV3ForwardPaging
        """
        kwargs["_return_http_data_only"] = True
        return self.get_all_draft_tables_with_http_info(**kwargs)  # noqa: E501

    def get_all_draft_tables_with_http_info(self, **kwargs):  # noqa: E501
        """Return all draft tables  # noqa: E501

        Returns the details for each draft table defined in the specified account, including column definitions.  # 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_draft_tables_with_http_info(async_req=True)
        >>> result = thread.get()

        :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 1000.
        :type limit: int
        :param created_at: Only return tables created at exactly the specified time.
        :type created_at: datetime
        :param created_after: Only return tables created after the specified time.
        :type created_after: datetime
        :param created_before: Only return tables created before the specified time.
        :type created_before: datetime
        :param updated_at: Only return tables last updated at exactly the specified time.
        :type updated_at: datetime
        :param updated_after: Only return tables last updated after the specified time.
        :type updated_after: datetime
        :param updated_before: Only return tables last updated before the specified time.
        :type updated_before: datetime
        :param content_type:
        :type content_type: str
        :param archived: Specifies whether to return archived tables. 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(CollectionResponseWithTotalHubDbTableV3ForwardPaging, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["sort", "after", "limit", "created_at", "created_after", "created_before", "updated_at", "updated_after", "updated_before", "content_type", "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_all_draft_tables" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]

        collection_formats = {}

        path_params = {}

        query_params = []
        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("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("content_type") is not None:  # noqa: E501
            query_params.append(("contentType", local_var_params["content_type"]))  # 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: "CollectionResponseWithTotalHubDbTableV3ForwardPaging",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/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_all_tables(self, **kwargs):  # noqa: E501
        """Get all published tables  # noqa: E501

        Returns the details for the published version of each table defined in an account, including column definitions.  # 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_tables(async_req=True)
        >>> result = thread.get()

        :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 1000.
        :type limit: int
        :param created_at: Only return tables created at exactly the specified time.
        :type created_at: datetime
        :param created_after: Only return tables created after the specified time.
        :type created_after: datetime
        :param created_before: Only return tables created before the specified time.
        :type created_before: datetime
        :param updated_at: Only return tables last updated at exactly the specified time.
        :type updated_at: datetime
        :param updated_after: Only return tables last updated after the specified time.
        :type updated_after: datetime
        :param updated_before: Only return tables last updated before the specified time.
        :type updated_before: datetime
        :param content_type:
        :type content_type: str
        :param archived: Specifies whether to return archived tables. 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: CollectionResponseWithTotalHubDbTableV3ForwardPaging
        """
        kwargs["_return_http_data_only"] = True
        return self.get_all_tables_with_http_info(**kwargs)  # noqa: E501

    def get_all_tables_with_http_info(self, **kwargs):  # noqa: E501
        """Get all published tables  # noqa: E501

        Returns the details for the published version of each table defined in an account, including column definitions.  # 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_tables_with_http_info(async_req=True)
        >>> result = thread.get()

        :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 1000.
        :type limit: int
        :param created_at: Only return tables created at exactly the specified time.
        :type created_at: datetime
        :param created_after: Only return tables created after the specified time.
        :type created_after: datetime
        :param created_before: Only return tables created before the specified time.
        :type created_before: datetime
        :param updated_at: Only return tables last updated at exactly the specified time.
        :type updated_at: datetime
        :param updated_after: Only return tables last updated after the specified time.
        :type updated_after: datetime
        :param updated_before: Only return tables last updated before the specified time.
        :type updated_before: datetime
        :param content_type:
        :type content_type: str
        :param archived: Specifies whether to return archived tables. 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(CollectionResponseWithTotalHubDbTableV3ForwardPaging, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["sort", "after", "limit", "created_at", "created_after", "created_before", "updated_at", "updated_after", "updated_before", "content_type", "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_all_tables" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]

        collection_formats = {}

        path_params = {}

        query_params = []
        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("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("content_type") is not None:  # noqa: E501
            query_params.append(("contentType", local_var_params["content_type"]))  # 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: "CollectionResponseWithTotalHubDbTableV3ForwardPaging",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables",
            "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_table_details_by_id(self, table_id_or_name, **kwargs):  # noqa: E501
        """Get details for a draft table  # noqa: E501

        Get the details for the draft version of a specific HubDB table. This will include the definitions for the columns in the table and the number of rows in the table.  # 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_table_details_by_id(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to return. (required)
        :type table_id_or_name: str
        :param is_get_localized_schema:
        :type is_get_localized_schema: bool
        :param archived: Set this to `true` to return an archived table. Defaults to `false`.
        :type archived: bool
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the result.
        :type include_foreign_ids: 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: HubDbTableV3
        """
        kwargs["_return_http_data_only"] = True
        return self.get_draft_table_details_by_id_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def get_draft_table_details_by_id_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Get details for a draft table  # noqa: E501

        Get the details for the draft version of a specific HubDB table. This will include the definitions for the columns in the table and the number of rows in the table.  # 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_table_details_by_id_with_http_info(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to return. (required)
        :type table_id_or_name: str
        :param is_get_localized_schema:
        :type is_get_localized_schema: bool
        :param archived: Set this to `true` to return an archived table. Defaults to `false`.
        :type archived: bool
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the result.
        :type include_foreign_ids: 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(HubDbTableV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

        query_params = []
        if local_var_params.get("is_get_localized_schema") is not None:  # noqa: E501
            query_params.append(("isGetLocalizedSchema", local_var_params["is_get_localized_schema"]))  # noqa: E501
        if local_var_params.get("archived") is not None:  # noqa: E501
            query_params.append(("archived", local_var_params["archived"]))  # noqa: E501
        if local_var_params.get("include_foreign_ids") is not None:  # noqa: E501
            query_params.append(("includeForeignIds", local_var_params["include_foreign_ids"]))  # 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: "HubDbTableV3",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/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_table_details(self, table_id_or_name, **kwargs):  # noqa: E501
        """Get details of a published table  # noqa: E501

        Returns the details for the published version of the specified table. This will include the definitions for the columns in the table and the number of rows in the table.  **Note:** This endpoint can be accessed without any authentication if the table is set to be allowed for public access. To do so, you'll need to include the HubSpot account ID in a `portalId` query parameter.  # 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_table_details(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to return. (required)
        :type table_id_or_name: str
        :param is_get_localized_schema:
        :type is_get_localized_schema: bool
        :param archived: Set this to `true` to return details for an archived table. Defaults to `false`.
        :type archived: bool
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the result.
        :type include_foreign_ids: 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: HubDbTableV3
        """
        kwargs["_return_http_data_only"] = True
        return self.get_table_details_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def get_table_details_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Get details of a published table  # noqa: E501

        Returns the details for the published version of the specified table. This will include the definitions for the columns in the table and the number of rows in the table.  **Note:** This endpoint can be accessed without any authentication if the table is set to be allowed for public access. To do so, you'll need to include the HubSpot account ID in a `portalId` query parameter.  # 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_table_details_with_http_info(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to return. (required)
        :type table_id_or_name: str
        :param is_get_localized_schema:
        :type is_get_localized_schema: bool
        :param archived: Set this to `true` to return details for an archived table. Defaults to `false`.
        :type archived: bool
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the result.
        :type include_foreign_ids: 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(HubDbTableV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

        query_params = []
        if local_var_params.get("is_get_localized_schema") is not None:  # noqa: E501
            query_params.append(("isGetLocalizedSchema", local_var_params["is_get_localized_schema"]))  # noqa: E501
        if local_var_params.get("archived") is not None:  # noqa: E501
            query_params.append(("archived", local_var_params["archived"]))  # noqa: E501
        if local_var_params.get("include_foreign_ids") is not None:  # noqa: E501
            query_params.append(("includeForeignIds", local_var_params["include_foreign_ids"]))  # 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: "HubDbTableV3",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}",
            "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 import_draft_table(self, table_id_or_name, **kwargs):  # noqa: E501
        """Import data into draft table  # noqa: E501

        Import the contents of a CSV file into an existing HubDB table. The data will always be imported into the draft version of the table. Use the `/publish` endpoint to push these changes to the published version. This endpoint takes a multi-part POST request. The first part will be a set of JSON-formatted options for the import and you can specify this with the name as `config`.  The second part will be the CSV file you want to import and you can specify this with the name as `file`. Refer the [overview section](https://developers.hubspot.com/docs/api/cms/hubdb#importing-tables) to check the details and format of the JSON-formatted options for the import.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.import_draft_table(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID of the destination table where data will be imported. (required)
        :type table_id_or_name: str
        :param config:
        :type config: str
        :param file:
        :type file: file
        :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: ImportResult
        """
        kwargs["_return_http_data_only"] = True
        return self.import_draft_table_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def import_draft_table_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Import data into draft table  # noqa: E501

        Import the contents of a CSV file into an existing HubDB table. The data will always be imported into the draft version of the table. Use the `/publish` endpoint to push these changes to the published version. This endpoint takes a multi-part POST request. The first part will be a set of JSON-formatted options for the import and you can specify this with the name as `config`.  The second part will be the CSV file you want to import and you can specify this with the name as `file`. Refer the [overview section](https://developers.hubspot.com/docs/api/cms/hubdb#importing-tables) to check the details and format of the JSON-formatted options for the import.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.import_draft_table_with_http_info(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID of the destination table where data will be imported. (required)
        :type table_id_or_name: str
        :param config:
        :type config: str
        :param file:
        :type file: file
        :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(ImportResult, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

        query_params = []

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

        form_params = []
        local_var_files = {}
        if "config" in local_var_params:
            form_params.append(("config", local_var_params["config"]))  # noqa: E501
        if "file" in local_var_params:
            local_var_files["file"] = local_var_params["file"]  # noqa: E501

        body_params = None
        # 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(["multipart/form-data"], "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: "ImportResult",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/draft/import",
            "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 publish_draft_table(self, table_id_or_name, **kwargs):  # noqa: E501
        """Publish a table from draft  # noqa: E501

        Publishes the table by copying the data and table schema changes from draft version to the published version, meaning any website pages using data from the table will 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.publish_draft_table(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to publish. (required)
        :type table_id_or_name: str
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the response.
        :type include_foreign_ids: 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: HubDbTableV3
        """
        kwargs["_return_http_data_only"] = True
        return self.publish_draft_table_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def publish_draft_table_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Publish a table from draft  # noqa: E501

        Publishes the table by copying the data and table schema changes from draft version to the published version, meaning any website pages using data from the table will 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.publish_draft_table_with_http_info(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to publish. (required)
        :type table_id_or_name: str
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the response.
        :type include_foreign_ids: 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(HubDbTableV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

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

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/draft/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_table(self, table_id_or_name, **kwargs):  # noqa: E501
        """Reset a draft table  # noqa: E501

        Replaces the data in the draft version of the table with values from the published version. Any unpublished changes in the draft will be lost after this call is made.  # 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_table(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to reset. (required)
        :type table_id_or_name: str
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the response.
        :type include_foreign_ids: 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: HubDbTableV3
        """
        kwargs["_return_http_data_only"] = True
        return self.reset_draft_table_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def reset_draft_table_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Reset a draft table  # noqa: E501

        Replaces the data in the draft version of the table with values from the published version. Any unpublished changes in the draft will be lost after this call is made.  # 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_table_with_http_info(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to reset. (required)
        :type table_id_or_name: str
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the response.
        :type include_foreign_ids: 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(HubDbTableV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

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

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/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 unpublish_table(self, table_id_or_name, **kwargs):  # noqa: E501
        """Unpublish a table  # noqa: E501

        Unpublishes the table, meaning any website pages using data from the table will not render any data.  # 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_table(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to publish. (required)
        :type table_id_or_name: str
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the response.
        :type include_foreign_ids: 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: HubDbTableV3
        """
        kwargs["_return_http_data_only"] = True
        return self.unpublish_table_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def unpublish_table_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Unpublish a table  # noqa: E501

        Unpublishes the table, meaning any website pages using data from the table will not render any data.  # 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_table_with_http_info(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to publish. (required)
        :type table_id_or_name: str
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the response.
        :type include_foreign_ids: 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(HubDbTableV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

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

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/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_draft_table(self, table_id_or_name, hub_db_table_v3_request, **kwargs):  # noqa: E501
        """Update an existing table  # noqa: E501

        Update an existing HubDB table. You can use this endpoint to add or remove columns to the table as well as restore an archived table. Tables updated using the endpoint will only modify the draft verion of the table. Use the `/publish` endpoint to push all the changes to the published version. To restore a table, include the query parameter `archived=true` and `\"archived\": false` in the json body. **Note:** You need to include all the columns in the input when you are adding/removing/updating a column. If you do not include an already existing column in the request, it will 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.update_draft_table(table_id_or_name, hub_db_table_v3_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to update. (required)
        :type table_id_or_name: str
        :param hub_db_table_v3_request: (required)
        :type hub_db_table_v3_request: HubDbTableV3Request
        :param is_get_localized_schema:
        :type is_get_localized_schema: bool
        :param archived: Specifies whether to return archived tables. Defaults to `false`.
        :type archived: bool
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the result.
        :type include_foreign_ids: 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: HubDbTableV3
        """
        kwargs["_return_http_data_only"] = True
        return self.update_draft_table_with_http_info(table_id_or_name, hub_db_table_v3_request, **kwargs)  # noqa: E501

    def update_draft_table_with_http_info(self, table_id_or_name, hub_db_table_v3_request, **kwargs):  # noqa: E501
        """Update an existing table  # noqa: E501

        Update an existing HubDB table. You can use this endpoint to add or remove columns to the table as well as restore an archived table. Tables updated using the endpoint will only modify the draft verion of the table. Use the `/publish` endpoint to push all the changes to the published version. To restore a table, include the query parameter `archived=true` and `\"archived\": false` in the json body. **Note:** You need to include all the columns in the input when you are adding/removing/updating a column. If you do not include an already existing column in the request, it will 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.update_draft_table_with_http_info(table_id_or_name, hub_db_table_v3_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to update. (required)
        :type table_id_or_name: str
        :param hub_db_table_v3_request: (required)
        :type hub_db_table_v3_request: HubDbTableV3Request
        :param is_get_localized_schema:
        :type is_get_localized_schema: bool
        :param archived: Specifies whether to return archived tables. Defaults to `false`.
        :type archived: bool
        :param include_foreign_ids: Set this to `true` to populate foreign ID values in the result.
        :type include_foreign_ids: 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(HubDbTableV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if "table_id_or_name" in local_var_params:
            path_params["tableIdOrName"] = local_var_params["table_id_or_name"]  # noqa: E501

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

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "hub_db_table_v3_request" in local_var_params:
            body_params = local_var_params["hub_db_table_v3_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: "HubDbTableV3",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/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"),
        )
