# coding: utf-8


"""
IGNORE:
    Nutanix Storage Versioned APIs

    Manages volume groups and storage containers in Nutanix cluster.  # noqa: E501

    OpenAPI spec version: 4.0.2-alpha-3
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
IGNORE
"""
import pprint
import json
import ast
import re  # noqa: F401

import six
from ntnx_storage_py_client.Ntnx.storage.v4.common.OperationType import OperationType  # noqa: F401,E501
from ntnx_storage_py_client.Ntnx.storage.v4.common.ProgressStatus import ProgressStatus  # noqa: F401,E501

"""
IGNORE:
NOTE: This class is auto generated by the swagger code generator program.

Do not edit the class manually.
IGNORE
"""


class Task(object):
    """Task - a model defined in Swagger"""
    """
    IGNORE:
    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.
    IGNORE
    """ # noqa: E501
    swagger_types = {
        'ext_id': 'str',
        'created_time': 'datetime',
        'started_time': 'datetime',
        'completed_time': 'datetime',
        'last_updated_time': 'datetime',
        'description': 'str',
        'percentage_complete': 'float',
        'display_name': 'str',
        'parent_task_ext_id': 'str',
        'subtask_ext_ids': 'list[str]',
        'operation_type': 'storage.v4.common.OperationType',
        'progress_status': 'storage.v4.common.ProgressStatus',
        '_reserved': 'dict(str, object)',
        '_object_type': 'str',
        '_unknown_fields': 'dict(str, object)',
    }

    attribute_map = {
        'ext_id': 'extId',
        'created_time': 'createdTime',
        'started_time': 'startedTime',
        'completed_time': 'completedTime',
        'last_updated_time': 'lastUpdatedTime',
        'description': 'description',
        'percentage_complete': 'percentageComplete',
        'display_name': 'displayName',
        'parent_task_ext_id': 'parentTaskExtId',
        'subtask_ext_ids': 'subtaskExtIds',
        'operation_type': 'operationType',
        'progress_status': 'progressStatus',
        '_reserved': '$reserved',
        '_object_type': '$objectType',
        '_unknown_fields': '$unknownFields',
    }



    def __init__(self, ext_id=None, created_time=None, started_time=None, completed_time=None, last_updated_time=None, description=None, percentage_complete=None, display_name=None, parent_task_ext_id=None, subtask_ext_ids=None, operation_type=None, progress_status=None, *args, **kwargs):  # noqa: E501
        """Task - a model defined in Swagger
            
        """
        self.__ext_id = None
        self.__created_time = None
        self.__started_time = None
        self.__completed_time = None
        self.__last_updated_time = None
        self.__description = None
        self.__percentage_complete = None
        self.__display_name = None
        self.__parent_task_ext_id = None
        self.__subtask_ext_ids = None
        self.__operation_type = None
        self.__progress_status = None
        self.discriminator = None
        if ext_id is not None:
            self.__ext_id = ext_id
        if created_time is not None:
            self.__created_time = created_time
        if started_time is not None:
            self.__started_time = started_time
        if completed_time is not None:
            self.__completed_time = completed_time
        if last_updated_time is not None:
            self.__last_updated_time = last_updated_time
        if description is not None:
            self.__description = description
        if percentage_complete is not None:
            self.__percentage_complete = percentage_complete
        if display_name is not None:
            self.__display_name = display_name
        if parent_task_ext_id is not None:
            self.__parent_task_ext_id = parent_task_ext_id
        if subtask_ext_ids is not None:
            self.__subtask_ext_ids = subtask_ext_ids
        if operation_type is not None:
            self.__operation_type = operation_type
        if progress_status is not None:
            self.__progress_status = progress_status
        # populate hidden vars if not empty
        self._populate_hidden_vars(kwargs)

    def _initialize_object_type(self):
        return 'storage.v4.common.Task'

    def _initialize_fq_object_type(self):
        return 'storage.v4.r0.a3.common.Task'

    def _populate_hidden_vars(self, kwargs):
        if "_reserved" in kwargs and kwargs["_reserved"] is not None:
            self.__dollar_reserved = kwargs["_reserved"]
        elif "_reserved" in self.attribute_map and self.attribute_map["_reserved"] in kwargs and kwargs[self.attribute_map["_reserved"]] is not None:
            self.__dollar_reserved = kwargs[self.attribute_map["_reserved"]]
        else :
            self.__dollar_reserved = {"$fqObjectType": self._initialize_fq_object_type()}
        if "_unknown_fields" in kwargs and kwargs["_unknown_fields"] is not None:
            self.__dollar_unknown_fields = kwargs["_unknown_fields"]
        elif "_unknown_fields" in self.attribute_map and self.attribute_map["_unknown_fields"] in kwargs and kwargs[self.attribute_map["_unknown_fields"]] is not None:
            self.__dollar_unknown_fields = kwargs[self.attribute_map["_unknown_fields"]]
        else :
            self.__dollar_unknown_fields = {}
        if "_object_type" in kwargs and kwargs["_object_type"] is not None:
            self.__dollar_object_type = kwargs["_object_type"]
        elif "_object_type" in self.attribute_map and self.attribute_map["_object_type"] in kwargs and kwargs[self.attribute_map["_object_type"]] is not None:
            self.__dollar_object_type = kwargs[self.attribute_map["_object_type"]]
        else:
            self.__dollar_object_type = self._initialize_object_type()

    def get_object_type(self):
        return self.__dollar_object_type

    def get_reserved(self):
        return self.__dollar_reserved

    def get_unknown_fields(self):
        return self.__dollar_unknown_fields

    @property
    def ext_id(self):
        """`{ str }`
            \nThe extId referencing this task This field is immutable. 
        """ # noqa: E501
        return self.__ext_id

    @ext_id.setter
    def ext_id(self, ext_id):

        self.__ext_id = ext_id

    @property
    def created_time(self):
        """`{ datetime }`
            \nThe date-time string (RFC 3339) when the task was created. 
        """ # noqa: E501
        return self.__created_time

    @created_time.setter
    def created_time(self, created_time):

        self.__created_time = created_time

    @property
    def started_time(self):
        """`{ datetime }`
            \nThe date-time string (RFC 3339) when the task was started. 
        """ # noqa: E501
        return self.__started_time

    @started_time.setter
    def started_time(self, started_time):

        self.__started_time = started_time

    @property
    def completed_time(self):
        """`{ datetime }`
            \nThe date-time string (RFC 3339) when the task was completed. 
        """ # noqa: E501
        return self.__completed_time

    @completed_time.setter
    def completed_time(self, completed_time):

        self.__completed_time = completed_time

    @property
    def last_updated_time(self):
        """`{ datetime }`
            \nThe date-time string (RFC 3339) when the task was last updated. 
        """ # noqa: E501
        return self.__last_updated_time

    @last_updated_time.setter
    def last_updated_time(self, last_updated_time):

        self.__last_updated_time = last_updated_time

    @property
    def description(self):
        """`{ str }`
            \nA string consisting of the description of the category as defined by the user.  The server does not validate this value nor does it enforce the uniqueness or any other constraints.<br> It is the responsibility of the user to ensure that any semantic or syntactic constraints are retained when mutating this field. 
        """ # noqa: E501
        return self.__description

    @description.setter
    def description(self, description):

        self.__description = description

    @property
    def percentage_complete(self):
        """`{ float }`
            \nThis will be a float value indicating the percentage completion of the task 
        """ # noqa: E501
        return self.__percentage_complete

    @percentage_complete.setter
    def percentage_complete(self, percentage_complete):

        self.__percentage_complete = percentage_complete

    @property
    def display_name(self):
        """`{ str }`
            \nThe short name of this task. It may not be unique for each task.<br> This field is immutable. 
        """ # noqa: E501
        return self.__display_name

    @display_name.setter
    def display_name(self, display_name):

        self.__display_name = display_name

    @property
    def parent_task_ext_id(self):
        """`{ str }`
            \nThe extId referencing the parent task of this task (may be null if this task is a root task).<br> Each task can have at most one parent.<br> This field is immutable. 
        """ # noqa: E501
        return self.__parent_task_ext_id

    @parent_task_ext_id.setter
    def parent_task_ext_id(self, parent_task_ext_id):

        self.__parent_task_ext_id = parent_task_ext_id

    @property
    def subtask_ext_ids(self):
        """`{ list[str] }`
            \nThe list of extIds referencing the sub-tasks of this task (may be empty if there are no sub-tasks).<br> This field is immutable.
        """ # noqa: E501
        return self.__subtask_ext_ids

    @subtask_ext_ids.setter
    def subtask_ext_ids(self, subtask_ext_ids):

        self.__subtask_ext_ids = subtask_ext_ids

    @property
    def operation_type(self):
        """`{ storage.v4.common.OperationType }`
            
        """ # noqa: E501
        return self.__operation_type

    @operation_type.setter
    def operation_type(self, operation_type):

        self.__operation_type = operation_type

    @property
    def progress_status(self):
        """`{ storage.v4.common.ProgressStatus }`
            
        """ # noqa: E501
        return self.__progress_status

    @progress_status.setter
    def progress_status(self, progress_status):

        self.__progress_status = progress_status

    @property
    def _reserved(self):
        """`{ dict(str, object) }`
            
        """ # noqa: E501
        return self.__dollar_reserved

    @property
    def _object_type(self):
        """`{ str }`
            
        """ # noqa: E501
        return self.__dollar_object_type

    @property
    def _unknown_fields(self):
        """`{ dict(str, object) }`
            
        """ # noqa: E501
        return self.__dollar_unknown_fields

    def _to_dict(self, sanitize):
        """
        Returns the model properties as a dict. Omits None properties based on the provided "sanitize" parameter.
        :param bool sanitize
        """

        result = {}

        for attr, attr_type in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x._to_dict(sanitize) if hasattr(x, "_to_dict") else x,
                    value
                ))
            elif hasattr(value, "_to_dict"):
                result[attr] = value._to_dict(sanitize)
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1]._to_dict(sanitize))
                    if hasattr(item[1], "_to_dict") else item,
                    six.iteritems(value)
                ))
            else:
                if sanitize:
                    if value is not None:
                        result[attr] = value
                else:
                    result[attr] = value
        if issubclass(Task, dict):
            for key, value in six.iteritems(self):
                result[key] = value

        return result

    def to_dict(self):
        """Returns the model properties as a dict"""
        return self._to_dict(False)

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self._to_dict(True))

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

        return self.__dict__ == other.__dict__

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

