# coding: utf-8

"""
FirmwareUpdateDescriptor.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 FirmwareUpdateDescriptor(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self):
        """
        FirmwareUpdateDescriptor - 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 = {
            'firmware_chunk_image': 'str',  # (required parameter)
            'firmware_version': 'str',  # (required parameter)
            'offset': 'int',  # (required parameter)
            'total_size': 'int',  # (required parameter)
            'staged_download': 'bool',  # (required parameter)
            'number_of_files': 'int',  # (required parameter)
            'size_of_stream': 'int'
        }

        self.attribute_map = {
            'firmware_chunk_image': 'firmwareChunkImage',  # (required parameter)
            'firmware_version': 'firmwareVersion',  # (required parameter)
            'offset': 'offset',  # (required parameter)
            'total_size': 'totalSize',  # (required parameter)
            'staged_download': 'stagedDownload',  # (required parameter)
            'number_of_files': 'numberOfFiles',  # (required parameter)
            'size_of_stream': 'sizeOfStream'
        }

        self._firmware_chunk_image = None
        self._firmware_version = None
        self._offset = None
        self._total_size = None
        self._staged_download = None
        self._number_of_files = None
        self._size_of_stream = None

    @property
    def firmware_chunk_image(self):
        """
        Gets the firmware_chunk_image of this FirmwareUpdateDescriptor.
        A raw byte array that contains a segment, or chunk, of the firmware (or NVSRAM) image being downloaded to a controller. For firmware downloads, iterative operations are supported, where the overall firmware image can be iteratively transferred to the controller in multiple chunks. For NVSRAM downloads, however, the entire NVSRAM image must be provided in one call.

        :return: The firmware_chunk_image of this FirmwareUpdateDescriptor.
        :rtype: str
        :required/optional: required
        """
        return self._firmware_chunk_image

    @firmware_chunk_image.setter
    def firmware_chunk_image(self, firmware_chunk_image):
        """
        Sets the firmware_chunk_image of this FirmwareUpdateDescriptor.
        A raw byte array that contains a segment, or chunk, of the firmware (or NVSRAM) image being downloaded to a controller. For firmware downloads, iterative operations are supported, where the overall firmware image can be iteratively transferred to the controller in multiple chunks. For NVSRAM downloads, however, the entire NVSRAM image must be provided in one call.

        :param firmware_chunk_image: The firmware_chunk_image of this FirmwareUpdateDescriptor.
        :type: str
        """
        self._firmware_chunk_image = firmware_chunk_image

    @property
    def firmware_version(self):
        """
        Gets the firmware_version of this FirmwareUpdateDescriptor.
        An ASCII character string that identifies the version of the firmware or NVSRAM being downloaded.

        :return: The firmware_version of this FirmwareUpdateDescriptor.
        :rtype: str
        :required/optional: required
        """
        return self._firmware_version

    @firmware_version.setter
    def firmware_version(self, firmware_version):
        """
        Sets the firmware_version of this FirmwareUpdateDescriptor.
        An ASCII character string that identifies the version of the firmware or NVSRAM being downloaded.

        :param firmware_version: The firmware_version of this FirmwareUpdateDescriptor.
        :type: str
        """
        self._firmware_version = firmware_version

    @property
    def offset(self):
        """
        Gets the offset of this FirmwareUpdateDescriptor.
        The offset of this chunk from the beginning of the overall image.

        :return: The offset of this FirmwareUpdateDescriptor.
        :rtype: int
        :required/optional: required
        """
        return self._offset

    @offset.setter
    def offset(self, offset):
        """
        Sets the offset of this FirmwareUpdateDescriptor.
        The offset of this chunk from the beginning of the overall image.

        :param offset: The offset of this FirmwareUpdateDescriptor.
        :type: int
        """
        self._offset = offset

    @property
    def total_size(self):
        """
        Gets the total_size of this FirmwareUpdateDescriptor.
        The total size of the overall firmware image.

        :return: The total_size of this FirmwareUpdateDescriptor.
        :rtype: int
        :required/optional: required
        """
        return self._total_size

    @total_size.setter
    def total_size(self, total_size):
        """
        Sets the total_size of this FirmwareUpdateDescriptor.
        The total size of the overall firmware image.

        :param total_size: The total_size of this FirmwareUpdateDescriptor.
        :type: int
        """
        self._total_size = total_size

    @property
    def staged_download(self):
        """
        Gets the staged_download of this FirmwareUpdateDescriptor.
        If false, activate firmware after download. If true, stage firmware for later activation.

        :return: The staged_download of this FirmwareUpdateDescriptor.
        :rtype: bool
        :required/optional: required
        """
        return self._staged_download

    @staged_download.setter
    def staged_download(self, staged_download):
        """
        Sets the staged_download of this FirmwareUpdateDescriptor.
        If false, activate firmware after download. If true, stage firmware for later activation.

        :param staged_download: The staged_download of this FirmwareUpdateDescriptor.
        :type: bool
        """
        self._staged_download = staged_download

    @property
    def number_of_files(self):
        """
        Gets the number_of_files of this FirmwareUpdateDescriptor.
        The number of files in this download stream.

        :return: The number_of_files of this FirmwareUpdateDescriptor.
        :rtype: int
        :required/optional: required
        """
        return self._number_of_files

    @number_of_files.setter
    def number_of_files(self, number_of_files):
        """
        Sets the number_of_files of this FirmwareUpdateDescriptor.
        The number of files in this download stream.

        :param number_of_files: The number_of_files of this FirmwareUpdateDescriptor.
        :type: int
        """
        self._number_of_files = number_of_files

    @property
    def size_of_stream(self):
        """
        Gets the size_of_stream of this FirmwareUpdateDescriptor.
        Total size (in bytes) of all files being downloaded in this download stream.

        :return: The size_of_stream of this FirmwareUpdateDescriptor.
        :rtype: int
        :required/optional: required
        """
        return self._size_of_stream

    @size_of_stream.setter
    def size_of_stream(self, size_of_stream):
        """
        Sets the size_of_stream of this FirmwareUpdateDescriptor.
        Total size (in bytes) of all files being downloaded in this download stream.

        :param size_of_stream: The size_of_stream of this FirmwareUpdateDescriptor.
        :type: int
        """
        self._size_of_stream = size_of_stream

    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

