# coding: utf-8

"""
    Maestro API

    Maestro authors and executes experiences that allow non-coders the ability to define Simple Business Process without having to write code and to deploy them seamlessly without having to have development expertise  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: devcenter@docusign.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from docusign_maestro.client.configuration import Configuration


class WorkflowInstance(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 = {
        'account_id': 'str',
        'creator_id': 'str',
        'dac_id': 'str',
        'end_date': 'datetime',
        'instance_name': 'str',
        'instance_state': 'WorkflowInstanceState',
        'progress': 'ProgressInstance',
        'start_date': 'datetime',
        'started_by': 'StartedByInstance',
        'template_id': 'str',
        'users': 'dict(str, str)'
    }

    attribute_map = {
        'account_id': 'accountId',
        'creator_id': 'creatorId',
        'dac_id': 'dacId',
        'end_date': 'endDate',
        'instance_name': 'instanceName',
        'instance_state': 'instanceState',
        'progress': 'progress',
        'start_date': 'startDate',
        'started_by': 'startedBy',
        'template_id': 'templateId',
        'users': 'users'
    }

    def __init__(self, _configuration=None, **kwargs):  # noqa: E501
        """WorkflowInstance - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._account_id = None
        self._creator_id = None
        self._dac_id = None
        self._end_date = None
        self._instance_name = None
        self._instance_state = None
        self._progress = None
        self._start_date = None
        self._started_by = None
        self._template_id = None
        self._users = None
        self.discriminator = None

        setattr(self, "_{}".format('account_id'), kwargs.get('account_id', None))
        setattr(self, "_{}".format('creator_id'), kwargs.get('creator_id', None))
        setattr(self, "_{}".format('dac_id'), kwargs.get('dac_id', None))
        setattr(self, "_{}".format('end_date'), kwargs.get('end_date', None))
        setattr(self, "_{}".format('instance_name'), kwargs.get('instance_name', None))
        setattr(self, "_{}".format('instance_state'), kwargs.get('instance_state', None))
        setattr(self, "_{}".format('progress'), kwargs.get('progress', None))
        setattr(self, "_{}".format('start_date'), kwargs.get('start_date', None))
        setattr(self, "_{}".format('started_by'), kwargs.get('started_by', None))
        setattr(self, "_{}".format('template_id'), kwargs.get('template_id', None))
        setattr(self, "_{}".format('users'), kwargs.get('users', None))

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


        :return: The account_id of this WorkflowInstance.  # noqa: E501
        :rtype: str
        """
        return self._account_id

    @account_id.setter
    def account_id(self, account_id):
        """Sets the account_id of this WorkflowInstance.


        :param account_id: The account_id of this WorkflowInstance.  # noqa: E501
        :type: str
        """

        self._account_id = account_id

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


        :return: The creator_id of this WorkflowInstance.  # noqa: E501
        :rtype: str
        """
        return self._creator_id

    @creator_id.setter
    def creator_id(self, creator_id):
        """Sets the creator_id of this WorkflowInstance.


        :param creator_id: The creator_id of this WorkflowInstance.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and creator_id is None:
            raise ValueError("Invalid value for `creator_id`, must not be `None`")  # noqa: E501

        self._creator_id = creator_id

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


        :return: The dac_id of this WorkflowInstance.  # noqa: E501
        :rtype: str
        """
        return self._dac_id

    @dac_id.setter
    def dac_id(self, dac_id):
        """Sets the dac_id of this WorkflowInstance.


        :param dac_id: The dac_id of this WorkflowInstance.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and dac_id is None:
            raise ValueError("Invalid value for `dac_id`, must not be `None`")  # noqa: E501

        self._dac_id = dac_id

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

        Track the End time of the Workflow Instance  # noqa: E501

        :return: The end_date of this WorkflowInstance.  # noqa: E501
        :rtype: datetime
        """
        return self._end_date

    @end_date.setter
    def end_date(self, end_date):
        """Sets the end_date of this WorkflowInstance.

        Track the End time of the Workflow Instance  # noqa: E501

        :param end_date: The end_date of this WorkflowInstance.  # noqa: E501
        :type: datetime
        """

        self._end_date = end_date

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

        The friendly name of the particular workflow instance  # noqa: E501

        :return: The instance_name of this WorkflowInstance.  # noqa: E501
        :rtype: str
        """
        return self._instance_name

    @instance_name.setter
    def instance_name(self, instance_name):
        """Sets the instance_name of this WorkflowInstance.

        The friendly name of the particular workflow instance  # noqa: E501

        :param instance_name: The instance_name of this WorkflowInstance.  # noqa: E501
        :type: str
        """

        self._instance_name = instance_name

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


        :return: The instance_state of this WorkflowInstance.  # noqa: E501
        :rtype: WorkflowInstanceState
        """
        return self._instance_state

    @instance_state.setter
    def instance_state(self, instance_state):
        """Sets the instance_state of this WorkflowInstance.


        :param instance_state: The instance_state of this WorkflowInstance.  # noqa: E501
        :type: WorkflowInstanceState
        """
        if self._configuration.client_side_validation and instance_state is None:
            raise ValueError("Invalid value for `instance_state`, must not be `None`")  # noqa: E501

        self._instance_state = instance_state

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


        :return: The progress of this WorkflowInstance.  # noqa: E501
        :rtype: ProgressInstance
        """
        return self._progress

    @progress.setter
    def progress(self, progress):
        """Sets the progress of this WorkflowInstance.


        :param progress: The progress of this WorkflowInstance.  # noqa: E501
        :type: ProgressInstance
        """

        self._progress = progress

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

        Track the Start time of the Workflow Instance  # noqa: E501

        :return: The start_date of this WorkflowInstance.  # noqa: E501
        :rtype: datetime
        """
        return self._start_date

    @start_date.setter
    def start_date(self, start_date):
        """Sets the start_date of this WorkflowInstance.

        Track the Start time of the Workflow Instance  # noqa: E501

        :param start_date: The start_date of this WorkflowInstance.  # noqa: E501
        :type: datetime
        """

        self._start_date = start_date

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


        :return: The started_by of this WorkflowInstance.  # noqa: E501
        :rtype: StartedByInstance
        """
        return self._started_by

    @started_by.setter
    def started_by(self, started_by):
        """Sets the started_by of this WorkflowInstance.


        :param started_by: The started_by of this WorkflowInstance.  # noqa: E501
        :type: StartedByInstance
        """

        self._started_by = started_by

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


        :return: The template_id of this WorkflowInstance.  # noqa: E501
        :rtype: str
        """
        return self._template_id

    @template_id.setter
    def template_id(self, template_id):
        """Sets the template_id of this WorkflowInstance.


        :param template_id: The template_id of this WorkflowInstance.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and template_id is None:
            raise ValueError("Invalid value for `template_id`, must not be `None`")  # noqa: E501

        self._template_id = template_id

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

        Contains the list of Users and Steps mapping  # noqa: E501

        :return: The users of this WorkflowInstance.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._users

    @users.setter
    def users(self, users):
        """Sets the users of this WorkflowInstance.

        Contains the list of Users and Steps mapping  # noqa: E501

        :param users: The users of this WorkflowInstance.  # noqa: E501
        :type: dict(str, str)
        """
        if self._configuration.client_side_validation and users is None:
            raise ValueError("Invalid value for `users`, must not be `None`")  # noqa: E501

        self._users = users

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

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