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

namespace Google\Cloud\AIPlatform\V1\NasJobSpec\MultiTrialAlgorithmSpec\MetricSpec;

use UnexpectedValueException;

/**
 * The available types of optimization goals.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec.GoalType</code>
 */
class GoalType
{
    /**
     * Goal Type will default to maximize.
     *
     * Generated from protobuf enum <code>GOAL_TYPE_UNSPECIFIED = 0;</code>
     */
    const GOAL_TYPE_UNSPECIFIED = 0;
    /**
     * Maximize the goal metric.
     *
     * Generated from protobuf enum <code>MAXIMIZE = 1;</code>
     */
    const MAXIMIZE = 1;
    /**
     * Minimize the goal metric.
     *
     * Generated from protobuf enum <code>MINIMIZE = 2;</code>
     */
    const MINIMIZE = 2;

    private static $valueToName = [
        self::GOAL_TYPE_UNSPECIFIED => 'GOAL_TYPE_UNSPECIFIED',
        self::MAXIMIZE => 'MAXIMIZE',
        self::MINIMIZE => 'MINIMIZE',
    ];

    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);
    }
}


