# coding: utf-8

"""
    Managed Ray API

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

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


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


class TableDataPreview(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    openapi_types = {
        'table_schema': 'list[ColumnInfo]',
        'data_array': 'list[list[object]]',
        'row_count': 'int',
        'truncated': 'bool'
    }

    attribute_map = {
        'table_schema': 'table_schema',
        'data_array': 'data_array',
        'row_count': 'row_count',
        'truncated': 'truncated'
    }

    def __init__(self, table_schema=None, data_array=None, row_count=None, truncated=False, local_vars_configuration=None):  # noqa: E501
        """TableDataPreview - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._table_schema = None
        self._data_array = None
        self._row_count = None
        self._truncated = None
        self.discriminator = None

        self.table_schema = table_schema
        self.data_array = data_array
        self.row_count = row_count
        if truncated is not None:
            self.truncated = truncated

    @property
    def table_schema(self):
        """Gets the table_schema of this TableDataPreview.  # noqa: E501

        Schema definition with column information  # noqa: E501

        :return: The table_schema of this TableDataPreview.  # noqa: E501
        :rtype: list[ColumnInfo]
        """
        return self._table_schema

    @table_schema.setter
    def table_schema(self, table_schema):
        """Sets the table_schema of this TableDataPreview.

        Schema definition with column information  # noqa: E501

        :param table_schema: The table_schema of this TableDataPreview.  # noqa: E501
        :type: list[ColumnInfo]
        """
        if self.local_vars_configuration.client_side_validation and table_schema is None:  # noqa: E501
            raise ValueError("Invalid value for `table_schema`, must not be `None`")  # noqa: E501

        self._table_schema = table_schema

    @property
    def data_array(self):
        """Gets the data_array of this TableDataPreview.  # noqa: E501

        Preview data as array of rows, where each row is an array of values  # noqa: E501

        :return: The data_array of this TableDataPreview.  # noqa: E501
        :rtype: list[list[object]]
        """
        return self._data_array

    @data_array.setter
    def data_array(self, data_array):
        """Sets the data_array of this TableDataPreview.

        Preview data as array of rows, where each row is an array of values  # noqa: E501

        :param data_array: The data_array of this TableDataPreview.  # noqa: E501
        :type: list[list[object]]
        """
        if self.local_vars_configuration.client_side_validation and data_array is None:  # noqa: E501
            raise ValueError("Invalid value for `data_array`, must not be `None`")  # noqa: E501

        self._data_array = data_array

    @property
    def row_count(self):
        """Gets the row_count of this TableDataPreview.  # noqa: E501

        Number of rows returned in this preview  # noqa: E501

        :return: The row_count of this TableDataPreview.  # noqa: E501
        :rtype: int
        """
        return self._row_count

    @row_count.setter
    def row_count(self, row_count):
        """Sets the row_count of this TableDataPreview.

        Number of rows returned in this preview  # noqa: E501

        :param row_count: The row_count of this TableDataPreview.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and row_count is None:  # noqa: E501
            raise ValueError("Invalid value for `row_count`, must not be `None`")  # noqa: E501

        self._row_count = row_count

    @property
    def truncated(self):
        """Gets the truncated of this TableDataPreview.  # noqa: E501

        True if more rows exist in the table than are returned in this preview  # noqa: E501

        :return: The truncated of this TableDataPreview.  # noqa: E501
        :rtype: bool
        """
        return self._truncated

    @truncated.setter
    def truncated(self, truncated):
        """Sets the truncated of this TableDataPreview.

        True if more rows exist in the table than are returned in this preview  # noqa: E501

        :param truncated: The truncated of this TableDataPreview.  # noqa: E501
        :type: bool
        """

        self._truncated = truncated

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, TableDataPreview):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, TableDataPreview):
            return True

        return self.to_dict() != other.to_dict()
