# 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 OlvmCpu(object):
    """
    CPU attributes in OLVM
    """

    #: A constant which can be used with the architecture property of a OlvmCpu.
    #: This constant has a value of "AARCH64"
    ARCHITECTURE_AARCH64 = "AARCH64"

    #: A constant which can be used with the architecture property of a OlvmCpu.
    #: This constant has a value of "PPC64"
    ARCHITECTURE_PPC64 = "PPC64"

    #: A constant which can be used with the architecture property of a OlvmCpu.
    #: This constant has a value of "S390X"
    ARCHITECTURE_S390_X = "S390X"

    #: A constant which can be used with the architecture property of a OlvmCpu.
    #: This constant has a value of "UNDEFINED"
    ARCHITECTURE_UNDEFINED = "UNDEFINED"

    #: A constant which can be used with the architecture property of a OlvmCpu.
    #: This constant has a value of "X86_64"
    ARCHITECTURE_X86_64 = "X86_64"

    #: A constant which can be used with the mode property of a OlvmCpu.
    #: This constant has a value of "CUSTOM"
    MODE_CUSTOM = "CUSTOM"

    #: A constant which can be used with the mode property of a OlvmCpu.
    #: This constant has a value of "HOST_MODEL"
    MODE_HOST_MODEL = "HOST_MODEL"

    #: A constant which can be used with the mode property of a OlvmCpu.
    #: This constant has a value of "HOST_PASSTHROUGH"
    MODE_HOST_PASSTHROUGH = "HOST_PASSTHROUGH"

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

        :param architecture:
            The value to assign to the architecture property of this OlvmCpu.
            Allowed values for this property are: "AARCH64", "PPC64", "S390X", "UNDEFINED", "X86_64"
        :type architecture: str

        :param core:
            The value to assign to the core property of this OlvmCpu.
        :type core: list[oci.cloud_bridge.models.OlvmCore]

        :param cpu_tune:
            The value to assign to the cpu_tune property of this OlvmCpu.
        :type cpu_tune: oci.cloud_bridge.models.OlvmCpuTune

        :param level:
            The value to assign to the level property of this OlvmCpu.
        :type level: int

        :param mode:
            The value to assign to the mode property of this OlvmCpu.
            Allowed values for this property are: "CUSTOM", "HOST_MODEL", "HOST_PASSTHROUGH"
        :type mode: str

        :param name:
            The value to assign to the name property of this OlvmCpu.
        :type name: str

        :param speed:
            The value to assign to the speed property of this OlvmCpu.
        :type speed: float

        :param cpu_topology:
            The value to assign to the cpu_topology property of this OlvmCpu.
        :type cpu_topology: oci.cloud_bridge.models.OlvmCpuTopology

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

        """
        self.swagger_types = {
            'architecture': 'str',
            'core': 'list[OlvmCore]',
            'cpu_tune': 'OlvmCpuTune',
            'level': 'int',
            'mode': 'str',
            'name': 'str',
            'speed': 'float',
            'cpu_topology': 'OlvmCpuTopology',
            'type': 'str'
        }
        self.attribute_map = {
            'architecture': 'architecture',
            'core': 'core',
            'cpu_tune': 'cpuTune',
            'level': 'level',
            'mode': 'mode',
            'name': 'name',
            'speed': 'speed',
            'cpu_topology': 'cpuTopology',
            'type': 'type'
        }
        self._architecture = None
        self._core = None
        self._cpu_tune = None
        self._level = None
        self._mode = None
        self._name = None
        self._speed = None
        self._cpu_topology = None
        self._type = None

    @property
    def architecture(self):
        """
        Gets the architecture of this OlvmCpu.
        CPU architecture

        Allowed values for this property are: "AARCH64", "PPC64", "S390X", "UNDEFINED", "X86_64"


        :return: The architecture of this OlvmCpu.
        :rtype: str
        """
        return self._architecture

    @architecture.setter
    def architecture(self, architecture):
        """
        Sets the architecture of this OlvmCpu.
        CPU architecture


        :param architecture: The architecture of this OlvmCpu.
        :type: str
        """
        allowed_values = ["AARCH64", "PPC64", "S390X", "UNDEFINED", "X86_64"]
        if not value_allowed_none_or_none_sentinel(architecture, allowed_values):
            raise ValueError(
                f"Invalid value for `architecture`, must be None or one of {allowed_values}"
            )
        self._architecture = architecture

    @property
    def core(self):
        """
        Gets the core of this OlvmCpu.
        List of cores of this CPU


        :return: The core of this OlvmCpu.
        :rtype: list[oci.cloud_bridge.models.OlvmCore]
        """
        return self._core

    @core.setter
    def core(self, core):
        """
        Sets the core of this OlvmCpu.
        List of cores of this CPU


        :param core: The core of this OlvmCpu.
        :type: list[oci.cloud_bridge.models.OlvmCore]
        """
        self._core = core

    @property
    def cpu_tune(self):
        """
        Gets the cpu_tune of this OlvmCpu.

        :return: The cpu_tune of this OlvmCpu.
        :rtype: oci.cloud_bridge.models.OlvmCpuTune
        """
        return self._cpu_tune

    @cpu_tune.setter
    def cpu_tune(self, cpu_tune):
        """
        Sets the cpu_tune of this OlvmCpu.

        :param cpu_tune: The cpu_tune of this OlvmCpu.
        :type: oci.cloud_bridge.models.OlvmCpuTune
        """
        self._cpu_tune = cpu_tune

    @property
    def level(self):
        """
        Gets the level of this OlvmCpu.
        Level of this CPU


        :return: The level of this OlvmCpu.
        :rtype: int
        """
        return self._level

    @level.setter
    def level(self, level):
        """
        Sets the level of this OlvmCpu.
        Level of this CPU


        :param level: The level of this OlvmCpu.
        :type: int
        """
        self._level = level

    @property
    def mode(self):
        """
        Gets the mode of this OlvmCpu.
        CPU mode

        Allowed values for this property are: "CUSTOM", "HOST_MODEL", "HOST_PASSTHROUGH"


        :return: The mode of this OlvmCpu.
        :rtype: str
        """
        return self._mode

    @mode.setter
    def mode(self, mode):
        """
        Sets the mode of this OlvmCpu.
        CPU mode


        :param mode: The mode of this OlvmCpu.
        :type: str
        """
        allowed_values = ["CUSTOM", "HOST_MODEL", "HOST_PASSTHROUGH"]
        if not value_allowed_none_or_none_sentinel(mode, allowed_values):
            raise ValueError(
                f"Invalid value for `mode`, must be None or one of {allowed_values}"
            )
        self._mode = mode

    @property
    def name(self):
        """
        Gets the name of this OlvmCpu.
        A human-readable name in plain text.


        :return: The name of this OlvmCpu.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this OlvmCpu.
        A human-readable name in plain text.


        :param name: The name of this OlvmCpu.
        :type: str
        """
        self._name = name

    @property
    def speed(self):
        """
        Gets the speed of this OlvmCpu.
        Speed of this CPU


        :return: The speed of this OlvmCpu.
        :rtype: float
        """
        return self._speed

    @speed.setter
    def speed(self, speed):
        """
        Sets the speed of this OlvmCpu.
        Speed of this CPU


        :param speed: The speed of this OlvmCpu.
        :type: float
        """
        self._speed = speed

    @property
    def cpu_topology(self):
        """
        Gets the cpu_topology of this OlvmCpu.

        :return: The cpu_topology of this OlvmCpu.
        :rtype: oci.cloud_bridge.models.OlvmCpuTopology
        """
        return self._cpu_topology

    @cpu_topology.setter
    def cpu_topology(self, cpu_topology):
        """
        Sets the cpu_topology of this OlvmCpu.

        :param cpu_topology: The cpu_topology of this OlvmCpu.
        :type: oci.cloud_bridge.models.OlvmCpuTopology
        """
        self._cpu_topology = cpu_topology

    @property
    def type(self):
        """
        Gets the type of this OlvmCpu.
        CPU type


        :return: The type of this OlvmCpu.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """
        Sets the type of this OlvmCpu.
        CPU type


        :param type: The type of this OlvmCpu.
        :type: str
        """
        self._type = type

    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
