# 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: 20220509


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 OlvmIp(object):
    """
    Represents the IP configuration of a network interface.
    """

    #: A constant which can be used with the ip_version property of a OlvmIp.
    #: This constant has a value of "V4"
    IP_VERSION_V4 = "V4"

    #: A constant which can be used with the ip_version property of a OlvmIp.
    #: This constant has a value of "V6"
    IP_VERSION_V6 = "V6"

    def __init__(self, **kwargs):
        """
        Initializes a new OlvmIp 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 OlvmIp.
        :type address: str

        :param gateway:
            The value to assign to the gateway property of this OlvmIp.
        :type gateway: str

        :param netmask:
            The value to assign to the netmask property of this OlvmIp.
        :type netmask: str

        :param ip_version:
            The value to assign to the ip_version property of this OlvmIp.
            Allowed values for this property are: "V4", "V6"
        :type ip_version: str

        """
        self.swagger_types = {
            'address': 'str',
            'gateway': 'str',
            'netmask': 'str',
            'ip_version': 'str'
        }
        self.attribute_map = {
            'address': 'address',
            'gateway': 'gateway',
            'netmask': 'netmask',
            'ip_version': 'ipVersion'
        }
        self._address = None
        self._gateway = None
        self._netmask = None
        self._ip_version = None

    @property
    def address(self):
        """
        Gets the address of this OlvmIp.
        The text representation of the IP address.


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

    @address.setter
    def address(self, address):
        """
        Sets the address of this OlvmIp.
        The text representation of the IP address.


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

    @property
    def gateway(self):
        """
        Gets the gateway of this OlvmIp.
        The address of the default gateway.


        :return: The gateway of this OlvmIp.
        :rtype: str
        """
        return self._gateway

    @gateway.setter
    def gateway(self, gateway):
        """
        Sets the gateway of this OlvmIp.
        The address of the default gateway.


        :param gateway: The gateway of this OlvmIp.
        :type: str
        """
        self._gateway = gateway

    @property
    def netmask(self):
        """
        Gets the netmask of this OlvmIp.
        The network mask.


        :return: The netmask of this OlvmIp.
        :rtype: str
        """
        return self._netmask

    @netmask.setter
    def netmask(self, netmask):
        """
        Sets the netmask of this OlvmIp.
        The network mask.


        :param netmask: The netmask of this OlvmIp.
        :type: str
        """
        self._netmask = netmask

    @property
    def ip_version(self):
        """
        Gets the ip_version of this OlvmIp.
        The version of the IP protocol.

        Allowed values for this property are: "V4", "V6"


        :return: The ip_version of this OlvmIp.
        :rtype: str
        """
        return self._ip_version

    @ip_version.setter
    def ip_version(self, ip_version):
        """
        Sets the ip_version of this OlvmIp.
        The version of the IP protocol.


        :param ip_version: The ip_version of this OlvmIp.
        :type: str
        """
        allowed_values = ["V4", "V6"]
        if not value_allowed_none_or_none_sentinel(ip_version, allowed_values):
            raise ValueError(
                f"Invalid value for `ip_version`, must be None or one of {allowed_values}"
            )
        self._ip_version = ip_version

    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
