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

namespace Google\Cloud\AIPlatform\V1\PostStartupScriptConfig;

use UnexpectedValueException;

/**
 * Represents a notebook runtime post startup script behavior.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior</code>
 */
class PostStartupScriptBehavior
{
    /**
     * Unspecified post startup script behavior.
     *
     * Generated from protobuf enum <code>POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0;</code>
     */
    const POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0;
    /**
     * Run post startup script after runtime is started.
     *
     * Generated from protobuf enum <code>RUN_ONCE = 1;</code>
     */
    const RUN_ONCE = 1;
    /**
     * Run post startup script after runtime is stopped.
     *
     * Generated from protobuf enum <code>RUN_EVERY_START = 2;</code>
     */
    const RUN_EVERY_START = 2;
    /**
     * Download and run post startup script every time runtime is started.
     *
     * Generated from protobuf enum <code>DOWNLOAD_AND_RUN_EVERY_START = 3;</code>
     */
    const DOWNLOAD_AND_RUN_EVERY_START = 3;

    private static $valueToName = [
        self::POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED => 'POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED',
        self::RUN_ONCE => 'RUN_ONCE',
        self::RUN_EVERY_START => 'RUN_EVERY_START',
        self::DOWNLOAD_AND_RUN_EVERY_START => 'DOWNLOAD_AND_RUN_EVERY_START',
    ];

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


