# 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 RowsApi(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 clone_draft_table_row(self, table_id_or_name, row_id, **kwargs):  # noqa: E501
        """Clone a row  # noqa: E501

        Clones a single row in the draft version of a 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.clone_draft_table_row(table_id_or_name, row_id, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param name:
        :type 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: HubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.clone_draft_table_row_with_http_info(table_id_or_name, row_id, **kwargs)  # noqa: E501

    def clone_draft_table_row_with_http_info(self, table_id_or_name, row_id, **kwargs):  # noqa: E501
        """Clone a row  # noqa: E501

        Clones a single row in the draft version of a 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.clone_draft_table_row_with_http_info(table_id_or_name, row_id, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param name:
        :type 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: tuple(HubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        if self.api_client.client_side_validation and "row_id" in local_var_params and not re.search(r"\d+", local_var_params["row_id"]):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `row_id` when calling `clone_draft_table_row`, must conform to the pattern `/\d+/`")  # 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
        if "row_id" in local_var_params:
            path_params["rowId"] = local_var_params["row_id"]  # noqa: E501

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

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/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_row(self, table_id_or_name, hub_db_table_row_v3_request, **kwargs):  # noqa: E501
        """Add a new row to a table  # noqa: E501

        Add a new row to a HubDB table. New rows will be added to the draft version of the table. Use the `/publish` endpoint to push these changes to published version.  # 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_row(table_id_or_name, hub_db_table_row_v3_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the target table. (required)
        :type table_id_or_name: str
        :param hub_db_table_row_v3_request: (required)
        :type hub_db_table_row_v3_request: HubDbTableRowV3Request
        :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: HubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.create_table_row_with_http_info(table_id_or_name, hub_db_table_row_v3_request, **kwargs)  # noqa: E501

    def create_table_row_with_http_info(self, table_id_or_name, hub_db_table_row_v3_request, **kwargs):  # noqa: E501
        """Add a new row to a table  # noqa: E501

        Add a new row to a HubDB table. New rows will be added to the draft version of the table. Use the `/publish` endpoint to push these changes to published version.  # 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_row_with_http_info(table_id_or_name, hub_db_table_row_v3_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the target table. (required)
        :type table_id_or_name: str
        :param hub_db_table_row_v3_request: (required)
        :type hub_db_table_row_v3_request: HubDbTableRowV3Request
        :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(HubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["table_id_or_name", "hub_db_table_row_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_row" % 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 `create_table_row`")  # noqa: E501
        # verify the required parameter 'hub_db_table_row_v3_request' is set
        if self.api_client.client_side_validation and local_var_params.get("hub_db_table_row_v3_request") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `hub_db_table_row_v3_request` when calling `create_table_row`")  # 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_row_v3_request" in local_var_params:
            body_params = local_var_params["hub_db_table_row_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: "HubDbTableRowV3",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get("_return_http_data_only"),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def get_draft_table_row_by_id(self, table_id_or_name, row_id, **kwargs):  # noqa: E501
        """Get a row from the draft table  # noqa: E501

        Get a single row by ID from a table's draft version.  # 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_row_by_id(table_id_or_name, row_id, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param archived:
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.get_draft_table_row_by_id_with_http_info(table_id_or_name, row_id, **kwargs)  # noqa: E501

    def get_draft_table_row_by_id_with_http_info(self, table_id_or_name, row_id, **kwargs):  # noqa: E501
        """Get a row from the draft table  # noqa: E501

        Get a single row by ID from a table's draft version.  # 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_row_by_id_with_http_info(table_id_or_name, row_id, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param archived:
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(HubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_draft_table_row_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_row_by_id`")  # noqa: E501
        # verify the required parameter 'row_id' is set
        if self.api_client.client_side_validation and local_var_params.get("row_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `row_id` when calling `get_draft_table_row_by_id`")  # noqa: E501

        if self.api_client.client_side_validation and "row_id" in local_var_params and not re.search(r"\d+", local_var_params["row_id"]):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `row_id` when calling `get_draft_table_row_by_id`, must conform to the pattern `/\d+/`")  # 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
        if "row_id" in local_var_params:
            path_params["rowId"] = local_var_params["row_id"]  # noqa: E501

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

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

        form_params = []
        local_var_files = {}

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

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

        response_types_map = {
            200: "HubDbTableRowV3",
        }

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

        Get a single row by ID from the published version of a table. **Note:** This endpoint can be accessed without any authentication, if the table is set to be allowed for public access.  # 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_row(table_id_or_name, row_id, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param archived:
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.get_table_row_with_http_info(table_id_or_name, row_id, **kwargs)  # noqa: E501

    def get_table_row_with_http_info(self, table_id_or_name, row_id, **kwargs):  # noqa: E501
        """Get a table row  # noqa: E501

        Get a single row by ID from the published version of a table. **Note:** This endpoint can be accessed without any authentication, if the table is set to be allowed for public access.  # 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_row_with_http_info(table_id_or_name, row_id, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param archived:
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(HubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_table_row" % 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_row`")  # noqa: E501
        # verify the required parameter 'row_id' is set
        if self.api_client.client_side_validation and local_var_params.get("row_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `row_id` when calling `get_table_row`")  # noqa: E501

        if self.api_client.client_side_validation and "row_id" in local_var_params and not re.search(r"\d+", local_var_params["row_id"]):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `row_id` when calling `get_table_row`, must conform to the pattern `/\d+/`")  # 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
        if "row_id" in local_var_params:
            path_params["rowId"] = local_var_params["row_id"]  # noqa: E501

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

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

        form_params = []
        local_var_files = {}

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

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

        response_types_map = {
            200: "HubDbTableRowV3",
        }

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

        Returns a set of rows in the published version of the specified table. Row results can be filtered and sorted. Filtering and sorting options will be sent as query parameters to the API request. For example, by adding the query parameters `column1__gt=5&sort=-column1`, API returns the rows with values for column `column1` greater than 5 and in the descending order of `column1` values. Refer to the [overview section](https://developers.hubspot.com/docs/api/cms/hubdb#filtering-and-sorting-table-rows) for detailed filtering and sorting options. **Note:** This endpoint can be accessed without any authentication, if the table is set to be allowed for public access.  # 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_rows(table_id_or_name, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table to query. (required)
        :type table_id_or_name: str
        :param sort: Specifies the column names to sort the results by. See the above description for more details.
        :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 properties: Specify the column names to get results containing only the required columns instead of all column details.
        :type properties: list[str]
        :param offset:
        :type offset: int
        :param archived:
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.get_table_rows_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def get_table_rows_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Get rows for a table  # noqa: E501

        Returns a set of rows in the published version of the specified table. Row results can be filtered and sorted. Filtering and sorting options will be sent as query parameters to the API request. For example, by adding the query parameters `column1__gt=5&sort=-column1`, API returns the rows with values for column `column1` greater than 5 and in the descending order of `column1` values. Refer to the [overview section](https://developers.hubspot.com/docs/api/cms/hubdb#filtering-and-sorting-table-rows) for detailed filtering and sorting options. **Note:** This endpoint can be accessed without any authentication, if the table is set to be allowed for public access.  # 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_rows_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 query. (required)
        :type table_id_or_name: str
        :param sort: Specifies the column names to sort the results by. See the above description for more details.
        :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 properties: Specify the column names to get results containing only the required columns instead of all column details.
        :type properties: list[str]
        :param offset:
        :type offset: int
        :param archived:
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["table_id_or_name", "sort", "after", "limit", "properties", "offset", "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_table_rows" % 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_rows`")  # 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("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("properties") is not None:  # noqa: E501
            query_params.append(("properties", local_var_params["properties"]))  # noqa: E501
            collection_formats["properties"] = "multi"  # noqa: E501
        if local_var_params.get("offset") is not None:  # noqa: E501
            query_params.append(("offset", local_var_params["offset"]))  # 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: "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows",
            "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 purge_draft_table_row(self, table_id_or_name, row_id, **kwargs):  # noqa: E501
        """Permanently deletes a row  # noqa: E501

        Permanently deletes a row from a table's draft version.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

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

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs["_return_http_data_only"] = True
        return self.purge_draft_table_row_with_http_info(table_id_or_name, row_id, **kwargs)  # noqa: E501

    def purge_draft_table_row_with_http_info(self, table_id_or_name, row_id, **kwargs):  # noqa: E501
        """Permanently deletes a row  # noqa: E501

        Permanently deletes a row from a table's draft version.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

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

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        local_var_params = locals()

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

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method purge_draft_table_row" % 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 `purge_draft_table_row`")  # noqa: E501
        # verify the required parameter 'row_id' is set
        if self.api_client.client_side_validation and local_var_params.get("row_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `row_id` when calling `purge_draft_table_row`")  # noqa: E501

        if self.api_client.client_side_validation and "row_id" in local_var_params and not re.search(r"\d+", local_var_params["row_id"]):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `row_id` when calling `purge_draft_table_row`, must conform to the pattern `/\d+/`")  # 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
        if "row_id" in local_var_params:
            path_params["rowId"] = local_var_params["row_id"]  # noqa: E501

        query_params = []

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

        form_params = []
        local_var_files = {}

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

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

        response_types_map = {}

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

        Returns rows in the draft version of the specified table. Row results can be filtered and sorted. Filtering and sorting options will be sent as query parameters to the API request. For example, by adding the query parameters `column1__gt=5&sort=-column1`, API returns the rows with values for column `column1` greater than 5 and in the descending order of `column1` values. Refer to the [overview section](https://developers.hubspot.com/docs/api/cms/hubdb#filtering-and-sorting-table-rows) for detailed filtering and sorting options.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

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

        :param table_id_or_name: The ID or name of the table to query. (required)
        :type table_id_or_name: str
        :param sort: Specifies the column names to sort the results by.
        :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 properties: Specify the column names to get results containing only the required columns instead of all column details. If you want to include multiple columns in the result, use this query param as many times.
        :type properties: list[str]
        :param offset:
        :type offset: int
        :param archived:
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.read_draft_table_rows_with_http_info(table_id_or_name, **kwargs)  # noqa: E501

    def read_draft_table_rows_with_http_info(self, table_id_or_name, **kwargs):  # noqa: E501
        """Get rows from draft table  # noqa: E501

        Returns rows in the draft version of the specified table. Row results can be filtered and sorted. Filtering and sorting options will be sent as query parameters to the API request. For example, by adding the query parameters `column1__gt=5&sort=-column1`, API returns the rows with values for column `column1` greater than 5 and in the descending order of `column1` values. Refer to the [overview section](https://developers.hubspot.com/docs/api/cms/hubdb#filtering-and-sorting-table-rows) for detailed filtering and sorting options.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.read_draft_table_rows_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 query. (required)
        :type table_id_or_name: str
        :param sort: Specifies the column names to sort the results by.
        :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 properties: Specify the column names to get results containing only the required columns instead of all column details. If you want to include multiple columns in the result, use this query param as many times.
        :type properties: list[str]
        :param offset:
        :type offset: int
        :param archived:
        :type archived: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["table_id_or_name", "sort", "after", "limit", "properties", "offset", "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 read_draft_table_rows" % 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 `read_draft_table_rows`")  # 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("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("properties") is not None:  # noqa: E501
            query_params.append(("properties", local_var_params["properties"]))  # noqa: E501
            collection_formats["properties"] = "multi"  # noqa: E501
        if local_var_params.get("offset") is not None:  # noqa: E501
            query_params.append(("offset", local_var_params["offset"]))  # 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: "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows/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 replace_draft_table_row(self, table_id_or_name, row_id, hub_db_table_row_v3_request, **kwargs):  # noqa: E501
        """Replaces an existing row  # noqa: E501

        Replace a single row in the draft version of a table. All column values must be specified. If a column has a value in the target table and this request doesn't define that value, it will be deleted. See the \"Create a row\" endpoint for instructions on how to format the JSON row 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.replace_draft_table_row(table_id_or_name, row_id, hub_db_table_row_v3_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param hub_db_table_row_v3_request: (required)
        :type hub_db_table_row_v3_request: HubDbTableRowV3Request
        :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: HubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.replace_draft_table_row_with_http_info(table_id_or_name, row_id, hub_db_table_row_v3_request, **kwargs)  # noqa: E501

    def replace_draft_table_row_with_http_info(self, table_id_or_name, row_id, hub_db_table_row_v3_request, **kwargs):  # noqa: E501
        """Replaces an existing row  # noqa: E501

        Replace a single row in the draft version of a table. All column values must be specified. If a column has a value in the target table and this request doesn't define that value, it will be deleted. See the \"Create a row\" endpoint for instructions on how to format the JSON row 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.replace_draft_table_row_with_http_info(table_id_or_name, row_id, hub_db_table_row_v3_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param hub_db_table_row_v3_request: (required)
        :type hub_db_table_row_v3_request: HubDbTableRowV3Request
        :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(HubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["table_id_or_name", "row_id", "hub_db_table_row_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 replace_draft_table_row" % 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 `replace_draft_table_row`")  # noqa: E501
        # verify the required parameter 'row_id' is set
        if self.api_client.client_side_validation and local_var_params.get("row_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `row_id` when calling `replace_draft_table_row`")  # noqa: E501
        # verify the required parameter 'hub_db_table_row_v3_request' is set
        if self.api_client.client_side_validation and local_var_params.get("hub_db_table_row_v3_request") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `hub_db_table_row_v3_request` when calling `replace_draft_table_row`")  # noqa: E501

        if self.api_client.client_side_validation and "row_id" in local_var_params and not re.search(r"\d+", local_var_params["row_id"]):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `row_id` when calling `replace_draft_table_row`, must conform to the pattern `/\d+/`")  # 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
        if "row_id" in local_var_params:
            path_params["rowId"] = local_var_params["row_id"]  # noqa: E501

        query_params = []

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "hub_db_table_row_v3_request" in local_var_params:
            body_params = local_var_params["hub_db_table_row_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"], "PUT", body_params))  # noqa: E501
        if content_types_list:
            header_params["Content-Type"] = content_types_list

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

        response_types_map = {
            200: "HubDbTableRowV3",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft",
            "PUT",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_types_map=response_types_map,
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get("_return_http_data_only"),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
            _request_auth=local_var_params.get("_request_auth"),
        )

    def update_draft_table_row(self, table_id_or_name, row_id, hub_db_table_row_v3_request, **kwargs):  # noqa: E501
        """Updates an existing row  # noqa: E501

        Sparse updates a single row in the table's draft version. All the column values need not be specified. Only the columns or fields that needs to be modified can be specified. See the \"Create a row\" endpoint for instructions on how to format the JSON row 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.update_draft_table_row(table_id_or_name, row_id, hub_db_table_row_v3_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param hub_db_table_row_v3_request: (required)
        :type hub_db_table_row_v3_request: HubDbTableRowV3Request
        :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: HubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.update_draft_table_row_with_http_info(table_id_or_name, row_id, hub_db_table_row_v3_request, **kwargs)  # noqa: E501

    def update_draft_table_row_with_http_info(self, table_id_or_name, row_id, hub_db_table_row_v3_request, **kwargs):  # noqa: E501
        """Updates an existing row  # noqa: E501

        Sparse updates a single row in the table's draft version. All the column values need not be specified. Only the columns or fields that needs to be modified can be specified. See the \"Create a row\" endpoint for instructions on how to format the JSON row 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.update_draft_table_row_with_http_info(table_id_or_name, row_id, hub_db_table_row_v3_request, async_req=True)
        >>> result = thread.get()

        :param table_id_or_name: The ID or name of the table (required)
        :type table_id_or_name: str
        :param row_id: The ID of the row (required)
        :type row_id: str
        :param hub_db_table_row_v3_request: (required)
        :type hub_db_table_row_v3_request: HubDbTableRowV3Request
        :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(HubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ["table_id_or_name", "row_id", "hub_db_table_row_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 update_draft_table_row" % 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_row`")  # noqa: E501
        # verify the required parameter 'row_id' is set
        if self.api_client.client_side_validation and local_var_params.get("row_id") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `row_id` when calling `update_draft_table_row`")  # noqa: E501
        # verify the required parameter 'hub_db_table_row_v3_request' is set
        if self.api_client.client_side_validation and local_var_params.get("hub_db_table_row_v3_request") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `hub_db_table_row_v3_request` when calling `update_draft_table_row`")  # noqa: E501

        if self.api_client.client_side_validation and "row_id" in local_var_params and not re.search(r"\d+", local_var_params["row_id"]):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `row_id` when calling `update_draft_table_row`, must conform to the pattern `/\d+/`")  # 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
        if "row_id" in local_var_params:
            path_params["rowId"] = local_var_params["row_id"]  # noqa: E501

        query_params = []

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "hub_db_table_row_v3_request" in local_var_params:
            body_params = local_var_params["hub_db_table_row_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: "HubDbTableRowV3",
        }

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