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

from .managed_compute_cluster_workload_metric_expression_rule import ManagedComputeClusterWorkloadMetricExpressionRule
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 TargetCustomMetricExpressionRule(ManagedComputeClusterWorkloadMetricExpressionRule):
    """
    A custom Monitoring Query Language (MQL) expression for triggering an autoscaling action on the workload.
    """

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

        :param metric_expression_rule_type:
            The value to assign to the metric_expression_rule_type property of this TargetCustomMetricExpressionRule.
            Allowed values for this property are: "TARGET_PREDEFINED_EXPRESSION", "TARGET_CUSTOM_EXPRESSION"
        :type metric_expression_rule_type: str

        :param scale_configuration:
            The value to assign to the scale_configuration property of this TargetCustomMetricExpressionRule.
        :type scale_configuration: oci.data_science.models.TargetCustomExpressionQueryScalingConfiguration

        """
        self.swagger_types = {
            'metric_expression_rule_type': 'str',
            'scale_configuration': 'TargetCustomExpressionQueryScalingConfiguration'
        }
        self.attribute_map = {
            'metric_expression_rule_type': 'metricExpressionRuleType',
            'scale_configuration': 'scaleConfiguration'
        }
        self._metric_expression_rule_type = None
        self._scale_configuration = None
        self._metric_expression_rule_type = 'TARGET_CUSTOM_EXPRESSION'

    @property
    def scale_configuration(self):
        """
        **[Required]** Gets the scale_configuration of this TargetCustomMetricExpressionRule.

        :return: The scale_configuration of this TargetCustomMetricExpressionRule.
        :rtype: oci.data_science.models.TargetCustomExpressionQueryScalingConfiguration
        """
        return self._scale_configuration

    @scale_configuration.setter
    def scale_configuration(self, scale_configuration):
        """
        Sets the scale_configuration of this TargetCustomMetricExpressionRule.

        :param scale_configuration: The scale_configuration of this TargetCustomMetricExpressionRule.
        :type: oci.data_science.models.TargetCustomExpressionQueryScalingConfiguration
        """
        self._scale_configuration = scale_configuration

    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
