# coding: utf-8

"""
    FlashArray REST API

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

    OpenAPI spec version: 2.9
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re

import six
import typing

from ....properties import Property
if typing.TYPE_CHECKING:
    from pypureclient.flasharray.FA_2_9 import models

class SoftwareCheck(object):
    """
    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',
        'start_time': 'int',
        'end_time': 'int',
        'checks': 'list[SoftwareChecksChecks]',
        'details': 'str',
        'software_name': 'str',
        'software_upgrade_hops': 'list[str]',
        'software_version': 'str',
        'status': 'str'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'start_time': 'start_time',
        'end_time': 'end_time',
        'checks': 'checks',
        'details': 'details',
        'software_name': 'software_name',
        'software_upgrade_hops': 'software_upgrade_hops',
        'software_version': 'software_version',
        'status': 'status'
    }

    required_args = {
    }

    def __init__(
        self,
        id=None,  # type: str
        name=None,  # type: str
        start_time=None,  # type: int
        end_time=None,  # type: int
        checks=None,  # type: List[models.SoftwareChecksChecks]
        details=None,  # type: str
        software_name=None,  # type: str
        software_upgrade_hops=None,  # type: List[str]
        software_version=None,  # type: str
        status=None,  # type: str
    ):
        """
        Keyword args:
            id (str): A globally unique, system-generated ID. The ID cannot be modified.
            name (str): Name of the resource. The name cannot be modified.
            start_time (int): Start time in milliseconds since the UNIX epoch.
            end_time (int): End time in milliseconds since the UNIX epoch.
            checks (list[SoftwareChecksChecks]): A list of checks in this check task.
            details (str): The detailed reason for the `status`.
            software_name (str): The name of the software the upgrade checks will test.
            software_upgrade_hops (list[str]): The list of software versions the upgrade goes through. The upgrade checks also test this particular path.
            software_version (str): The version of the software that the upgrade checks will test.
            status (str): The status of the check task. Valid values are `queued`, `running`, `passed`, and `failed`. A status of `queued` indicates that the task is queued to run and is waiting for other check tasks to complete. A status of `running` indicates that the task is currently running. A status of `passed` indicates that all upgrade checks in the task are complete. A status of `failed` indicates that at least one upgrade check in the task has failed.
        """
        if id is not None:
            self.id = id
        if name is not None:
            self.name = name
        if start_time is not None:
            self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time
        if checks is not None:
            self.checks = checks
        if details is not None:
            self.details = details
        if software_name is not None:
            self.software_name = software_name
        if software_upgrade_hops is not None:
            self.software_upgrade_hops = software_upgrade_hops
        if software_version is not None:
            self.software_version = software_version
        if status is not None:
            self.status = status

    def __setattr__(self, key, value):
        if key not in self.attribute_map:
            raise KeyError("Invalid key `{}` for `SoftwareCheck`".format(key))
        self.__dict__[key] = value

    def __getattribute__(self, item):
        value = object.__getattribute__(self, item)
        if isinstance(value, Property):
            raise AttributeError
        else:
            return value

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            if hasattr(self, attr):
                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(SoftwareCheck, 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, SoftwareCheck):
            return False

        return self.__dict__ == other.__dict__

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