<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/explanation_metadata.proto

namespace Google\Cloud\AIPlatform\V1\ExplanationMetadata\InputMetadata\Visualization;

use UnexpectedValueException;

/**
 * Whether to only highlight pixels with positive contributions, negative
 * or both. Defaults to POSITIVE.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.Polarity</code>
 */
class Polarity
{
    /**
     * Default value. This is the same as POSITIVE.
     *
     * Generated from protobuf enum <code>POLARITY_UNSPECIFIED = 0;</code>
     */
    const POLARITY_UNSPECIFIED = 0;
    /**
     * Highlights the pixels/outlines that were most influential to the
     * model's prediction.
     *
     * Generated from protobuf enum <code>POSITIVE = 1;</code>
     */
    const POSITIVE = 1;
    /**
     * Setting polarity to negative highlights areas that does not lead to
     * the models's current prediction.
     *
     * Generated from protobuf enum <code>NEGATIVE = 2;</code>
     */
    const NEGATIVE = 2;
    /**
     * Shows both positive and negative attributions.
     *
     * Generated from protobuf enum <code>BOTH = 3;</code>
     */
    const BOTH = 3;

    private static $valueToName = [
        self::POLARITY_UNSPECIFIED => 'POLARITY_UNSPECIFIED',
        self::POSITIVE => 'POSITIVE',
        self::NEGATIVE => 'NEGATIVE',
        self::BOTH => 'BOTH',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}


