# coding: utf-8

"""
FruDiagReturnData.py

 The Clear BSD License

 Copyright (c) – 2016, NetApp, Inc. All rights reserved.

 Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

 * Neither the name of NetApp, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

 NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

from pprint import pformat
from six import iteritems


class FruDiagReturnData(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self):
        """
        FruDiagReturnData - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'serial_number': 'str',  # (required parameter)
            'slot': 'int',  # (required parameter)
            'start_time': 'int',  # (required parameter)
            'end_time': 'int',  # (required parameter)
            'test_type': 'str',  # (required parameter)
            'test_identifier': 'str',  # (required parameter)
            'status': 'str',  # (required parameter)
            'error_code': 'int',  # (required parameter)
            'percent_complete': 'int'
        }

        self.attribute_map = {
            'serial_number': 'serialNumber',  # (required parameter)
            'slot': 'slot',  # (required parameter)
            'start_time': 'startTime',  # (required parameter)
            'end_time': 'endTime',  # (required parameter)
            'test_type': 'testType',  # (required parameter)
            'test_identifier': 'testIdentifier',  # (required parameter)
            'status': 'status',  # (required parameter)
            'error_code': 'errorCode',  # (required parameter)
            'percent_complete': 'percentComplete'
        }

        self._serial_number = None
        self._slot = None
        self._start_time = None
        self._end_time = None
        self._test_type = None
        self._test_identifier = None
        self._status = None
        self._error_code = None
        self._percent_complete = None

    @property
    def serial_number(self):
        """
        Gets the serial_number of this FruDiagReturnData.
        Variable-length ASCII text string that identifies the device serial number.

        :return: The serial_number of this FruDiagReturnData.
        :rtype: str
        :required/optional: required
        """
        return self._serial_number

    @serial_number.setter
    def serial_number(self, serial_number):
        """
        Sets the serial_number of this FruDiagReturnData.
        Variable-length ASCII text string that identifies the device serial number.

        :param serial_number: The serial_number of this FruDiagReturnData.
        :type: str
        """
        self._serial_number = serial_number

    @property
    def slot(self):
        """
        Gets the slot of this FruDiagReturnData.
        Device slot number (1-based).

        :return: The slot of this FruDiagReturnData.
        :rtype: int
        :required/optional: required
        """
        return self._slot

    @slot.setter
    def slot(self, slot):
        """
        Sets the slot of this FruDiagReturnData.
        Device slot number (1-based).

        :param slot: The slot of this FruDiagReturnData.
        :type: int
        """
        self._slot = slot

    @property
    def start_time(self):
        """
        Gets the start_time of this FruDiagReturnData.
        The time the diagnostic was started, represented in seconds since midnight GMT on January 1, 1970.

        :return: The start_time of this FruDiagReturnData.
        :rtype: int
        :required/optional: required
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """
        Sets the start_time of this FruDiagReturnData.
        The time the diagnostic was started, represented in seconds since midnight GMT on January 1, 1970.

        :param start_time: The start_time of this FruDiagReturnData.
        :type: int
        """
        self._start_time = start_time

    @property
    def end_time(self):
        """
        Gets the end_time of this FruDiagReturnData.
        If the diagnostic is not running this is the time the diagnostic was completed or interrupted. If the diagnostic is running this is the time the status was requested. The time is represented in seconds since midnight GMT on January 1, 1970.

        :return: The end_time of this FruDiagReturnData.
        :rtype: int
        :required/optional: required
        """
        return self._end_time

    @end_time.setter
    def end_time(self, end_time):
        """
        Sets the end_time of this FruDiagReturnData.
        If the diagnostic is not running this is the time the diagnostic was completed or interrupted. If the diagnostic is running this is the time the status was requested. The time is represented in seconds since midnight GMT on January 1, 1970.

        :param end_time: The end_time of this FruDiagReturnData.
        :type: int
        """
        self._end_time = end_time

    @property
    def test_type(self):
        """
        Gets the test_type of this FruDiagReturnData.
        The diagnostic test type.

        :return: The test_type of this FruDiagReturnData.
        :rtype: str
        :required/optional: required
        """
        return self._test_type

    @test_type.setter
    def test_type(self, test_type):
        """
        Sets the test_type of this FruDiagReturnData.
        The diagnostic test type.

        :param test_type: The test_type of this FruDiagReturnData.
        :type: str
        """
        allowed_values = ["none", "serviceModeBasic", "serviceModeExtended", "__UNDEFINED"]
        if test_type not in allowed_values:
            raise ValueError(
                "Invalid value for `test_type`, must be one of {0}"
                .format(allowed_values)
            )
        self._test_type = test_type

    @property
    def test_identifier(self):
        """
        Gets the test_identifier of this FruDiagReturnData.
        The diagnostic test identifier.

        :return: The test_identifier of this FruDiagReturnData.
        :rtype: str
        :required/optional: required
        """
        return self._test_identifier

    @test_identifier.setter
    def test_identifier(self, test_identifier):
        """
        Sets the test_identifier of this FruDiagReturnData.
        The diagnostic test identifier.

        :param test_identifier: The test_identifier of this FruDiagReturnData.
        :type: str
        """
        allowed_values = ["none", "dimmByteEnable", "dimmEcc", "dimmMarchC", "dimmPatterns", "dimmPseudorandom", "dimmDmaCopy", "usbflashWriteProtect", "usbflashWriteCycle", "usbflashWritePatterns", "usbflashRandom", "hicReadWrite", "hicDataLines", "hicInterrupt", "hicLoopback", "hicT10pi", "hicDma", "hicContextMemory", "hicExtMemory", "ctlrRegisterAddress", "ctlrDataLines", "ctlrApcSram", "ctlrApcFifo", "ctlrDataCopy", "ctlrRaid5", "ctlrRaid6", "hicRamReadWrite", "__UNDEFINED"]
        if test_identifier not in allowed_values:
            raise ValueError(
                "Invalid value for `test_identifier`, must be one of {0}"
                .format(allowed_values)
            )
        self._test_identifier = test_identifier

    @property
    def status(self):
        """
        Gets the status of this FruDiagReturnData.
        The diagnostic test status.

        :return: The status of this FruDiagReturnData.
        :rtype: str
        :required/optional: required
        """
        return self._status

    @status.setter
    def status(self, status):
        """
        Sets the status of this FruDiagReturnData.
        The diagnostic test status.

        :param status: The status of this FruDiagReturnData.
        :type: str
        """
        allowed_values = ["none", "inProgress", "successful", "failed", "stopByInitiator", "stopByReset", "notSupported", "skipped", "__UNDEFINED"]
        if status not in allowed_values:
            raise ValueError(
                "Invalid value for `status`, must be one of {0}"
                .format(allowed_values)
            )
        self._status = status

    @property
    def error_code(self):
        """
        Gets the error_code of this FruDiagReturnData.
        The diagnostic test error code.

        :return: The error_code of this FruDiagReturnData.
        :rtype: int
        :required/optional: required
        """
        return self._error_code

    @error_code.setter
    def error_code(self, error_code):
        """
        Sets the error_code of this FruDiagReturnData.
        The diagnostic test error code.

        :param error_code: The error_code of this FruDiagReturnData.
        :type: int
        """
        self._error_code = error_code

    @property
    def percent_complete(self):
        """
        Gets the percent_complete of this FruDiagReturnData.
        This value is a number in the range 0 to 100 indicating the percent complete.

        :return: The percent_complete of this FruDiagReturnData.
        :rtype: int
        :required/optional: required
        """
        return self._percent_complete

    @percent_complete.setter
    def percent_complete(self, percent_complete):
        """
        Sets the percent_complete of this FruDiagReturnData.
        This value is a number in the range 0 to 100 indicating the percent complete.

        :param percent_complete: The percent_complete of this FruDiagReturnData.
        :type: int
        """
        self._percent_complete = percent_complete

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

        for attr, _ in 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

        return result

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

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        if self is None:
           return None
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if self is None or other is None:
            return None
        return self.__dict__ == other.__dict__

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

