# coding: utf-8
# Copyright (c) 2016, 2026, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220919


from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
from oci.decorators import init_model_state_from_kwargs


@init_model_state_from_kwargs
class LogicalUnit(object):
    """
    Logical unit of the host storage.
    """

    #: A constant which can be used with the lun_status property of a LogicalUnit.
    #: This constant has a value of "FREE"
    LUN_STATUS_FREE = "FREE"

    #: A constant which can be used with the lun_status property of a LogicalUnit.
    #: This constant has a value of "UNUSABLE"
    LUN_STATUS_UNUSABLE = "UNUSABLE"

    #: A constant which can be used with the lun_status property of a LogicalUnit.
    #: This constant has a value of "USED"
    LUN_STATUS_USED = "USED"

    def __init__(self, **kwargs):
        """
        Initializes a new LogicalUnit object with values from keyword arguments.
        The following keyword arguments are supported (corresponding to the getters/setters of this class):

        :param address:
            The value to assign to the address property of this LogicalUnit.
        :type address: str

        :param discard_max_size_in_bytes:
            The value to assign to the discard_max_size_in_bytes property of this LogicalUnit.
        :type discard_max_size_in_bytes: int

        :param is_discard_zeroes_data:
            The value to assign to the is_discard_zeroes_data property of this LogicalUnit.
        :type is_discard_zeroes_data: bool

        :param disk_id:
            The value to assign to the disk_id property of this LogicalUnit.
        :type disk_id: str

        :param id:
            The value to assign to the id property of this LogicalUnit.
        :type id: str

        :param lun_mapping:
            The value to assign to the lun_mapping property of this LogicalUnit.
        :type lun_mapping: int

        :param lun_status:
            The value to assign to the lun_status property of this LogicalUnit.
            Allowed values for this property are: "FREE", "UNUSABLE", "USED"
        :type lun_status: str

        :param password:
            The value to assign to the password property of this LogicalUnit.
        :type password: str

        :param paths:
            The value to assign to the paths property of this LogicalUnit.
        :type paths: int

        :param port:
            The value to assign to the port property of this LogicalUnit.
        :type port: int

        :param portal:
            The value to assign to the portal property of this LogicalUnit.
        :type portal: str

        :param product_id:
            The value to assign to the product_id property of this LogicalUnit.
        :type product_id: str

        :param serial:
            The value to assign to the serial property of this LogicalUnit.
        :type serial: str

        :param size:
            The value to assign to the size property of this LogicalUnit.
        :type size: int

        :param storage_domain_id:
            The value to assign to the storage_domain_id property of this LogicalUnit.
        :type storage_domain_id: str

        :param target:
            The value to assign to the target property of this LogicalUnit.
        :type target: str

        :param username:
            The value to assign to the username property of this LogicalUnit.
        :type username: str

        :param vendor_id:
            The value to assign to the vendor_id property of this LogicalUnit.
        :type vendor_id: str

        :param volume_group_id:
            The value to assign to the volume_group_id property of this LogicalUnit.
        :type volume_group_id: str

        """
        self.swagger_types = {
            'address': 'str',
            'discard_max_size_in_bytes': 'int',
            'is_discard_zeroes_data': 'bool',
            'disk_id': 'str',
            'id': 'str',
            'lun_mapping': 'int',
            'lun_status': 'str',
            'password': 'str',
            'paths': 'int',
            'port': 'int',
            'portal': 'str',
            'product_id': 'str',
            'serial': 'str',
            'size': 'int',
            'storage_domain_id': 'str',
            'target': 'str',
            'username': 'str',
            'vendor_id': 'str',
            'volume_group_id': 'str'
        }
        self.attribute_map = {
            'address': 'address',
            'discard_max_size_in_bytes': 'discardMaxSizeInBytes',
            'is_discard_zeroes_data': 'isDiscardZeroesData',
            'disk_id': 'diskId',
            'id': 'id',
            'lun_mapping': 'lunMapping',
            'lun_status': 'lunStatus',
            'password': 'password',
            'paths': 'paths',
            'port': 'port',
            'portal': 'portal',
            'product_id': 'productId',
            'serial': 'serial',
            'size': 'size',
            'storage_domain_id': 'storageDomainId',
            'target': 'target',
            'username': 'username',
            'vendor_id': 'vendorId',
            'volume_group_id': 'volumeGroupId'
        }
        self._address = None
        self._discard_max_size_in_bytes = None
        self._is_discard_zeroes_data = None
        self._disk_id = None
        self._id = None
        self._lun_mapping = None
        self._lun_status = None
        self._password = None
        self._paths = None
        self._port = None
        self._portal = None
        self._product_id = None
        self._serial = None
        self._size = None
        self._storage_domain_id = None
        self._target = None
        self._username = None
        self._vendor_id = None
        self._volume_group_id = None

    @property
    def address(self):
        """
        Gets the address of this LogicalUnit.
        Address of the logical unit.


        :return: The address of this LogicalUnit.
        :rtype: str
        """
        return self._address

    @address.setter
    def address(self, address):
        """
        Sets the address of this LogicalUnit.
        Address of the logical unit.


        :param address: The address of this LogicalUnit.
        :type: str
        """
        self._address = address

    @property
    def discard_max_size_in_bytes(self):
        """
        Gets the discard_max_size_in_bytes of this LogicalUnit.
        The maximum number of bytes that can be discarded by the logical unit???s underlying storage in a single operation.


        :return: The discard_max_size_in_bytes of this LogicalUnit.
        :rtype: int
        """
        return self._discard_max_size_in_bytes

    @discard_max_size_in_bytes.setter
    def discard_max_size_in_bytes(self, discard_max_size_in_bytes):
        """
        Sets the discard_max_size_in_bytes of this LogicalUnit.
        The maximum number of bytes that can be discarded by the logical unit???s underlying storage in a single operation.


        :param discard_max_size_in_bytes: The discard_max_size_in_bytes of this LogicalUnit.
        :type: int
        """
        self._discard_max_size_in_bytes = discard_max_size_in_bytes

    @property
    def is_discard_zeroes_data(self):
        """
        Gets the is_discard_zeroes_data of this LogicalUnit.
        True, if previously discarded blocks in the logical unit???s underlying storage are read back as zeros.


        :return: The is_discard_zeroes_data of this LogicalUnit.
        :rtype: bool
        """
        return self._is_discard_zeroes_data

    @is_discard_zeroes_data.setter
    def is_discard_zeroes_data(self, is_discard_zeroes_data):
        """
        Sets the is_discard_zeroes_data of this LogicalUnit.
        True, if previously discarded blocks in the logical unit???s underlying storage are read back as zeros.


        :param is_discard_zeroes_data: The is_discard_zeroes_data of this LogicalUnit.
        :type: bool
        """
        self._is_discard_zeroes_data = is_discard_zeroes_data

    @property
    def disk_id(self):
        """
        Gets the disk_id of this LogicalUnit.
        Disk ID of the logical unit.


        :return: The disk_id of this LogicalUnit.
        :rtype: str
        """
        return self._disk_id

    @disk_id.setter
    def disk_id(self, disk_id):
        """
        Sets the disk_id of this LogicalUnit.
        Disk ID of the logical unit.


        :param disk_id: The disk_id of this LogicalUnit.
        :type: str
        """
        self._disk_id = disk_id

    @property
    def id(self):
        """
        Gets the id of this LogicalUnit.
        a unique identifier.


        :return: The id of this LogicalUnit.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this LogicalUnit.
        a unique identifier.


        :param id: The id of this LogicalUnit.
        :type: str
        """
        self._id = id

    @property
    def lun_mapping(self):
        """
        Gets the lun_mapping of this LogicalUnit.
        LUN Mapping


        :return: The lun_mapping of this LogicalUnit.
        :rtype: int
        """
        return self._lun_mapping

    @lun_mapping.setter
    def lun_mapping(self, lun_mapping):
        """
        Sets the lun_mapping of this LogicalUnit.
        LUN Mapping


        :param lun_mapping: The lun_mapping of this LogicalUnit.
        :type: int
        """
        self._lun_mapping = lun_mapping

    @property
    def lun_status(self):
        """
        Gets the lun_status of this LogicalUnit.
        LUN Status

        Allowed values for this property are: "FREE", "UNUSABLE", "USED"


        :return: The lun_status of this LogicalUnit.
        :rtype: str
        """
        return self._lun_status

    @lun_status.setter
    def lun_status(self, lun_status):
        """
        Sets the lun_status of this LogicalUnit.
        LUN Status


        :param lun_status: The lun_status of this LogicalUnit.
        :type: str
        """
        allowed_values = ["FREE", "UNUSABLE", "USED"]
        if not value_allowed_none_or_none_sentinel(lun_status, allowed_values):
            raise ValueError(
                f"Invalid value for `lun_status`, must be None or one of {allowed_values}"
            )
        self._lun_status = lun_status

    @property
    def password(self):
        """
        Gets the password of this LogicalUnit.
        Password of the logical unit.


        :return: The password of this LogicalUnit.
        :rtype: str
        """
        return self._password

    @password.setter
    def password(self, password):
        """
        Sets the password of this LogicalUnit.
        Password of the logical unit.


        :param password: The password of this LogicalUnit.
        :type: str
        """
        self._password = password

    @property
    def paths(self):
        """
        Gets the paths of this LogicalUnit.
        Paths of the logical unit.


        :return: The paths of this LogicalUnit.
        :rtype: int
        """
        return self._paths

    @paths.setter
    def paths(self, paths):
        """
        Sets the paths of this LogicalUnit.
        Paths of the logical unit.


        :param paths: The paths of this LogicalUnit.
        :type: int
        """
        self._paths = paths

    @property
    def port(self):
        """
        Gets the port of this LogicalUnit.
        Port of the logical unit.


        :return: The port of this LogicalUnit.
        :rtype: int
        """
        return self._port

    @port.setter
    def port(self, port):
        """
        Sets the port of this LogicalUnit.
        Port of the logical unit.


        :param port: The port of this LogicalUnit.
        :type: int
        """
        self._port = port

    @property
    def portal(self):
        """
        Gets the portal of this LogicalUnit.
        Portal of the logical unit.


        :return: The portal of this LogicalUnit.
        :rtype: str
        """
        return self._portal

    @portal.setter
    def portal(self, portal):
        """
        Sets the portal of this LogicalUnit.
        Portal of the logical unit.


        :param portal: The portal of this LogicalUnit.
        :type: str
        """
        self._portal = portal

    @property
    def product_id(self):
        """
        Gets the product_id of this LogicalUnit.
        Product ID of the logical unit.


        :return: The product_id of this LogicalUnit.
        :rtype: str
        """
        return self._product_id

    @product_id.setter
    def product_id(self, product_id):
        """
        Sets the product_id of this LogicalUnit.
        Product ID of the logical unit.


        :param product_id: The product_id of this LogicalUnit.
        :type: str
        """
        self._product_id = product_id

    @property
    def serial(self):
        """
        Gets the serial of this LogicalUnit.
        Serial of the logical unit.


        :return: The serial of this LogicalUnit.
        :rtype: str
        """
        return self._serial

    @serial.setter
    def serial(self, serial):
        """
        Sets the serial of this LogicalUnit.
        Serial of the logical unit.


        :param serial: The serial of this LogicalUnit.
        :type: str
        """
        self._serial = serial

    @property
    def size(self):
        """
        Gets the size of this LogicalUnit.
        Size of the logical unit.


        :return: The size of this LogicalUnit.
        :rtype: int
        """
        return self._size

    @size.setter
    def size(self, size):
        """
        Sets the size of this LogicalUnit.
        Size of the logical unit.


        :param size: The size of this LogicalUnit.
        :type: int
        """
        self._size = size

    @property
    def storage_domain_id(self):
        """
        Gets the storage_domain_id of this LogicalUnit.
        Storage Domain ID of the logical unit.


        :return: The storage_domain_id of this LogicalUnit.
        :rtype: str
        """
        return self._storage_domain_id

    @storage_domain_id.setter
    def storage_domain_id(self, storage_domain_id):
        """
        Sets the storage_domain_id of this LogicalUnit.
        Storage Domain ID of the logical unit.


        :param storage_domain_id: The storage_domain_id of this LogicalUnit.
        :type: str
        """
        self._storage_domain_id = storage_domain_id

    @property
    def target(self):
        """
        Gets the target of this LogicalUnit.
        Target of the logical unit.


        :return: The target of this LogicalUnit.
        :rtype: str
        """
        return self._target

    @target.setter
    def target(self, target):
        """
        Sets the target of this LogicalUnit.
        Target of the logical unit.


        :param target: The target of this LogicalUnit.
        :type: str
        """
        self._target = target

    @property
    def username(self):
        """
        Gets the username of this LogicalUnit.
        Username of the logical unit.


        :return: The username of this LogicalUnit.
        :rtype: str
        """
        return self._username

    @username.setter
    def username(self, username):
        """
        Sets the username of this LogicalUnit.
        Username of the logical unit.


        :param username: The username of this LogicalUnit.
        :type: str
        """
        self._username = username

    @property
    def vendor_id(self):
        """
        Gets the vendor_id of this LogicalUnit.
        Vendor ID of the logical unit.


        :return: The vendor_id of this LogicalUnit.
        :rtype: str
        """
        return self._vendor_id

    @vendor_id.setter
    def vendor_id(self, vendor_id):
        """
        Sets the vendor_id of this LogicalUnit.
        Vendor ID of the logical unit.


        :param vendor_id: The vendor_id of this LogicalUnit.
        :type: str
        """
        self._vendor_id = vendor_id

    @property
    def volume_group_id(self):
        """
        Gets the volume_group_id of this LogicalUnit.
        Volume Group ID of the logical unit.


        :return: The volume_group_id of this LogicalUnit.
        :rtype: str
        """
        return self._volume_group_id

    @volume_group_id.setter
    def volume_group_id(self, volume_group_id):
        """
        Sets the volume_group_id of this LogicalUnit.
        Volume Group ID of the logical unit.


        :param volume_group_id: The volume_group_id of this LogicalUnit.
        :type: str
        """
        self._volume_group_id = volume_group_id

    def __repr__(self):
        return formatted_flat_dict(self)

    def __eq__(self, other):
        if other is None:
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self == other
