# 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 RowsBatchApi(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_rows(self, table_id_or_name, batch_input_hub_db_table_row_batch_clone_request, **kwargs):  # noqa: E501
        """Clone rows in batch  # noqa: E501

        Clones rows in the draft version of the specified table, given a set of row ids. Maximum of 100 row ids per call.  # 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_rows(table_id_or_name, batch_input_hub_db_table_row_batch_clone_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 batch_input_hub_db_table_row_batch_clone_request: (required)
        :type batch_input_hub_db_table_row_batch_clone_request: BatchInputHubDbTableRowBatchCloneRequest
        :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: BatchResponseHubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.clone_draft_table_rows_with_http_info(table_id_or_name, batch_input_hub_db_table_row_batch_clone_request, **kwargs)  # noqa: E501

    def clone_draft_table_rows_with_http_info(self, table_id_or_name, batch_input_hub_db_table_row_batch_clone_request, **kwargs):  # noqa: E501
        """Clone rows in batch  # noqa: E501

        Clones rows in the draft version of the specified table, given a set of row ids. Maximum of 100 row ids per call.  # 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_rows_with_http_info(table_id_or_name, batch_input_hub_db_table_row_batch_clone_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 batch_input_hub_db_table_row_batch_clone_request: (required)
        :type batch_input_hub_db_table_row_batch_clone_request: BatchInputHubDbTableRowBatchCloneRequest
        :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(BatchResponseHubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "batch_input_hub_db_table_row_batch_clone_request" in local_var_params:
            body_params = local_var_params["batch_input_hub_db_table_row_batch_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: "BatchResponseHubDbTableRowV3",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows/draft/batch/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_draft_table_rows(self, table_id_or_name, batch_input_hub_db_table_row_v3_request, **kwargs):  # noqa: E501
        """Create rows in batch  # noqa: E501

        Creates rows in the draft version of the specified table, given an array of row objects. Maximum of 100 row object per call. See the overview section for more details with an example.  # 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_draft_table_rows(table_id_or_name, batch_input_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 batch_input_hub_db_table_row_v3_request: (required)
        :type batch_input_hub_db_table_row_v3_request: BatchInputHubDbTableRowV3Request
        :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: BatchResponseHubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.create_draft_table_rows_with_http_info(table_id_or_name, batch_input_hub_db_table_row_v3_request, **kwargs)  # noqa: E501

    def create_draft_table_rows_with_http_info(self, table_id_or_name, batch_input_hub_db_table_row_v3_request, **kwargs):  # noqa: E501
        """Create rows in batch  # noqa: E501

        Creates rows in the draft version of the specified table, given an array of row objects. Maximum of 100 row object per call. See the overview section for more details with an example.  # 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_draft_table_rows_with_http_info(table_id_or_name, batch_input_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 batch_input_hub_db_table_row_v3_request: (required)
        :type batch_input_hub_db_table_row_v3_request: BatchInputHubDbTableRowV3Request
        :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(BatchResponseHubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "batch_input_hub_db_table_row_v3_request" in local_var_params:
            body_params = local_var_params["batch_input_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: "BatchResponseHubDbTableRowV3",
            207: "BatchResponseHubDbTableRowV3WithErrors",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows/draft/batch/create",
            "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 purge_draft_table_rows(self, table_id_or_name, batch_input_string, **kwargs):  # noqa: E501
        """Permanently deletes rows  # noqa: E501

        Permanently deletes rows from the draft version of the table, given a set of row IDs. Maximum of 100 row IDs per call.  # 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_rows(table_id_or_name, batch_input_string, 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 batch_input_string: (required)
        :type batch_input_string: BatchInputString
        :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_rows_with_http_info(table_id_or_name, batch_input_string, **kwargs)  # noqa: E501

    def purge_draft_table_rows_with_http_info(self, table_id_or_name, batch_input_string, **kwargs):  # noqa: E501
        """Permanently deletes rows  # noqa: E501

        Permanently deletes rows from the draft version of the table, given a set of row IDs. Maximum of 100 row IDs per call.  # 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_rows_with_http_info(table_id_or_name, batch_input_string, 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 batch_input_string: (required)
        :type batch_input_string: BatchInputString
        :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", "batch_input_string"]
        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_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 `purge_draft_table_rows`")  # noqa: E501
        # verify the required parameter 'batch_input_string' is set
        if self.api_client.client_side_validation and local_var_params.get("batch_input_string") is None:  # noqa: E501
            raise ApiValueError("Missing the required parameter `batch_input_string` when calling `purge_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 = []

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "batch_input_string" in local_var_params:
            body_params = local_var_params["batch_input_string"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(["*/*"])  # 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 = {}

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

        Returns rows in the draft version of the specified table, given a set of row IDs.  # 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, batch_input_string, 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 batch_input_string: (required)
        :type batch_input_string: BatchInputString
        :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: BatchResponseHubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.read_draft_table_rows_with_http_info(table_id_or_name, batch_input_string, **kwargs)  # noqa: E501

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

        Returns rows in the draft version of the specified table, given a set of row IDs.  # 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, batch_input_string, 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 batch_input_string: (required)
        :type batch_input_string: BatchInputString
        :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(BatchResponseHubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "batch_input_string" in local_var_params:
            body_params = local_var_params["batch_input_string"]
        # 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: "BatchResponseHubDbTableRowV3",
            207: "BatchResponseHubDbTableRowV3WithErrors",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows/draft/batch/read",
            "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 read_table_rows(self, table_id_or_name, batch_input_string, **kwargs):  # noqa: E501
        """Get a set of rows  # noqa: E501

        Returns rows in the published version of the specified table, given a set of row IDs. **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.read_table_rows(table_id_or_name, batch_input_string, 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 batch_input_string: (required)
        :type batch_input_string: BatchInputString
        :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: BatchResponseHubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.read_table_rows_with_http_info(table_id_or_name, batch_input_string, **kwargs)  # noqa: E501

    def read_table_rows_with_http_info(self, table_id_or_name, batch_input_string, **kwargs):  # noqa: E501
        """Get a set of rows  # noqa: E501

        Returns rows in the published version of the specified table, given a set of row IDs. **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.read_table_rows_with_http_info(table_id_or_name, batch_input_string, 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 batch_input_string: (required)
        :type batch_input_string: BatchInputString
        :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(BatchResponseHubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

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

        form_params = []
        local_var_files = {}

        body_params = None
        if "batch_input_string" in local_var_params:
            body_params = local_var_params["batch_input_string"]
        # 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: "BatchResponseHubDbTableRowV3",
            207: "BatchResponseHubDbTableRowV3WithErrors",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows/batch/read",
            "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 replace_draft_table_rows(self, table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_request, **kwargs):  # noqa: E501
        """Replace rows in batch in draft table  # noqa: E501

        Replaces multiple rows as a batch in the draft version of the table, with a maximum of 100 rows per call. See the endpoint `PUT /tables/{tableIdOrName}/rows/{rowId}/draft` for details on updating a single row.  # 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_rows(table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_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 batch_input_hub_db_table_row_v3_batch_update_request: (required)
        :type batch_input_hub_db_table_row_v3_batch_update_request: BatchInputHubDbTableRowV3BatchUpdateRequest
        :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: BatchResponseHubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.replace_draft_table_rows_with_http_info(table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_request, **kwargs)  # noqa: E501

    def replace_draft_table_rows_with_http_info(self, table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_request, **kwargs):  # noqa: E501
        """Replace rows in batch in draft table  # noqa: E501

        Replaces multiple rows as a batch in the draft version of the table, with a maximum of 100 rows per call. See the endpoint `PUT /tables/{tableIdOrName}/rows/{rowId}/draft` for details on updating a single row.  # 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_rows_with_http_info(table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_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 batch_input_hub_db_table_row_v3_batch_update_request: (required)
        :type batch_input_hub_db_table_row_v3_batch_update_request: BatchInputHubDbTableRowV3BatchUpdateRequest
        :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(BatchResponseHubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

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

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

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "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: "BatchResponseHubDbTableRowV3",
            207: "BatchResponseHubDbTableRowV3WithErrors",
        }

        return self.api_client.call_api(
            "/cms/v3/hubdb/tables/{tableIdOrName}/rows/draft/batch/replace",
            "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_rows(self, table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_request, **kwargs):  # noqa: E501
        """Update rows in batch in draft table  # noqa: E501

        Updates multiple rows as a batch in the draft version of the table, with a maximum of 100 rows per call. See the endpoint `PATCH /tables/{tableIdOrName}/rows/{rowId}/draft` for details on updating a single row.  # 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_rows(table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_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 batch_input_hub_db_table_row_v3_batch_update_request: (required)
        :type batch_input_hub_db_table_row_v3_batch_update_request: BatchInputHubDbTableRowV3BatchUpdateRequest
        :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: BatchResponseHubDbTableRowV3
        """
        kwargs["_return_http_data_only"] = True
        return self.update_draft_table_rows_with_http_info(table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_request, **kwargs)  # noqa: E501

    def update_draft_table_rows_with_http_info(self, table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_request, **kwargs):  # noqa: E501
        """Update rows in batch in draft table  # noqa: E501

        Updates multiple rows as a batch in the draft version of the table, with a maximum of 100 rows per call. See the endpoint `PATCH /tables/{tableIdOrName}/rows/{rowId}/draft` for details on updating a single row.  # 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_rows_with_http_info(table_id_or_name, batch_input_hub_db_table_row_v3_batch_update_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 batch_input_hub_db_table_row_v3_batch_update_request: (required)
        :type batch_input_hub_db_table_row_v3_batch_update_request: BatchInputHubDbTableRowV3BatchUpdateRequest
        :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(BatchResponseHubDbTableRowV3, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

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

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

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

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "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: "BatchResponseHubDbTableRowV3",
            207: "BatchResponseHubDbTableRowV3WithErrors",
        }

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