# coding: utf-8

"""
    herd

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

    OpenAPI spec version: 0.178.0-SNAPSHOT
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class Schema(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 = {
        'columns': 'list[SchemaColumn]',
        'partitions': 'list[SchemaColumn]',
        'null_value': 'str',
        'delimiter': 'str',
        'collection_items_delimiter': 'str',
        'map_keys_delimiter': 'str',
        'escape_character': 'str',
        'custom_row_format': 'str',
        'custom_clustered_by': 'str',
        'custom_tbl_properties': 'str',
        'partition_key_group': 'str'
    }

    attribute_map = {
        'columns': 'columns',
        'partitions': 'partitions',
        'null_value': 'nullValue',
        'delimiter': 'delimiter',
        'collection_items_delimiter': 'collectionItemsDelimiter',
        'map_keys_delimiter': 'mapKeysDelimiter',
        'escape_character': 'escapeCharacter',
        'custom_row_format': 'customRowFormat',
        'custom_clustered_by': 'customClusteredBy',
        'custom_tbl_properties': 'customTblProperties',
        'partition_key_group': 'partitionKeyGroup'
    }

    def __init__(self, columns=None, partitions=None, null_value=None, delimiter=None, collection_items_delimiter=None, map_keys_delimiter=None, escape_character=None, custom_row_format=None, custom_clustered_by=None, custom_tbl_properties=None, partition_key_group=None):  # noqa: E501
        """Schema - a model defined in OpenAPI"""  # noqa: E501

        self._columns = None
        self._partitions = None
        self._null_value = None
        self._delimiter = None
        self._collection_items_delimiter = None
        self._map_keys_delimiter = None
        self._escape_character = None
        self._custom_row_format = None
        self._custom_clustered_by = None
        self._custom_tbl_properties = None
        self._partition_key_group = None
        self.discriminator = None

        if columns is not None:
            self.columns = columns
        if partitions is not None:
            self.partitions = partitions
        if null_value is not None:
            self.null_value = null_value
        if delimiter is not None:
            self.delimiter = delimiter
        if collection_items_delimiter is not None:
            self.collection_items_delimiter = collection_items_delimiter
        if map_keys_delimiter is not None:
            self.map_keys_delimiter = map_keys_delimiter
        if escape_character is not None:
            self.escape_character = escape_character
        if custom_row_format is not None:
            self.custom_row_format = custom_row_format
        if custom_clustered_by is not None:
            self.custom_clustered_by = custom_clustered_by
        if custom_tbl_properties is not None:
            self.custom_tbl_properties = custom_tbl_properties
        if partition_key_group is not None:
            self.partition_key_group = partition_key_group

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

        A container for Schema Columns that are present in data file(s) for this Business Object Format. Required when Schema is                   present                  # noqa: E501

        :return: The columns of this Schema.  # noqa: E501
        :rtype: list[SchemaColumn]
        """
        return self._columns

    @columns.setter
    def columns(self, columns):
        """Sets the columns of this Schema.

        A container for Schema Columns that are present in data file(s) for this Business Object Format. Required when Schema is                   present                  # noqa: E501

        :param columns: The columns of this Schema.  # noqa: E501
        :type: list[SchemaColumn]
        """

        self._columns = columns

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

        A container for partition columns in a specific schema. A schema might have zero, one or more partition columns. If a partition                   column is present in the data file(s), it should also be listed as a regular column in the schema with all column information matching (case                   sensitive)                  # noqa: E501

        :return: The partitions of this Schema.  # noqa: E501
        :rtype: list[SchemaColumn]
        """
        return self._partitions

    @partitions.setter
    def partitions(self, partitions):
        """Sets the partitions of this Schema.

        A container for partition columns in a specific schema. A schema might have zero, one or more partition columns. If a partition                   column is present in the data file(s), it should also be listed as a regular column in the schema with all column information matching (case                   sensitive)                  # noqa: E501

        :param partitions: The partitions of this Schema.  # noqa: E501
        :type: list[SchemaColumn]
        """

        self._partitions = partitions

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

        The string to use for the null value (e.g. \"\\\\\\\\N\"). Please note that a null value is allowed to be a whitespace character.                   XML escaping should be used when specifying non-ASCII characters.                   Note: when passing in an empty String, the response XML will return a NULL value (i.e. the tag will be absent). Generate DDL calls will show                   the correct empty String value wrapped in single-quotes.                   Required when Schema is present                  # noqa: E501

        :return: The null_value of this Schema.  # noqa: E501
        :rtype: str
        """
        return self._null_value

    @null_value.setter
    def null_value(self, null_value):
        """Sets the null_value of this Schema.

        The string to use for the null value (e.g. \"\\\\\\\\N\"). Please note that a null value is allowed to be a whitespace character.                   XML escaping should be used when specifying non-ASCII characters.                   Note: when passing in an empty String, the response XML will return a NULL value (i.e. the tag will be absent). Generate DDL calls will show                   the correct empty String value wrapped in single-quotes.                   Required when Schema is present                  # noqa: E501

        :param null_value: The null_value of this Schema.  # noqa: E501
        :type: str
        """

        self._null_value = null_value

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

        The field delimiter (e.g. \"|\"). Please note that a field delimiter is allowed to be a whitespace character.                   XML escaping should be used when specifying non-ASCII characters                  # noqa: E501

        :return: The delimiter of this Schema.  # noqa: E501
        :rtype: str
        """
        return self._delimiter

    @delimiter.setter
    def delimiter(self, delimiter):
        """Sets the delimiter of this Schema.

        The field delimiter (e.g. \"|\"). Please note that a field delimiter is allowed to be a whitespace character.                   XML escaping should be used when specifying non-ASCII characters                  # noqa: E501

        :param delimiter: The delimiter of this Schema.  # noqa: E501
        :type: str
        """

        self._delimiter = delimiter

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

        The collection items delimiter (e.g. \",\"). XML escaping should be used when specifying non-ASCII characters                  # noqa: E501

        :return: The collection_items_delimiter of this Schema.  # noqa: E501
        :rtype: str
        """
        return self._collection_items_delimiter

    @collection_items_delimiter.setter
    def collection_items_delimiter(self, collection_items_delimiter):
        """Sets the collection_items_delimiter of this Schema.

        The collection items delimiter (e.g. \",\"). XML escaping should be used when specifying non-ASCII characters                  # noqa: E501

        :param collection_items_delimiter: The collection_items_delimiter of this Schema.  # noqa: E501
        :type: str
        """

        self._collection_items_delimiter = collection_items_delimiter

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

        The map keys delimiter (e.g. \"=\"). XML escaping should be used when specifying non-ASCII characters                  # noqa: E501

        :return: The map_keys_delimiter of this Schema.  # noqa: E501
        :rtype: str
        """
        return self._map_keys_delimiter

    @map_keys_delimiter.setter
    def map_keys_delimiter(self, map_keys_delimiter):
        """Sets the map_keys_delimiter of this Schema.

        The map keys delimiter (e.g. \"=\"). XML escaping should be used when specifying non-ASCII characters                  # noqa: E501

        :param map_keys_delimiter: The map_keys_delimiter of this Schema.  # noqa: E501
        :type: str
        """

        self._map_keys_delimiter = map_keys_delimiter

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

        The escape character (e.g. \"\\\\\\\\\").                   XML escaping should be used when specifying non-ASCII characters.                  # noqa: E501

        :return: The escape_character of this Schema.  # noqa: E501
        :rtype: str
        """
        return self._escape_character

    @escape_character.setter
    def escape_character(self, escape_character):
        """Sets the escape_character of this Schema.

        The escape character (e.g. \"\\\\\\\\\").                   XML escaping should be used when specifying non-ASCII characters.                  # noqa: E501

        :param escape_character: The escape_character of this Schema.  # noqa: E501
        :type: str
        """

        self._escape_character = escape_character

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

        The customRowFormat is used for defining custom Hive format.                   This will override everything after \"ROW FORMAT\" in DDL including delimiter, escape value, null value statements                  # noqa: E501

        :return: The custom_row_format of this Schema.  # noqa: E501
        :rtype: str
        """
        return self._custom_row_format

    @custom_row_format.setter
    def custom_row_format(self, custom_row_format):
        """Sets the custom_row_format of this Schema.

        The customRowFormat is used for defining custom Hive format.                   This will override everything after \"ROW FORMAT\" in DDL including delimiter, escape value, null value statements                  # noqa: E501

        :param custom_row_format: The custom_row_format of this Schema.  # noqa: E501
        :type: str
        """

        self._custom_row_format = custom_row_format

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

        The customClusteredBy is used to support Hive \"CLUSTERED BY\" statement                  # noqa: E501

        :return: The custom_clustered_by of this Schema.  # noqa: E501
        :rtype: str
        """
        return self._custom_clustered_by

    @custom_clustered_by.setter
    def custom_clustered_by(self, custom_clustered_by):
        """Sets the custom_clustered_by of this Schema.

        The customClusteredBy is used to support Hive \"CLUSTERED BY\" statement                  # noqa: E501

        :param custom_clustered_by: The custom_clustered_by of this Schema.  # noqa: E501
        :type: str
        """

        self._custom_clustered_by = custom_clustered_by

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

        The customTblProperties is used to support Hive \"TBLPROPERTIES\" statement and tag the Hive table definition with your own                   metadata key/value pairs                  # noqa: E501

        :return: The custom_tbl_properties of this Schema.  # noqa: E501
        :rtype: str
        """
        return self._custom_tbl_properties

    @custom_tbl_properties.setter
    def custom_tbl_properties(self, custom_tbl_properties):
        """Sets the custom_tbl_properties of this Schema.

        The customTblProperties is used to support Hive \"TBLPROPERTIES\" statement and tag the Hive table definition with your own                   metadata key/value pairs                  # noqa: E501

        :param custom_tbl_properties: The custom_tbl_properties of this Schema.  # noqa: E501
        :type: str
        """

        self._custom_tbl_properties = custom_tbl_properties

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

        The partition key group that this schema's partition or sub-partition key belongs to. This value will be used to identify the                   ordered set of Expected Partition Values when determining Business Object Data Availability or generating DDL using partition value ranges. A                   Partition Key Group value is required in the Business Object Format in order to use partition value ranges with the Availability and DDL                   services                  # noqa: E501

        :return: The partition_key_group of this Schema.  # noqa: E501
        :rtype: str
        """
        return self._partition_key_group

    @partition_key_group.setter
    def partition_key_group(self, partition_key_group):
        """Sets the partition_key_group of this Schema.

        The partition key group that this schema's partition or sub-partition key belongs to. This value will be used to identify the                   ordered set of Expected Partition Values when determining Business Object Data Availability or generating DDL using partition value ranges. A                   Partition Key Group value is required in the Business Object Format in order to use partition value ranges with the Availability and DDL                   services                  # noqa: E501

        :param partition_key_group: The partition_key_group of this Schema.  # noqa: E501
        :type: str
        """

        self._partition_key_group = partition_key_group

    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, Schema):
            return False

        return self.__dict__ == other.__dict__

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