# coding: utf-8

"""
    Harbor API

    These APIs provide services for manipulating Harbor project.  # noqa: E501

    OpenAPI spec version: 2.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from harbor_client.configuration import Configuration


class ScheduleObj(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 = {
        'type': 'str',
        'cron': 'str',
        'next_scheduled_time': 'datetime'
    }

    attribute_map = {
        'type': 'type',
        'cron': 'cron',
        'next_scheduled_time': 'next_scheduled_time'
    }

    def __init__(self, type=None, cron=None, next_scheduled_time=None, _configuration=None):  # noqa: E501
        """ScheduleObj - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._type = None
        self._cron = None
        self._next_scheduled_time = None
        self.discriminator = None

        if type is not None:
            self.type = type
        if cron is not None:
            self.cron = cron
        if next_scheduled_time is not None:
            self.next_scheduled_time = next_scheduled_time

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

        The schedule type. The valid values are 'Hourly', 'Daily', 'Weekly', 'Custom', 'Manual' and 'None'. 'Manual' means to trigger it right away and 'None' means to cancel the schedule.   # noqa: E501

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

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

        The schedule type. The valid values are 'Hourly', 'Daily', 'Weekly', 'Custom', 'Manual' and 'None'. 'Manual' means to trigger it right away and 'None' means to cancel the schedule.   # noqa: E501

        :param type: The type of this ScheduleObj.  # noqa: E501
        :type: str
        """
        allowed_values = ["Hourly", "Daily", "Weekly", "Custom", "Manual", "None"]  # noqa: E501
        if (self._configuration.client_side_validation and
                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

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

        A cron expression, a time-based job scheduler.  # noqa: E501

        :return: The cron of this ScheduleObj.  # noqa: E501
        :rtype: str
        """
        return self._cron

    @cron.setter
    def cron(self, cron):
        """Sets the cron of this ScheduleObj.

        A cron expression, a time-based job scheduler.  # noqa: E501

        :param cron: The cron of this ScheduleObj.  # noqa: E501
        :type: str
        """

        self._cron = cron

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

        The next time to schedule to run the job.  # noqa: E501

        :return: The next_scheduled_time of this ScheduleObj.  # noqa: E501
        :rtype: datetime
        """
        return self._next_scheduled_time

    @next_scheduled_time.setter
    def next_scheduled_time(self, next_scheduled_time):
        """Sets the next_scheduled_time of this ScheduleObj.

        The next time to schedule to run the job.  # noqa: E501

        :param next_scheduled_time: The next_scheduled_time of this ScheduleObj.  # noqa: E501
        :type: datetime
        """

        self._next_scheduled_time = next_scheduled_time

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

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