# coding: utf-8

"""
    Paragon Insights APIs

    API interface for PI application  # noqa: E501

    OpenAPI spec version: 4.0.0
    Contact: healthbot-feedback@juniper.net
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class SchedulerSchema(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'end_time': 'str',
        'name': 'str',
        'repeat': 'SchedulerSchemaRepeat',
        'start_time': 'str',
        'run_for': 'SchedulerSchemaRunfor',
        'type': 'str'
    }

    attribute_map = {
        'end_time': 'end-time',
        'name': 'name',
        'repeat': 'repeat',
        'start_time': 'start-time',
        'run_for': 'run-for',
        'type': 'type'
    }

    def __init__(self, end_time=None, name=None, repeat=None, start_time=None, run_for=None, type='continuous'):  # noqa: E501
        """SchedulerSchema - a model defined in Swagger"""  # noqa: E501

        self._end_time = None
        self._name = None
        self._repeat = None
        self._start_time = None
        self._run_for = None
        self._type = None
        self.discriminator = None

        if end_time is not None:
            self.end_time = end_time
        self.name = name
        self.repeat = repeat
        self.start_time = start_time
        if run_for is not None:
            self.run_for = run_for
        if type is not None:
            self.type = type

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

        End scheduler at this time  # noqa: E501

        :return: The end_time of this SchedulerSchema.  # noqa: E501
        :rtype: str
        """
        return self._end_time

    @end_time.setter
    def end_time(self, end_time):
        """Sets the end_time of this SchedulerSchema.

        End scheduler at this time  # noqa: E501

        :param end_time: The end_time of this SchedulerSchema.  # noqa: E501
        :type: str
        """
        if end_time is not None and not re.search(r'^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z$', end_time):  # noqa: E501
            raise ValueError(r"Invalid value for `end_time`, must be a follow pattern or equal to `/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z$/`")  # noqa: E501

        self._end_time = end_time

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

        Name of the scheduler  # noqa: E501

        :return: The name of this SchedulerSchema.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this SchedulerSchema.

        Name of the scheduler  # noqa: E501

        :param name: The name of this SchedulerSchema.  # noqa: E501
        :type: str
        """
        if name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
        if name is not None and not re.search(r'^[a-zA-Z][a-zA-Z0-9_-]*$', name):  # noqa: E501
            raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^[a-zA-Z][a-zA-Z0-9_-]*$/`")  # noqa: E501

        self._name = name

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


        :return: The repeat of this SchedulerSchema.  # noqa: E501
        :rtype: SchedulerSchemaRepeat
        """
        return self._repeat

    @repeat.setter
    def repeat(self, repeat):
        """Sets the repeat of this SchedulerSchema.


        :param repeat: The repeat of this SchedulerSchema.  # noqa: E501
        :type: SchedulerSchemaRepeat
        """
        if repeat is None:
            raise ValueError("Invalid value for `repeat`, must not be `None`")  # noqa: E501

        self._repeat = repeat

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

        Start scheduler at this time  # noqa: E501

        :return: The start_time of this SchedulerSchema.  # noqa: E501
        :rtype: str
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this SchedulerSchema.

        Start scheduler at this time  # noqa: E501

        :param start_time: The start_time of this SchedulerSchema.  # noqa: E501
        :type: str
        """
        if start_time is None:
            raise ValueError("Invalid value for `start_time`, must not be `None`")  # noqa: E501
        if start_time is not None and not re.search(r'^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z$', start_time):  # noqa: E501
            raise ValueError(r"Invalid value for `start_time`, must be a follow pattern or equal to `/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z$/`")  # noqa: E501

        self._start_time = start_time

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


        :return: The run_for of this SchedulerSchema.  # noqa: E501
        :rtype: SchedulerSchemaRunfor
        """
        return self._run_for

    @run_for.setter
    def run_for(self, run_for):
        """Sets the run_for of this SchedulerSchema.


        :param run_for: The run_for of this SchedulerSchema.  # noqa: E501
        :type: SchedulerSchemaRunfor
        """

        self._run_for = run_for

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

        Type of the scheduler.  # noqa: E501

        :return: The type of this SchedulerSchema.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this SchedulerSchema.

        Type of the scheduler.  # noqa: E501

        :param type: The type of this SchedulerSchema.  # noqa: E501
        :type: str
        """
        allowed_values = ["continuous", "discrete"]  # noqa: E501
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"  # noqa: E501
                .format(type, allowed_values)
            )

        self._type = type

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

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(SchedulerSchema, dict):
            for key, value in self.items():
                result[key] = 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, SchedulerSchema):
            return False

        return self.__dict__ == other.__dict__

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