# 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

from octopus_deploy_swagger_client.models.activity_log_entry import ActivityLogEntry  # noqa: F401,E501

class ActivityLogTreeNode(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',
        'name': 'str',
        'started': 'datetime',
        'ended': 'datetime',
        'status': 'str',
        'show_at_summary_level': 'bool',
        'progress_percentage': 'int',
        'progress_message': 'str',
        'children': 'list[ActivityLogTreeNode]',
        'log_elements': 'list[ActivityLogEntry]'
    }

    attribute_map = {
        'id': 'Id',
        'name': 'Name',
        'started': 'Started',
        'ended': 'Ended',
        'status': 'Status',
        'show_at_summary_level': 'ShowAtSummaryLevel',
        'progress_percentage': 'ProgressPercentage',
        'progress_message': 'ProgressMessage',
        'children': 'Children',
        'log_elements': 'LogElements'
    }

    def __init__(self, id=None, name=None, started=None, ended=None, status=None, show_at_summary_level=None, progress_percentage=None, progress_message=None, children=None, log_elements=None):  # noqa: E501
        """ActivityLogTreeNode - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._name = None
        self._started = None
        self._ended = None
        self._status = None
        self._show_at_summary_level = None
        self._progress_percentage = None
        self._progress_message = None
        self._children = None
        self._log_elements = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if name is not None:
            self.name = name
        if started is not None:
            self.started = started
        if ended is not None:
            self.ended = ended
        if status is not None:
            self.status = status
        if show_at_summary_level is not None:
            self.show_at_summary_level = show_at_summary_level
        if progress_percentage is not None:
            self.progress_percentage = progress_percentage
        if progress_message is not None:
            self.progress_message = progress_message
        if children is not None:
            self.children = children
        if log_elements is not None:
            self.log_elements = log_elements

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


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

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


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

        self._id = id

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


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

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


        :param name: The name of this ActivityLogTreeNode.  # noqa: E501
        :type: str
        """

        self._name = name

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


        :return: The started of this ActivityLogTreeNode.  # noqa: E501
        :rtype: datetime
        """
        return self._started

    @started.setter
    def started(self, started):
        """Sets the started of this ActivityLogTreeNode.


        :param started: The started of this ActivityLogTreeNode.  # noqa: E501
        :type: datetime
        """

        self._started = started

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


        :return: The ended of this ActivityLogTreeNode.  # noqa: E501
        :rtype: datetime
        """
        return self._ended

    @ended.setter
    def ended(self, ended):
        """Sets the ended of this ActivityLogTreeNode.


        :param ended: The ended of this ActivityLogTreeNode.  # noqa: E501
        :type: datetime
        """

        self._ended = ended

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


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

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


        :param status: The status of this ActivityLogTreeNode.  # noqa: E501
        :type: str
        """
        allowed_values = ["Pending", "Running", "Success", "Failed", "Skipped", "SuccessWithWarning", "Canceled"]  # noqa: E501
        if status not in allowed_values:
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )

        self._status = status

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


        :return: The show_at_summary_level of this ActivityLogTreeNode.  # noqa: E501
        :rtype: bool
        """
        return self._show_at_summary_level

    @show_at_summary_level.setter
    def show_at_summary_level(self, show_at_summary_level):
        """Sets the show_at_summary_level of this ActivityLogTreeNode.


        :param show_at_summary_level: The show_at_summary_level of this ActivityLogTreeNode.  # noqa: E501
        :type: bool
        """

        self._show_at_summary_level = show_at_summary_level

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


        :return: The progress_percentage of this ActivityLogTreeNode.  # noqa: E501
        :rtype: int
        """
        return self._progress_percentage

    @progress_percentage.setter
    def progress_percentage(self, progress_percentage):
        """Sets the progress_percentage of this ActivityLogTreeNode.


        :param progress_percentage: The progress_percentage of this ActivityLogTreeNode.  # noqa: E501
        :type: int
        """

        self._progress_percentage = progress_percentage

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


        :return: The progress_message of this ActivityLogTreeNode.  # noqa: E501
        :rtype: str
        """
        return self._progress_message

    @progress_message.setter
    def progress_message(self, progress_message):
        """Sets the progress_message of this ActivityLogTreeNode.


        :param progress_message: The progress_message of this ActivityLogTreeNode.  # noqa: E501
        :type: str
        """

        self._progress_message = progress_message

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


        :return: The children of this ActivityLogTreeNode.  # noqa: E501
        :rtype: list[ActivityLogTreeNode]
        """
        return self._children

    @children.setter
    def children(self, children):
        """Sets the children of this ActivityLogTreeNode.


        :param children: The children of this ActivityLogTreeNode.  # noqa: E501
        :type: list[ActivityLogTreeNode]
        """

        self._children = children

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


        :return: The log_elements of this ActivityLogTreeNode.  # noqa: E501
        :rtype: list[ActivityLogEntry]
        """
        return self._log_elements

    @log_elements.setter
    def log_elements(self, log_elements):
        """Sets the log_elements of this ActivityLogTreeNode.


        :param log_elements: The log_elements of this ActivityLogTreeNode.  # noqa: E501
        :type: list[ActivityLogEntry]
        """

        self._log_elements = log_elements

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

        return self.__dict__ == other.__dict__

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