# coding: utf-8

"""
    Vidispine API

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

    The version of the OpenAPI document: 5.x
    Contact: info@vidispine.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six
from . import *

class LibrarySettingsType(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 = {
        'username': 'str',
        'update_mode': 'str',
        'update_frequency': 'int',
        'last_update': 'datetime',
        'query': 'ItemSearchType',
        'id': 'str',
        'auto_refresh': 'bool'
    }

    attribute_map = {
        'username': 'username',
        'update_mode': 'updateMode',
        'update_frequency': 'updateFrequency',
        'last_update': 'lastUpdate',
        'query': 'query',
        'id': 'id',
        'auto_refresh': 'autoRefresh'
    }

    def __init__(self, username=None, update_mode=None, update_frequency=None, last_update=None, query=None, id=None, auto_refresh=None):  # noqa: E501
        """LibrarySettingsType - a model defined in OpenAPI"""  # noqa: E501

        self._username = None
        self._update_mode = None
        self._update_frequency = None
        self._last_update = None
        self._query = None
        self._id = None
        self._auto_refresh = None
        self.discriminator = None

        if username is not None:
            self.username = username
        if update_mode is not None:
            self.update_mode = update_mode
        if update_frequency is not None:
            self.update_frequency = update_frequency
        if last_update is not None:
            self.last_update = last_update
        if query is not None:
            self.query = query
        if id is not None:
            self.id = id
        if auto_refresh is not None:
            self.auto_refresh = auto_refresh

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


        :return: The username of this LibrarySettingsType.  # noqa: E501
        :rtype: str
        """
        return self._username

    @username.setter
    def username(self, username):
        """Sets the username of this LibrarySettingsType.


        :param username: The username of this LibrarySettingsType.  # noqa: E501
        :type: str
        """

        self._username = username

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


        :return: The update_mode of this LibrarySettingsType.  # noqa: E501
        :rtype: str
        """
        return self._update_mode

    @update_mode.setter
    def update_mode(self, update_mode):
        """Sets the update_mode of this LibrarySettingsType.


        :param update_mode: The update_mode of this LibrarySettingsType.  # noqa: E501
        :type: str
        """

        self._update_mode = update_mode

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


        :return: The update_frequency of this LibrarySettingsType.  # noqa: E501
        :rtype: int
        """
        return self._update_frequency

    @update_frequency.setter
    def update_frequency(self, update_frequency):
        """Sets the update_frequency of this LibrarySettingsType.


        :param update_frequency: The update_frequency of this LibrarySettingsType.  # noqa: E501
        :type: int
        """

        self._update_frequency = update_frequency

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


        :return: The last_update of this LibrarySettingsType.  # noqa: E501
        :rtype: datetime
        """
        return self._last_update

    @last_update.setter
    def last_update(self, last_update):
        """Sets the last_update of this LibrarySettingsType.


        :param last_update: The last_update of this LibrarySettingsType.  # noqa: E501
        :type: datetime
        """

        self._last_update = last_update

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


        :return: The query of this LibrarySettingsType.  # noqa: E501
        :rtype: ItemSearchType
        """
        return self._query

    @query.setter
    def query(self, query):
        """Sets the query of this LibrarySettingsType.


        :param query: The query of this LibrarySettingsType.  # noqa: E501
        :type: ItemSearchType
        """

        self._query = query

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


        :return: The id of this LibrarySettingsType.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this LibrarySettingsType.


        :param id: The id of this LibrarySettingsType.  # noqa: E501
        :type: str
        """
        if id is not None and not re.search(r'([_A-Za-z]+-)?([A-Za-z_][A-Za-z0-9_]*-|(([A-Za-z_][A-Za-z0-9_]*)?\*))([0-9]{1}[0-9]{0,31})', id):  # noqa: E501
            raise ValueError(r"Invalid value for `id`, must be a follow pattern or equal to `/([_A-Za-z]+-)?([A-Za-z_][A-Za-z0-9_]*-|(([A-Za-z_][A-Za-z0-9_]*)?\*))([0-9]{1}[0-9]{0,31})/`")  # noqa: E501

        self._id = id

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


        :return: The auto_refresh of this LibrarySettingsType.  # noqa: E501
        :rtype: bool
        """
        return self._auto_refresh

    @auto_refresh.setter
    def auto_refresh(self, auto_refresh):
        """Sets the auto_refresh of this LibrarySettingsType.


        :param auto_refresh: The auto_refresh of this LibrarySettingsType.  # noqa: E501
        :type: bool
        """

        self._auto_refresh = auto_refresh

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

        return self.__dict__ == other.__dict__

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