# coding: utf-8

"""
Alteryx Server API V3

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

OpenAPI spec version: 3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

from src.server_client.configuration import Configuration


class PatchScheduleContract(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 = {
        "owner_id": "str",
        "iteration": "IterationContract",
        "name": "str",
        "comment": "str",
        "priority": "str",
        "worker_tag": "str",
        "enabled": "bool",
        "credential_id": "str",
        "time_zone": "str",
        "questions": "list[AppValue]",
    }

    attribute_map = {
        "owner_id": "ownerId",
        "iteration": "iteration",
        "name": "name",
        "comment": "comment",
        "priority": "priority",
        "worker_tag": "workerTag",
        "enabled": "enabled",
        "credential_id": "credentialId",
        "time_zone": "timeZone",
        "questions": "questions",
    }

    def __init__(
        self,
        owner_id=None,
        iteration=None,
        name=None,
        comment=None,
        priority=None,
        worker_tag=None,
        enabled=None,
        credential_id=None,
        time_zone=None,
        questions=None,
        _configuration=None,
    ):  # noqa: E501
        """PatchScheduleContract - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._owner_id = None
        self._iteration = None
        self._name = None
        self._comment = None
        self._priority = None
        self._worker_tag = None
        self._enabled = None
        self._credential_id = None
        self._time_zone = None
        self._questions = None
        self.discriminator = None

        if owner_id is not None:
            self.owner_id = owner_id
        if iteration is not None:
            self.iteration = iteration
        if name is not None:
            self.name = name
        if comment is not None:
            self.comment = comment
        if priority is not None:
            self.priority = priority
        if worker_tag is not None:
            self.worker_tag = worker_tag
        if enabled is not None:
            self.enabled = enabled
        if credential_id is not None:
            self.credential_id = credential_id
        if time_zone is not None:
            self.time_zone = time_zone
        if questions is not None:
            self.questions = questions

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


        :return: The owner_id of this PatchScheduleContract.  # noqa: E501
        :rtype: str
        """
        return self._owner_id

    @owner_id.setter
    def owner_id(self, owner_id):
        """Sets the owner_id of this PatchScheduleContract.


        :param owner_id: The owner_id of this PatchScheduleContract.  # noqa: E501
        :type: str
        """

        self._owner_id = owner_id

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

        Contains properties for each IterationType value  # noqa: E501

        :return: The iteration of this PatchScheduleContract.  # noqa: E501
        :rtype: IterationContract
        """
        return self._iteration

    @iteration.setter
    def iteration(self, iteration):
        """Sets the iteration of this PatchScheduleContract.

        Contains properties for each IterationType value  # noqa: E501

        :param iteration: The iteration of this PatchScheduleContract.  # noqa: E501
        :type: IterationContract
        """

        self._iteration = iteration

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


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

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


        :param name: The name of this PatchScheduleContract.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and name is not None and len(name) > 256:
            raise ValueError("Invalid value for `name`, length must be less than or equal to `256`")  # noqa: E501
        if self._configuration.client_side_validation and name is not None and len(name) < 0:
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `0`")  # noqa: E501

        self._name = name

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


        :return: The comment of this PatchScheduleContract.  # noqa: E501
        :rtype: str
        """
        return self._comment

    @comment.setter
    def comment(self, comment):
        """Sets the comment of this PatchScheduleContract.


        :param comment: The comment of this PatchScheduleContract.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and comment is not None and len(comment) > 1024:
            raise ValueError("Invalid value for `comment`, length must be less than or equal to `1024`")  # noqa: E501
        if self._configuration.client_side_validation and comment is not None and len(comment) < 0:
            raise ValueError("Invalid value for `comment`, length must be greater than or equal to `0`")  # noqa: E501

        self._comment = comment

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


        :return: The priority of this PatchScheduleContract.  # noqa: E501
        :rtype: str
        """
        return self._priority

    @priority.setter
    def priority(self, priority):
        """Sets the priority of this PatchScheduleContract.


        :param priority: The priority of this PatchScheduleContract.  # noqa: E501
        :type: str
        """
        allowed_values = ["Default", "Low", "Medium", "High", "Critical"]  # noqa: E501
        if self._configuration.client_side_validation and priority not in allowed_values:
            raise ValueError(
                "Invalid value for `priority` ({0}), must be one of {1}".format(priority, allowed_values)  # noqa: E501
            )

        self._priority = priority

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


        :return: The worker_tag of this PatchScheduleContract.  # noqa: E501
        :rtype: str
        """
        return self._worker_tag

    @worker_tag.setter
    def worker_tag(self, worker_tag):
        """Sets the worker_tag of this PatchScheduleContract.


        :param worker_tag: The worker_tag of this PatchScheduleContract.  # noqa: E501
        :type: str
        """

        self._worker_tag = worker_tag

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


        :return: The enabled of this PatchScheduleContract.  # noqa: E501
        :rtype: bool
        """
        return self._enabled

    @enabled.setter
    def enabled(self, enabled):
        """Sets the enabled of this PatchScheduleContract.


        :param enabled: The enabled of this PatchScheduleContract.  # noqa: E501
        :type: bool
        """

        self._enabled = enabled

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


        :return: The credential_id of this PatchScheduleContract.  # noqa: E501
        :rtype: str
        """
        return self._credential_id

    @credential_id.setter
    def credential_id(self, credential_id):
        """Sets the credential_id of this PatchScheduleContract.


        :param credential_id: The credential_id of this PatchScheduleContract.  # noqa: E501
        :type: str
        """

        self._credential_id = credential_id

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

        Optional TimeZone to be used for schedule execution.  # noqa: E501

        :return: The time_zone of this PatchScheduleContract.  # noqa: E501
        :rtype: str
        """
        return self._time_zone

    @time_zone.setter
    def time_zone(self, time_zone):
        """Sets the time_zone of this PatchScheduleContract.

        Optional TimeZone to be used for schedule execution.  # noqa: E501

        :param time_zone: The time_zone of this PatchScheduleContract.  # noqa: E501
        :type: str
        """

        self._time_zone = time_zone

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


        :return: The questions of this PatchScheduleContract.  # noqa: E501
        :rtype: list[AppValue]
        """
        return self._questions

    @questions.setter
    def questions(self, questions):
        """Sets the questions of this PatchScheduleContract.


        :param questions: The questions of this PatchScheduleContract.  # noqa: E501
        :type: list[AppValue]
        """

        self._questions = questions

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

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