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

from .placement_constraint_details import PlacementConstraintDetails
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 ComputeClusterPlacementConstraintDetails(PlacementConstraintDetails):
    """
    The details for providing placement constraints for a compute cluster.
    """

    #: A constant which can be used with the logical_placement_constraint property of a ComputeClusterPlacementConstraintDetails.
    #: This constant has a value of "SINGLE_TIER"
    LOGICAL_PLACEMENT_CONSTRAINT_SINGLE_TIER = "SINGLE_TIER"

    #: A constant which can be used with the logical_placement_constraint property of a ComputeClusterPlacementConstraintDetails.
    #: This constant has a value of "SINGLE_BLOCK"
    LOGICAL_PLACEMENT_CONSTRAINT_SINGLE_BLOCK = "SINGLE_BLOCK"

    #: A constant which can be used with the logical_placement_constraint property of a ComputeClusterPlacementConstraintDetails.
    #: This constant has a value of "PACKED_DISTRIBUTION_MULTI_BLOCK"
    LOGICAL_PLACEMENT_CONSTRAINT_PACKED_DISTRIBUTION_MULTI_BLOCK = "PACKED_DISTRIBUTION_MULTI_BLOCK"

    def __init__(self, **kwargs):
        """
        Initializes a new ComputeClusterPlacementConstraintDetails object with values from keyword arguments. The default value of the :py:attr:`~oci.core.models.ComputeClusterPlacementConstraintDetails.type` attribute
        of this class is ``COMPUTE_CLUSTER`` and it should not be changed.
        The following keyword arguments are supported (corresponding to the getters/setters of this class):

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

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

        :param target_network_block_ids:
            The value to assign to the target_network_block_ids property of this ComputeClusterPlacementConstraintDetails.
        :type target_network_block_ids: list[str]

        :param target_memory_fabric_ids:
            The value to assign to the target_memory_fabric_ids property of this ComputeClusterPlacementConstraintDetails.
        :type target_memory_fabric_ids: list[str]

        :param logical_placement_constraint:
            The value to assign to the logical_placement_constraint property of this ComputeClusterPlacementConstraintDetails.
            Allowed values for this property are: "SINGLE_TIER", "SINGLE_BLOCK", "PACKED_DISTRIBUTION_MULTI_BLOCK", 'UNKNOWN_ENUM_VALUE'.
            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
        :type logical_placement_constraint: str

        """
        self.swagger_types = {
            'type': 'str',
            'hpc_island_id': 'str',
            'target_network_block_ids': 'list[str]',
            'target_memory_fabric_ids': 'list[str]',
            'logical_placement_constraint': 'str'
        }
        self.attribute_map = {
            'type': 'type',
            'hpc_island_id': 'hpcIslandId',
            'target_network_block_ids': 'targetNetworkBlockIds',
            'target_memory_fabric_ids': 'targetMemoryFabricIds',
            'logical_placement_constraint': 'logicalPlacementConstraint'
        }
        self._type = None
        self._hpc_island_id = None
        self._target_network_block_ids = None
        self._target_memory_fabric_ids = None
        self._logical_placement_constraint = None
        self._type = 'COMPUTE_CLUSTER'

    @property
    def hpc_island_id(self):
        """
        Gets the hpc_island_id of this ComputeClusterPlacementConstraintDetails.
        The `OCID`__ of the HPC island for the compute cluster.

        This field cannot be updated after creation of the compute cluster.

        __ https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm


        :return: The hpc_island_id of this ComputeClusterPlacementConstraintDetails.
        :rtype: str
        """
        return self._hpc_island_id

    @hpc_island_id.setter
    def hpc_island_id(self, hpc_island_id):
        """
        Sets the hpc_island_id of this ComputeClusterPlacementConstraintDetails.
        The `OCID`__ of the HPC island for the compute cluster.

        This field cannot be updated after creation of the compute cluster.

        __ https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm


        :param hpc_island_id: The hpc_island_id of this ComputeClusterPlacementConstraintDetails.
        :type: str
        """
        self._hpc_island_id = hpc_island_id

    @property
    def target_network_block_ids(self):
        """
        Gets the target_network_block_ids of this ComputeClusterPlacementConstraintDetails.
        The list of target network block OCIDs to constrain placement.

        If `targetNetworkBlockIds` is provided, the `hpcIslandId` must be set on the compute cluster,
        and the provided network blocks must belong to that same HPC island.

        The ordering of the array will be preserved. Ensure that all items in the array are unique.


        :return: The target_network_block_ids of this ComputeClusterPlacementConstraintDetails.
        :rtype: list[str]
        """
        return self._target_network_block_ids

    @target_network_block_ids.setter
    def target_network_block_ids(self, target_network_block_ids):
        """
        Sets the target_network_block_ids of this ComputeClusterPlacementConstraintDetails.
        The list of target network block OCIDs to constrain placement.

        If `targetNetworkBlockIds` is provided, the `hpcIslandId` must be set on the compute cluster,
        and the provided network blocks must belong to that same HPC island.

        The ordering of the array will be preserved. Ensure that all items in the array are unique.


        :param target_network_block_ids: The target_network_block_ids of this ComputeClusterPlacementConstraintDetails.
        :type: list[str]
        """
        self._target_network_block_ids = target_network_block_ids

    @property
    def target_memory_fabric_ids(self):
        """
        Gets the target_memory_fabric_ids of this ComputeClusterPlacementConstraintDetails.
        The list of target GPU memory fabric OCIDs to constrain placement.

        If GMFs are passed in, the `hpcIslandId` must be set on the compute cluster, and
        the provided GMFs must belong to that same HPC island.

        The ordering of the array will be preserved. Ensure that all items in the array are unique.


        :return: The target_memory_fabric_ids of this ComputeClusterPlacementConstraintDetails.
        :rtype: list[str]
        """
        return self._target_memory_fabric_ids

    @target_memory_fabric_ids.setter
    def target_memory_fabric_ids(self, target_memory_fabric_ids):
        """
        Sets the target_memory_fabric_ids of this ComputeClusterPlacementConstraintDetails.
        The list of target GPU memory fabric OCIDs to constrain placement.

        If GMFs are passed in, the `hpcIslandId` must be set on the compute cluster, and
        the provided GMFs must belong to that same HPC island.

        The ordering of the array will be preserved. Ensure that all items in the array are unique.


        :param target_memory_fabric_ids: The target_memory_fabric_ids of this ComputeClusterPlacementConstraintDetails.
        :type: list[str]
        """
        self._target_memory_fabric_ids = target_memory_fabric_ids

    @property
    def logical_placement_constraint(self):
        """
        Gets the logical_placement_constraint of this ComputeClusterPlacementConstraintDetails.
        The logical placement strategy to apply.
        Allowed values are `SINGLE_TIER`, `SINGLE_BLOCK`, and `PACKED_DISTRIBUTION_MULTI_BLOCK`.

        Allowed values for this property are: "SINGLE_TIER", "SINGLE_BLOCK", "PACKED_DISTRIBUTION_MULTI_BLOCK", 'UNKNOWN_ENUM_VALUE'.
        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.


        :return: The logical_placement_constraint of this ComputeClusterPlacementConstraintDetails.
        :rtype: str
        """
        return self._logical_placement_constraint

    @logical_placement_constraint.setter
    def logical_placement_constraint(self, logical_placement_constraint):
        """
        Sets the logical_placement_constraint of this ComputeClusterPlacementConstraintDetails.
        The logical placement strategy to apply.
        Allowed values are `SINGLE_TIER`, `SINGLE_BLOCK`, and `PACKED_DISTRIBUTION_MULTI_BLOCK`.


        :param logical_placement_constraint: The logical_placement_constraint of this ComputeClusterPlacementConstraintDetails.
        :type: str
        """
        allowed_values = ["SINGLE_TIER", "SINGLE_BLOCK", "PACKED_DISTRIBUTION_MULTI_BLOCK"]
        if not value_allowed_none_or_none_sentinel(logical_placement_constraint, allowed_values):
            logical_placement_constraint = 'UNKNOWN_ENUM_VALUE'
        self._logical_placement_constraint = logical_placement_constraint

    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
