# coding: utf-8

"""
    Octopus Server API

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

    OpenAPI spec version: 2019.6.7+Branch.tags-2019.6.7.Sha.aa18dc6809953218c66f57eff7d26481d9b23d6a
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class DashboardItemResource(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 = {
        'id': 'str',
        'project_id': 'str',
        'environment_id': 'str',
        'release_id': 'str',
        'deployment_id': 'str',
        'task_id': 'str',
        'tenant_id': 'str',
        'channel_id': 'str',
        'release_version': 'str',
        'created': 'datetime',
        'queue_time': 'datetime',
        'start_time': 'datetime',
        'completed_time': 'datetime',
        'state': 'str',
        'has_pending_interruptions': 'bool',
        'has_warnings_or_errors': 'bool',
        'error_message': 'str',
        'duration': 'str',
        'is_current': 'bool',
        'is_previous': 'bool',
        'is_completed': 'bool',
        'last_modified_on': 'datetime',
        'last_modified_by': 'str',
        'links': 'dict(str, str)'
    }

    attribute_map = {
        'id': 'Id',
        'project_id': 'ProjectId',
        'environment_id': 'EnvironmentId',
        'release_id': 'ReleaseId',
        'deployment_id': 'DeploymentId',
        'task_id': 'TaskId',
        'tenant_id': 'TenantId',
        'channel_id': 'ChannelId',
        'release_version': 'ReleaseVersion',
        'created': 'Created',
        'queue_time': 'QueueTime',
        'start_time': 'StartTime',
        'completed_time': 'CompletedTime',
        'state': 'State',
        'has_pending_interruptions': 'HasPendingInterruptions',
        'has_warnings_or_errors': 'HasWarningsOrErrors',
        'error_message': 'ErrorMessage',
        'duration': 'Duration',
        'is_current': 'IsCurrent',
        'is_previous': 'IsPrevious',
        'is_completed': 'IsCompleted',
        'last_modified_on': 'LastModifiedOn',
        'last_modified_by': 'LastModifiedBy',
        'links': 'Links'
    }

    def __init__(self, id=None, project_id=None, environment_id=None, release_id=None, deployment_id=None, task_id=None, tenant_id=None, channel_id=None, release_version=None, created=None, queue_time=None, start_time=None, completed_time=None, state=None, has_pending_interruptions=None, has_warnings_or_errors=None, error_message=None, duration=None, is_current=None, is_previous=None, is_completed=None, last_modified_on=None, last_modified_by=None, links=None):  # noqa: E501
        """DashboardItemResource - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._project_id = None
        self._environment_id = None
        self._release_id = None
        self._deployment_id = None
        self._task_id = None
        self._tenant_id = None
        self._channel_id = None
        self._release_version = None
        self._created = None
        self._queue_time = None
        self._start_time = None
        self._completed_time = None
        self._state = None
        self._has_pending_interruptions = None
        self._has_warnings_or_errors = None
        self._error_message = None
        self._duration = None
        self._is_current = None
        self._is_previous = None
        self._is_completed = None
        self._last_modified_on = None
        self._last_modified_by = None
        self._links = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if project_id is not None:
            self.project_id = project_id
        if environment_id is not None:
            self.environment_id = environment_id
        if release_id is not None:
            self.release_id = release_id
        if deployment_id is not None:
            self.deployment_id = deployment_id
        if task_id is not None:
            self.task_id = task_id
        if tenant_id is not None:
            self.tenant_id = tenant_id
        if channel_id is not None:
            self.channel_id = channel_id
        if release_version is not None:
            self.release_version = release_version
        if created is not None:
            self.created = created
        if queue_time is not None:
            self.queue_time = queue_time
        if start_time is not None:
            self.start_time = start_time
        if completed_time is not None:
            self.completed_time = completed_time
        if state is not None:
            self.state = state
        if has_pending_interruptions is not None:
            self.has_pending_interruptions = has_pending_interruptions
        if has_warnings_or_errors is not None:
            self.has_warnings_or_errors = has_warnings_or_errors
        if error_message is not None:
            self.error_message = error_message
        if duration is not None:
            self.duration = duration
        if is_current is not None:
            self.is_current = is_current
        if is_previous is not None:
            self.is_previous = is_previous
        if is_completed is not None:
            self.is_completed = is_completed
        if last_modified_on is not None:
            self.last_modified_on = last_modified_on
        if last_modified_by is not None:
            self.last_modified_by = last_modified_by
        if links is not None:
            self.links = links

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


        :return: The id of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this DashboardItemResource.


        :param id: The id of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._id = id

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


        :return: The project_id of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._project_id

    @project_id.setter
    def project_id(self, project_id):
        """Sets the project_id of this DashboardItemResource.


        :param project_id: The project_id of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._project_id = project_id

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


        :return: The environment_id of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._environment_id

    @environment_id.setter
    def environment_id(self, environment_id):
        """Sets the environment_id of this DashboardItemResource.


        :param environment_id: The environment_id of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._environment_id = environment_id

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


        :return: The release_id of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._release_id

    @release_id.setter
    def release_id(self, release_id):
        """Sets the release_id of this DashboardItemResource.


        :param release_id: The release_id of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._release_id = release_id

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


        :return: The deployment_id of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._deployment_id

    @deployment_id.setter
    def deployment_id(self, deployment_id):
        """Sets the deployment_id of this DashboardItemResource.


        :param deployment_id: The deployment_id of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._deployment_id = deployment_id

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


        :return: The task_id of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._task_id

    @task_id.setter
    def task_id(self, task_id):
        """Sets the task_id of this DashboardItemResource.


        :param task_id: The task_id of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._task_id = task_id

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


        :return: The tenant_id of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._tenant_id

    @tenant_id.setter
    def tenant_id(self, tenant_id):
        """Sets the tenant_id of this DashboardItemResource.


        :param tenant_id: The tenant_id of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._tenant_id = tenant_id

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


        :return: The channel_id of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._channel_id

    @channel_id.setter
    def channel_id(self, channel_id):
        """Sets the channel_id of this DashboardItemResource.


        :param channel_id: The channel_id of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._channel_id = channel_id

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


        :return: The release_version of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._release_version

    @release_version.setter
    def release_version(self, release_version):
        """Sets the release_version of this DashboardItemResource.


        :param release_version: The release_version of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._release_version = release_version

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


        :return: The created of this DashboardItemResource.  # noqa: E501
        :rtype: datetime
        """
        return self._created

    @created.setter
    def created(self, created):
        """Sets the created of this DashboardItemResource.


        :param created: The created of this DashboardItemResource.  # noqa: E501
        :type: datetime
        """

        self._created = created

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


        :return: The queue_time of this DashboardItemResource.  # noqa: E501
        :rtype: datetime
        """
        return self._queue_time

    @queue_time.setter
    def queue_time(self, queue_time):
        """Sets the queue_time of this DashboardItemResource.


        :param queue_time: The queue_time of this DashboardItemResource.  # noqa: E501
        :type: datetime
        """

        self._queue_time = queue_time

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


        :return: The start_time of this DashboardItemResource.  # noqa: E501
        :rtype: datetime
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this DashboardItemResource.


        :param start_time: The start_time of this DashboardItemResource.  # noqa: E501
        :type: datetime
        """

        self._start_time = start_time

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


        :return: The completed_time of this DashboardItemResource.  # noqa: E501
        :rtype: datetime
        """
        return self._completed_time

    @completed_time.setter
    def completed_time(self, completed_time):
        """Sets the completed_time of this DashboardItemResource.


        :param completed_time: The completed_time of this DashboardItemResource.  # noqa: E501
        :type: datetime
        """

        self._completed_time = completed_time

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


        :return: The state of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this DashboardItemResource.


        :param state: The state of this DashboardItemResource.  # noqa: E501
        :type: str
        """
        allowed_values = ["Queued", "Executing", "Failed", "Canceled", "TimedOut", "Success", "Cancelling"]  # noqa: E501
        if state not in allowed_values:
            raise ValueError(
                "Invalid value for `state` ({0}), must be one of {1}"  # noqa: E501
                .format(state, allowed_values)
            )

        self._state = state

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


        :return: The has_pending_interruptions of this DashboardItemResource.  # noqa: E501
        :rtype: bool
        """
        return self._has_pending_interruptions

    @has_pending_interruptions.setter
    def has_pending_interruptions(self, has_pending_interruptions):
        """Sets the has_pending_interruptions of this DashboardItemResource.


        :param has_pending_interruptions: The has_pending_interruptions of this DashboardItemResource.  # noqa: E501
        :type: bool
        """

        self._has_pending_interruptions = has_pending_interruptions

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


        :return: The has_warnings_or_errors of this DashboardItemResource.  # noqa: E501
        :rtype: bool
        """
        return self._has_warnings_or_errors

    @has_warnings_or_errors.setter
    def has_warnings_or_errors(self, has_warnings_or_errors):
        """Sets the has_warnings_or_errors of this DashboardItemResource.


        :param has_warnings_or_errors: The has_warnings_or_errors of this DashboardItemResource.  # noqa: E501
        :type: bool
        """

        self._has_warnings_or_errors = has_warnings_or_errors

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


        :return: The error_message of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._error_message

    @error_message.setter
    def error_message(self, error_message):
        """Sets the error_message of this DashboardItemResource.


        :param error_message: The error_message of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._error_message = error_message

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


        :return: The duration of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._duration

    @duration.setter
    def duration(self, duration):
        """Sets the duration of this DashboardItemResource.


        :param duration: The duration of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._duration = duration

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


        :return: The is_current of this DashboardItemResource.  # noqa: E501
        :rtype: bool
        """
        return self._is_current

    @is_current.setter
    def is_current(self, is_current):
        """Sets the is_current of this DashboardItemResource.


        :param is_current: The is_current of this DashboardItemResource.  # noqa: E501
        :type: bool
        """

        self._is_current = is_current

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


        :return: The is_previous of this DashboardItemResource.  # noqa: E501
        :rtype: bool
        """
        return self._is_previous

    @is_previous.setter
    def is_previous(self, is_previous):
        """Sets the is_previous of this DashboardItemResource.


        :param is_previous: The is_previous of this DashboardItemResource.  # noqa: E501
        :type: bool
        """

        self._is_previous = is_previous

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


        :return: The is_completed of this DashboardItemResource.  # noqa: E501
        :rtype: bool
        """
        return self._is_completed

    @is_completed.setter
    def is_completed(self, is_completed):
        """Sets the is_completed of this DashboardItemResource.


        :param is_completed: The is_completed of this DashboardItemResource.  # noqa: E501
        :type: bool
        """

        self._is_completed = is_completed

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


        :return: The last_modified_on of this DashboardItemResource.  # noqa: E501
        :rtype: datetime
        """
        return self._last_modified_on

    @last_modified_on.setter
    def last_modified_on(self, last_modified_on):
        """Sets the last_modified_on of this DashboardItemResource.


        :param last_modified_on: The last_modified_on of this DashboardItemResource.  # noqa: E501
        :type: datetime
        """

        self._last_modified_on = last_modified_on

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


        :return: The last_modified_by of this DashboardItemResource.  # noqa: E501
        :rtype: str
        """
        return self._last_modified_by

    @last_modified_by.setter
    def last_modified_by(self, last_modified_by):
        """Sets the last_modified_by of this DashboardItemResource.


        :param last_modified_by: The last_modified_by of this DashboardItemResource.  # noqa: E501
        :type: str
        """

        self._last_modified_by = last_modified_by

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


        :return: The links of this DashboardItemResource.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._links

    @links.setter
    def links(self, links):
        """Sets the links of this DashboardItemResource.


        :param links: The links of this DashboardItemResource.  # noqa: E501
        :type: dict(str, str)
        """

        self._links = links

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

        return self.__dict__ == other.__dict__

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