Source code for netapp.santricity.models.symbol.cache_backup_device

# coding: utf-8

"""
CacheBackupDevice.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


[docs]class CacheBackupDevice(object): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self): """ CacheBackupDevice - 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 = { 'backup_device_ref': 'str', # (required parameter) 'backup_device_controller_slot': 'int', # (required parameter) 'parent_controller': 'str', # (required parameter) 'backup_device_type': 'str', # (required parameter) 'backup_device_status': 'str', # (required parameter) 'backup_device_vpd': 'CacheBackupDeviceVpd', # (required parameter) 'backup_device_capacity': 'int', # (required parameter) 'repair_policy': 'RepairPolicy', # (required parameter) 'physical_location': 'Location', # (required parameter) 'id': 'str' } self.attribute_map = { 'backup_device_ref': 'backupDeviceRef', # (required parameter) 'backup_device_controller_slot': 'backupDeviceControllerSlot', # (required parameter) 'parent_controller': 'parentController', # (required parameter) 'backup_device_type': 'backupDeviceType', # (required parameter) 'backup_device_status': 'backupDeviceStatus', # (required parameter) 'backup_device_vpd': 'backupDeviceVpd', # (required parameter) 'backup_device_capacity': 'backupDeviceCapacity', # (required parameter) 'repair_policy': 'repairPolicy', # (required parameter) 'physical_location': 'physicalLocation', # (required parameter) 'id': 'id' } self._backup_device_ref = None self._backup_device_controller_slot = None self._parent_controller = None self._backup_device_type = None self._backup_device_status = None self._backup_device_vpd = None self._backup_device_capacity = None self._repair_policy = None self._physical_location = None self._id = None @property def backup_device_ref(self): """ Gets the backup_device_ref of this CacheBackupDevice. The SYMbol reference that identifies the instance of the device :return: The backup_device_ref of this CacheBackupDevice. :rtype: str :required/optional: required """ return self._backup_device_ref @backup_device_ref.setter def backup_device_ref(self, backup_device_ref): """ Sets the backup_device_ref of this CacheBackupDevice. The SYMbol reference that identifies the instance of the device :param backup_device_ref: The backup_device_ref of this CacheBackupDevice. :type: str """ self._backup_device_ref = backup_device_ref @property def backup_device_controller_slot(self): """ Gets the backup_device_controller_slot of this CacheBackupDevice. The number of the slot on the controller where the backup device resides. Cache backup device slots are numbered starting at one, independent of other types of slots (e.g., host board slots) on the controller. Note that this field is targeted for deletion in SYMbol rev. 85b. :return: The backup_device_controller_slot of this CacheBackupDevice. :rtype: int :required/optional: required """ return self._backup_device_controller_slot @backup_device_controller_slot.setter def backup_device_controller_slot(self, backup_device_controller_slot): """ Sets the backup_device_controller_slot of this CacheBackupDevice. The number of the slot on the controller where the backup device resides. Cache backup device slots are numbered starting at one, independent of other types of slots (e.g., host board slots) on the controller. Note that this field is targeted for deletion in SYMbol rev. 85b. :param backup_device_controller_slot: The backup_device_controller_slot of this CacheBackupDevice. :type: int """ self._backup_device_controller_slot = backup_device_controller_slot @property def parent_controller(self): """ Gets the parent_controller of this CacheBackupDevice. A reference to the controller where the backup device resides. Note that this field is targeted for deletion in SYMbol rev. 85b. :return: The parent_controller of this CacheBackupDevice. :rtype: str :required/optional: required """ return self._parent_controller @parent_controller.setter def parent_controller(self, parent_controller): """ Sets the parent_controller of this CacheBackupDevice. A reference to the controller where the backup device resides. Note that this field is targeted for deletion in SYMbol rev. 85b. :param parent_controller: The parent_controller of this CacheBackupDevice. :type: str """ self._parent_controller = parent_controller @property def backup_device_type(self): """ Gets the backup_device_type of this CacheBackupDevice. The type of the backup device ( e.g., USB flash drive). :return: The backup_device_type of this CacheBackupDevice. :rtype: str :required/optional: required """ return self._backup_device_type @backup_device_type.setter def backup_device_type(self, backup_device_type): """ Sets the backup_device_type of this CacheBackupDevice. The type of the backup device ( e.g., USB flash drive). :param backup_device_type: The backup_device_type of this CacheBackupDevice. :type: str """ allowed_values = ["unknown", "usbFlash", "sdFlash", "sataFlash", "__UNDEFINED"] if backup_device_type not in allowed_values: raise ValueError( "Invalid value for `backup_device_type`, must be one of {0}" .format(allowed_values) ) self._backup_device_type = backup_device_type @property def backup_device_status(self): """ Gets the backup_device_status of this CacheBackupDevice. The status of the backup device :return: The backup_device_status of this CacheBackupDevice. :rtype: str :required/optional: required """ return self._backup_device_status @backup_device_status.setter def backup_device_status(self, backup_device_status): """ Sets the backup_device_status of this CacheBackupDevice. The status of the backup device :param backup_device_status: The backup_device_status of this CacheBackupDevice. :type: str """ allowed_values = ["unknown", "optimal", "failed", "removed", "writeProtected", "incompatible", "__UNDEFINED"] if backup_device_status not in allowed_values: raise ValueError( "Invalid value for `backup_device_status`, must be one of {0}" .format(allowed_values) ) self._backup_device_status = backup_device_status @property def backup_device_vpd(self): """ Gets the backup_device_vpd of this CacheBackupDevice. Vital product data for the backup device. :return: The backup_device_vpd of this CacheBackupDevice. :rtype: CacheBackupDeviceVpd :required/optional: required """ return self._backup_device_vpd @backup_device_vpd.setter def backup_device_vpd(self, backup_device_vpd): """ Sets the backup_device_vpd of this CacheBackupDevice. Vital product data for the backup device. :param backup_device_vpd: The backup_device_vpd of this CacheBackupDevice. :type: CacheBackupDeviceVpd """ self._backup_device_vpd = backup_device_vpd @property def backup_device_capacity(self): """ Gets the backup_device_capacity of this CacheBackupDevice. The capacity of backup device, expressed in megabytes. :return: The backup_device_capacity of this CacheBackupDevice. :rtype: int :required/optional: required """ return self._backup_device_capacity @backup_device_capacity.setter def backup_device_capacity(self, backup_device_capacity): """ Sets the backup_device_capacity of this CacheBackupDevice. The capacity of backup device, expressed in megabytes. :param backup_device_capacity: The backup_device_capacity of this CacheBackupDevice. :type: int """ self._backup_device_capacity = backup_device_capacity @property def repair_policy(self): """ Gets the repair_policy of this CacheBackupDevice. The repair policy for the cache backup device component. :return: The repair_policy of this CacheBackupDevice. :rtype: RepairPolicy :required/optional: required """ return self._repair_policy @repair_policy.setter def repair_policy(self, repair_policy): """ Sets the repair_policy of this CacheBackupDevice. The repair policy for the cache backup device component. :param repair_policy: The repair_policy of this CacheBackupDevice. :type: RepairPolicy """ self._repair_policy = repair_policy @property def physical_location(self): """ Gets the physical_location of this CacheBackupDevice. The physical location of the cache backup device. The parent field of Location is set to the controller where the device physically resides, and the position field is the parent-relative/like-component-relative slot number of the device, starting at one. :return: The physical_location of this CacheBackupDevice. :rtype: Location :required/optional: required """ return self._physical_location @physical_location.setter def physical_location(self, physical_location): """ Sets the physical_location of this CacheBackupDevice. The physical location of the cache backup device. The parent field of Location is set to the controller where the device physically resides, and the position field is the parent-relative/like-component-relative slot number of the device, starting at one. :param physical_location: The physical_location of this CacheBackupDevice. :type: Location """ self._physical_location = physical_location @property def id(self): """ Gets the id of this CacheBackupDevice. :return: The id of this CacheBackupDevice. :rtype: str :required/optional: optional """ return self._id @id.setter def id(self, id): """ Sets the id of this CacheBackupDevice. :param id: The id of this CacheBackupDevice. :type: str """ self._id = id
[docs] 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
[docs] 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