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

namespace Google\Cloud\OsConfig\V1\ExecStepConfig;

use UnexpectedValueException;

/**
 * The interpreter used to execute the a file.
 *
 * Protobuf type <code>google.cloud.osconfig.v1.ExecStepConfig.Interpreter</code>
 */
class Interpreter
{
    /**
     * Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the
     * interpreter will be parsed from the shebang line of the script if
     * unspecified.
     *
     * Generated from protobuf enum <code>INTERPRETER_UNSPECIFIED = 0;</code>
     */
    const INTERPRETER_UNSPECIFIED = 0;
    /**
     * Indicates that the script is run with `/bin/sh` on Linux and `cmd`
     * on Windows.
     *
     * Generated from protobuf enum <code>SHELL = 1;</code>
     */
    const SHELL = 1;
    /**
     * Indicates that the file is run with PowerShell flags
     * `-NonInteractive`, `-NoProfile`, and `-ExecutionPolicy Bypass`.
     *
     * Generated from protobuf enum <code>POWERSHELL = 2;</code>
     */
    const POWERSHELL = 2;

    private static $valueToName = [
        self::INTERPRETER_UNSPECIFIED => 'INTERPRETER_UNSPECIFIED',
        self::SHELL => 'SHELL',
        self::POWERSHELL => 'POWERSHELL',
    ];

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


