# 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 WorkflowSchema(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 = {
        'description': 'str',
        'entry_task': 'str',
        'exit_task': 'str',
        'argument': 'WorkflowArgumentGroupSchema',
        'batch': 'int',
        'retry': 'RuleSchemaThenRetry',
        'timeout': 'str',
        'task': 'list[WorkflowSchemaTask1]',
        'workflow_name': 'str'
    }

    attribute_map = {
        'description': 'description',
        'entry_task': 'entry-task',
        'exit_task': 'exit-task',
        'argument': 'argument',
        'batch': 'batch',
        'retry': 'retry',
        'timeout': 'timeout',
        'task': 'task',
        'workflow_name': 'workflow-name'
    }

    def __init__(self, description=None, entry_task=None, exit_task=None, argument=None, batch=None, retry=None, timeout=None, task=None, workflow_name=None):  # noqa: E501
        """WorkflowSchema - a model defined in Swagger"""  # noqa: E501

        self._description = None
        self._entry_task = None
        self._exit_task = None
        self._argument = None
        self._batch = None
        self._retry = None
        self._timeout = None
        self._task = None
        self._workflow_name = None
        self.discriminator = None

        if description is not None:
            self.description = description
        if entry_task is not None:
            self.entry_task = entry_task
        if exit_task is not None:
            self.exit_task = exit_task
        if argument is not None:
            self.argument = argument
        if batch is not None:
            self.batch = batch
        if retry is not None:
            self.retry = retry
        if timeout is not None:
            self.timeout = timeout
        if task is not None:
            self.task = task
        self.workflow_name = workflow_name

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

        Description about this workflow  # noqa: E501

        :return: The description of this WorkflowSchema.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this WorkflowSchema.

        Description about this workflow  # noqa: E501

        :param description: The description of this WorkflowSchema.  # noqa: E501
        :type: str
        """

        self._description = description

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

        Starting entry task of this workflow  # noqa: E501

        :return: The entry_task of this WorkflowSchema.  # noqa: E501
        :rtype: str
        """
        return self._entry_task

    @entry_task.setter
    def entry_task(self, entry_task):
        """Sets the entry_task of this WorkflowSchema.

        Starting entry task of this workflow  # noqa: E501

        :param entry_task: The entry_task of this WorkflowSchema.  # noqa: E501
        :type: str
        """
        if entry_task is not None and len(entry_task) > 64:
            raise ValueError("Invalid value for `entry_task`, length must be less than or equal to `64`")  # noqa: E501
        if entry_task is not None and len(entry_task) < 1:
            raise ValueError("Invalid value for `entry_task`, length must be greater than or equal to `1`")  # noqa: E501
        if entry_task is not None and not re.search(r'^[a-zA-Z][a-zA-Z0-9_-]*$', entry_task):  # noqa: E501
            raise ValueError(r"Invalid value for `entry_task`, must be a follow pattern or equal to `/^[a-zA-Z][a-zA-Z0-9_-]*$/`")  # noqa: E501

        self._entry_task = entry_task

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

        Exit/Cleanup task to invoke after the completion of the workflow  # noqa: E501

        :return: The exit_task of this WorkflowSchema.  # noqa: E501
        :rtype: str
        """
        return self._exit_task

    @exit_task.setter
    def exit_task(self, exit_task):
        """Sets the exit_task of this WorkflowSchema.

        Exit/Cleanup task to invoke after the completion of the workflow  # noqa: E501

        :param exit_task: The exit_task of this WorkflowSchema.  # noqa: E501
        :type: str
        """
        if exit_task is not None and len(exit_task) > 64:
            raise ValueError("Invalid value for `exit_task`, length must be less than or equal to `64`")  # noqa: E501
        if exit_task is not None and len(exit_task) < 1:
            raise ValueError("Invalid value for `exit_task`, length must be greater than or equal to `1`")  # noqa: E501
        if exit_task is not None and not re.search(r'^[a-zA-Z][a-zA-Z0-9_-]*$', exit_task):  # noqa: E501
            raise ValueError(r"Invalid value for `exit_task`, must be a follow pattern or equal to `/^[a-zA-Z][a-zA-Z0-9_-]*$/`")  # noqa: E501

        self._exit_task = exit_task

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


        :return: The argument of this WorkflowSchema.  # noqa: E501
        :rtype: WorkflowArgumentGroupSchema
        """
        return self._argument

    @argument.setter
    def argument(self, argument):
        """Sets the argument of this WorkflowSchema.


        :param argument: The argument of this WorkflowSchema.  # noqa: E501
        :type: WorkflowArgumentGroupSchema
        """

        self._argument = argument

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

        Maximum parallel steps launched  # noqa: E501

        :return: The batch of this WorkflowSchema.  # noqa: E501
        :rtype: int
        """
        return self._batch

    @batch.setter
    def batch(self, batch):
        """Sets the batch of this WorkflowSchema.

        Maximum parallel steps launched  # noqa: E501

        :param batch: The batch of this WorkflowSchema.  # noqa: E501
        :type: int
        """

        self._batch = batch

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


        :return: The retry of this WorkflowSchema.  # noqa: E501
        :rtype: RuleSchemaThenRetry
        """
        return self._retry

    @retry.setter
    def retry(self, retry):
        """Sets the retry of this WorkflowSchema.


        :param retry: The retry of this WorkflowSchema.  # noqa: E501
        :type: RuleSchemaThenRetry
        """

        self._retry = retry

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

        Maximum time to wait for the step completion before bailing out (default 60 seconds)  # noqa: E501

        :return: The timeout of this WorkflowSchema.  # noqa: E501
        :rtype: str
        """
        return self._timeout

    @timeout.setter
    def timeout(self, timeout):
        """Sets the timeout of this WorkflowSchema.

        Maximum time to wait for the step completion before bailing out (default 60 seconds)  # noqa: E501

        :param timeout: The timeout of this WorkflowSchema.  # noqa: E501
        :type: str
        """

        self._timeout = timeout

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

        Task configuration which holds a list of steps to execute  # noqa: E501

        :return: The task of this WorkflowSchema.  # noqa: E501
        :rtype: list[WorkflowSchemaTask1]
        """
        return self._task

    @task.setter
    def task(self, task):
        """Sets the task of this WorkflowSchema.

        Task configuration which holds a list of steps to execute  # noqa: E501

        :param task: The task of this WorkflowSchema.  # noqa: E501
        :type: list[WorkflowSchemaTask1]
        """

        self._task = task

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

        Name of the workflow. Should be of pattern [a-zA-Z][a-zA-Z0-9_-]*  # noqa: E501

        :return: The workflow_name of this WorkflowSchema.  # noqa: E501
        :rtype: str
        """
        return self._workflow_name

    @workflow_name.setter
    def workflow_name(self, workflow_name):
        """Sets the workflow_name of this WorkflowSchema.

        Name of the workflow. Should be of pattern [a-zA-Z][a-zA-Z0-9_-]*  # noqa: E501

        :param workflow_name: The workflow_name of this WorkflowSchema.  # noqa: E501
        :type: str
        """
        if workflow_name is None:
            raise ValueError("Invalid value for `workflow_name`, must not be `None`")  # noqa: E501
        if workflow_name is not None and len(workflow_name) > 64:
            raise ValueError("Invalid value for `workflow_name`, length must be less than or equal to `64`")  # noqa: E501
        if workflow_name is not None and len(workflow_name) < 1:
            raise ValueError("Invalid value for `workflow_name`, length must be greater than or equal to `1`")  # noqa: E501
        if workflow_name is not None and not re.search(r'^[a-zA-Z][a-zA-Z0-9_-]*$', workflow_name):  # noqa: E501
            raise ValueError(r"Invalid value for `workflow_name`, must be a follow pattern or equal to `/^[a-zA-Z][a-zA-Z0-9_-]*$/`")  # noqa: E501

        self._workflow_name = workflow_name

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

        return self.__dict__ == other.__dict__

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