# 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 WorkflowInstanceSchema(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',
        'created_at': 'str',
        'started_at': 'str',
        'finished_at': 'str',
        'status': 'str',
        'message': 'str',
        'devices': 'list[str]',
        'device_groups': 'list[str]',
        'parameters': 'list[WorkflowInstanceSchemaParameters]',
        'argument': 'WorkflowArgumentGroupSchema',
        'cron_options': 'WorkflowCronOptionsSchema',
        'batch': 'int',
        'retry': 'RuleSchemaThenRetry',
        'timeout': 'str',
        'workflow_instance_name': 'str',
        'workflow_name': 'str'
    }

    attribute_map = {
        'description': 'description',
        'created_at': 'created-at',
        'started_at': 'started-at',
        'finished_at': 'finished-at',
        'status': 'status',
        'message': 'message',
        'devices': 'devices',
        'device_groups': 'device-groups',
        'parameters': 'parameters',
        'argument': 'argument',
        'cron_options': 'cron-options',
        'batch': 'batch',
        'retry': 'retry',
        'timeout': 'timeout',
        'workflow_instance_name': 'workflow-instance-name',
        'workflow_name': 'workflow-name'
    }

    def __init__(self, description=None, created_at=None, started_at=None, finished_at=None, status=None, message=None, devices=None, device_groups=None, parameters=None, argument=None, cron_options=None, batch=None, retry=None, timeout=None, workflow_instance_name=None, workflow_name=None):  # noqa: E501
        """WorkflowInstanceSchema - a model defined in Swagger"""  # noqa: E501

        self._description = None
        self._created_at = None
        self._started_at = None
        self._finished_at = None
        self._status = None
        self._message = None
        self._devices = None
        self._device_groups = None
        self._parameters = None
        self._argument = None
        self._cron_options = None
        self._batch = None
        self._retry = None
        self._timeout = None
        self._workflow_instance_name = None
        self._workflow_name = None
        self.discriminator = None

        if description is not None:
            self.description = description
        if created_at is not None:
            self.created_at = created_at
        if started_at is not None:
            self.started_at = started_at
        if finished_at is not None:
            self.finished_at = finished_at
        if status is not None:
            self.status = status
        if message is not None:
            self.message = message
        if devices is not None:
            self.devices = devices
        if device_groups is not None:
            self.device_groups = device_groups
        if parameters is not None:
            self.parameters = parameters
        if argument is not None:
            self.argument = argument
        if cron_options is not None:
            self.cron_options = cron_options
        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 workflow_instance_name is not None:
            self.workflow_instance_name = workflow_instance_name
        self.workflow_name = workflow_name

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

        Description about this workflow instance  # noqa: E501

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

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

        Description about this workflow instance  # noqa: E501

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

        self._description = description

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

        Workflow instance creation time  # noqa: E501

        :return: The created_at of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: str
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this WorkflowInstanceSchema.

        Workflow instance creation time  # noqa: E501

        :param created_at: The created_at of this WorkflowInstanceSchema.  # noqa: E501
        :type: str
        """

        self._created_at = created_at

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

        Workflow instance startup time  # noqa: E501

        :return: The started_at of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: str
        """
        return self._started_at

    @started_at.setter
    def started_at(self, started_at):
        """Sets the started_at of this WorkflowInstanceSchema.

        Workflow instance startup time  # noqa: E501

        :param started_at: The started_at of this WorkflowInstanceSchema.  # noqa: E501
        :type: str
        """

        self._started_at = started_at

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

        Workflow instance completion time  # noqa: E501

        :return: The finished_at of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: str
        """
        return self._finished_at

    @finished_at.setter
    def finished_at(self, finished_at):
        """Sets the finished_at of this WorkflowInstanceSchema.

        Workflow instance completion time  # noqa: E501

        :param finished_at: The finished_at of this WorkflowInstanceSchema.  # noqa: E501
        :type: str
        """

        self._finished_at = finished_at

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

        Workflow instance current status  # noqa: E501

        :return: The status of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this WorkflowInstanceSchema.

        Workflow instance current status  # noqa: E501

        :param status: The status of this WorkflowInstanceSchema.  # noqa: E501
        :type: str
        """

        self._status = status

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

        Workflow instance current status message  # noqa: E501

        :return: The message of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: str
        """
        return self._message

    @message.setter
    def message(self, message):
        """Sets the message of this WorkflowInstanceSchema.

        Workflow instance current status message  # noqa: E501

        :param message: The message of this WorkflowInstanceSchema.  # noqa: E501
        :type: str
        """

        self._message = message

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


        :return: The devices of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: list[str]
        """
        return self._devices

    @devices.setter
    def devices(self, devices):
        """Sets the devices of this WorkflowInstanceSchema.


        :param devices: The devices of this WorkflowInstanceSchema.  # noqa: E501
        :type: list[str]
        """

        self._devices = devices

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


        :return: The device_groups of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: list[str]
        """
        return self._device_groups

    @device_groups.setter
    def device_groups(self, device_groups):
        """Sets the device_groups of this WorkflowInstanceSchema.


        :param device_groups: The device_groups of this WorkflowInstanceSchema.  # noqa: E501
        :type: list[str]
        """

        self._device_groups = device_groups

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


        :return: The parameters of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: list[WorkflowInstanceSchemaParameters]
        """
        return self._parameters

    @parameters.setter
    def parameters(self, parameters):
        """Sets the parameters of this WorkflowInstanceSchema.


        :param parameters: The parameters of this WorkflowInstanceSchema.  # noqa: E501
        :type: list[WorkflowInstanceSchemaParameters]
        """

        self._parameters = parameters

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


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

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


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

        self._argument = argument

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


        :return: The cron_options of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: WorkflowCronOptionsSchema
        """
        return self._cron_options

    @cron_options.setter
    def cron_options(self, cron_options):
        """Sets the cron_options of this WorkflowInstanceSchema.


        :param cron_options: The cron_options of this WorkflowInstanceSchema.  # noqa: E501
        :type: WorkflowCronOptionsSchema
        """

        self._cron_options = cron_options

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

        Maximum parallel steps launched  # noqa: E501

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

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

        Maximum parallel steps launched  # noqa: E501

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

        self._batch = batch

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


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

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


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

        self._retry = retry

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

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

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

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

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

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

        self._timeout = timeout

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

        Name of the workflow instance  # noqa: E501

        :return: The workflow_instance_name of this WorkflowInstanceSchema.  # noqa: E501
        :rtype: str
        """
        return self._workflow_instance_name

    @workflow_instance_name.setter
    def workflow_instance_name(self, workflow_instance_name):
        """Sets the workflow_instance_name of this WorkflowInstanceSchema.

        Name of the workflow instance  # noqa: E501

        :param workflow_instance_name: The workflow_instance_name of this WorkflowInstanceSchema.  # noqa: E501
        :type: str
        """
        if workflow_instance_name is not None and len(workflow_instance_name) < 1:
            raise ValueError("Invalid value for `workflow_instance_name`, length must be greater than or equal to `1`")  # noqa: E501

        self._workflow_instance_name = workflow_instance_name

    @property
    def workflow_name(self):
        """Gets the workflow_name of this WorkflowInstanceSchema.  # 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 WorkflowInstanceSchema.  # noqa: E501
        :rtype: str
        """
        return self._workflow_name

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

        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 WorkflowInstanceSchema.  # 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(WorkflowInstanceSchema, 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, WorkflowInstanceSchema):
            return False

        return self.__dict__ == other.__dict__

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