# coding: utf-8

"""
    Tator REST API

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

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


import pprint
import re  # noqa: F401

import six

from ..configuration import Configuration


class Section(object):
    """
    """

    """
    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 = {
        'attributes': 'dict(str, object)',
        'created_by': 'int',
        'created_datetime': 'datetime',
        'dtype': 'str',
        'elemental_id': 'str',
        'explicit_listing': 'bool',
        'id': 'int',
        'master_section': 'int',
        'media': 'list[int]',
        'name': 'str',
        'object_search': 'AttributeOperationSpec',
        'path': 'str',
        'project': 'int',
        'related_search': 'AttributeOperationSpec',
        'tator_user_sections': 'str',
        'visible': 'bool'
    }

    attribute_map = {
        'attributes': 'attributes',
        'created_by': 'created_by',
        'created_datetime': 'created_datetime',
        'dtype': 'dtype',
        'elemental_id': 'elemental_id',
        'explicit_listing': 'explicit_listing',
        'id': 'id',
        'master_section': 'master_section',
        'media': 'media',
        'name': 'name',
        'object_search': 'object_search',
        'path': 'path',
        'project': 'project',
        'related_search': 'related_search',
        'tator_user_sections': 'tator_user_sections',
        'visible': 'visible'
    }

    def __init__(self, attributes=None, created_by=None, created_datetime=None, dtype=None, elemental_id=None, explicit_listing=None, id=None, master_section=None, media=None, name=None, object_search=None, path=None, project=None, related_search=None, tator_user_sections=None, visible=None, local_vars_configuration=None):  # noqa: E501
        """Section - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._attributes = None
        self._created_by = None
        self._created_datetime = None
        self._dtype = None
        self._elemental_id = None
        self._explicit_listing = None
        self._id = None
        self._master_section = None
        self._media = None
        self._name = None
        self._object_search = None
        self._path = None
        self._project = None
        self._related_search = None
        self._tator_user_sections = None
        self._visible = None
        self.discriminator = None

        if attributes is not None:
            self.attributes = attributes
        if created_by is not None:
            self.created_by = created_by
        self.created_datetime = created_datetime
        if dtype is not None:
            self.dtype = dtype
        self.elemental_id = elemental_id
        if explicit_listing is not None:
            self.explicit_listing = explicit_listing
        if id is not None:
            self.id = id
        if master_section is not None:
            self.master_section = master_section
        if media is not None:
            self.media = media
        if name is not None:
            self.name = name
        if object_search is not None:
            self.object_search = object_search
        self.path = path
        if project is not None:
            self.project = project
        if related_search is not None:
            self.related_search = related_search
        if tator_user_sections is not None:
            self.tator_user_sections = tator_user_sections
        if visible is not None:
            self.visible = visible

    @property
    def attributes(self):
        """
        Object containing attribute values.

        :return: The attributes of this Section. 
        :rtype: dict(str, object)
        """
        return self._attributes

    @attributes.setter
    def attributes(self, attributes):
        """
        Object containing attribute values.

        :param attributes: The attributes of this Section.
        :type: dict(str, object)
        """

        self._attributes = attributes

    @property
    def created_by(self):
        """
        Unique integer identifying the user who created this localization.

        :return: The created_by of this Section. 
        :rtype: int
        """
        return self._created_by

    @created_by.setter
    def created_by(self, created_by):
        """
        Unique integer identifying the user who created this localization.

        :param created_by: The created_by of this Section.
        :type: int
        """

        self._created_by = created_by

    @property
    def created_datetime(self):
        """
        The elemental ID of the object.

        :return: The created_datetime of this Section. 
        :rtype: datetime
        """
        return self._created_datetime

    @created_datetime.setter
    def created_datetime(self, created_datetime):
        """
        The elemental ID of the object.

        :param created_datetime: The created_datetime of this Section.
        :type: datetime
        """

        self._created_datetime = created_datetime

    @property
    def dtype(self):
        """
        Type of the section.

        :return: The dtype of this Section. 
        :rtype: str
        """
        return self._dtype

    @dtype.setter
    def dtype(self, dtype):
        """
        Type of the section.

        :param dtype: The dtype of this Section.
        :type: str
        """
        allowed_values = ["folder", "playlist", "saved_search"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and dtype not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `dtype` ({0}), must be one of {1}"  # noqa: E501
                .format(dtype, allowed_values)
            )

        self._dtype = dtype

    @property
    def elemental_id(self):
        """
        The elemental ID of the object.

        :return: The elemental_id of this Section. 
        :rtype: str
        """
        return self._elemental_id

    @elemental_id.setter
    def elemental_id(self, elemental_id):
        """
        The elemental ID of the object.

        :param elemental_id: The elemental_id of this Section.
        :type: str
        """

        self._elemental_id = elemental_id

    @property
    def explicit_listing(self):
        """
        Deprecated, set `dtype` to `playlist` instead. Determines whether the section is explicitly made up of media IDs.

        :return: The explicit_listing of this Section. 
        :rtype: bool
        """
        return self._explicit_listing

    @explicit_listing.setter
    def explicit_listing(self, explicit_listing):
        """
        Deprecated, set `dtype` to `playlist` instead. Determines whether the section is explicitly made up of media IDs.

        :param explicit_listing: The explicit_listing of this Section.
        :type: bool
        """

        self._explicit_listing = explicit_listing

    @property
    def id(self):
        """
        Unique integer identifying the section.

        :return: The id of this Section. 
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Unique integer identifying the section.

        :param id: The id of this Section.
        :type: int
        """

        self._id = id

    @property
    def master_section(self):
        """
        Unique ID to define the ACL origin of this object. If not set defaults to the master section of the primary_section.

        :return: The master_section of this Section. 
        :rtype: int
        """
        return self._master_section

    @master_section.setter
    def master_section(self, master_section):
        """
        Unique ID to define the ACL origin of this object. If not set defaults to the master section of the primary_section.

        :param master_section: The master_section of this Section.
        :type: int
        """

        self._master_section = master_section

    @property
    def media(self):
        """
        List of media IDs that belong in this section.

        :return: The media of this Section. 
        :rtype: list[int]
        """
        return self._media

    @media.setter
    def media(self, media):
        """
        List of media IDs that belong in this section.

        :param media: The media of this Section.
        :type: list[int]
        """

        self._media = media

    @property
    def name(self):
        """
        Unique name of the section.

        :return: The name of this Section. 
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Unique name of the section.

        :param name: The name of this Section.
        :type: str
        """

        self._name = name

    @property
    def object_search(self):
        """

        :return: The object_search of this Section. 
        :rtype: AttributeOperationSpec
        """
        return self._object_search

    @object_search.setter
    def object_search(self, object_search):
        """

        :param object_search: The object_search of this Section.
        :type: AttributeOperationSpec
        """

        self._object_search = object_search

    @property
    def path(self):
        """
        A path to represent nested sections. If not supplied, defaults to `re.sub(r'[^A-Za-z0-9_-]',path)`

        :return: The path of this Section. 
        :rtype: str
        """
        return self._path

    @path.setter
    def path(self, path):
        """
        A path to represent nested sections. If not supplied, defaults to `re.sub(r'[^A-Za-z0-9_-]',path)`

        :param path: The path of this Section.
        :type: str
        """

        self._path = path

    @property
    def project(self):
        """
        Unique integer identifying the project associated with the section.

        :return: The project of this Section. 
        :rtype: int
        """
        return self._project

    @project.setter
    def project(self, project):
        """
        Unique integer identifying the project associated with the section.

        :param project: The project of this Section.
        :type: int
        """

        self._project = project

    @property
    def related_search(self):
        """

        :return: The related_search of this Section. 
        :rtype: AttributeOperationSpec
        """
        return self._related_search

    @related_search.setter
    def related_search(self, related_search):
        """

        :param related_search: The related_search of this Section.
        :type: AttributeOperationSpec
        """

        self._related_search = related_search

    @property
    def tator_user_sections(self):
        """
        Attribute that is applied to media to identify membership to a section.

        :return: The tator_user_sections of this Section. 
        :rtype: str
        """
        return self._tator_user_sections

    @tator_user_sections.setter
    def tator_user_sections(self, tator_user_sections):
        """
        Attribute that is applied to media to identify membership to a section.

        :param tator_user_sections: The tator_user_sections of this Section.
        :type: str
        """

        self._tator_user_sections = tator_user_sections

    @property
    def visible(self):
        """
        Determines the visibility in the UI.

        :return: The visible of this Section. 
        :rtype: bool
        """
        return self._visible

    @visible.setter
    def visible(self, visible):
        """
        Determines the visibility in the UI.

        :param visible: The visible of this Section.
        :type: bool
        """

        self._visible = visible

    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, Section):
            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, Section):
            return True

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