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

namespace Google\Cloud\Compute\V1\HttpRedirectAction;

use UnexpectedValueException;

/**
 * The HTTP Status code to use for this RedirectAction.
 * Supported values are:
 * - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to 301.
 * - FOUND, which corresponds to 302.
 * - SEE_OTHER which corresponds to 303.
 * - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request method will be retained.
 * - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained.
 *
 * Protobuf type <code>google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode</code>
 */
class RedirectResponseCode
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_REDIRECT_RESPONSE_CODE = 0;</code>
     */
    const UNDEFINED_REDIRECT_RESPONSE_CODE = 0;
    /**
     * Generated from protobuf enum <code>FOUND = 67084130;</code>
     */
    const FOUND = 67084130;
    /**
     * Generated from protobuf enum <code>MOVED_PERMANENTLY_DEFAULT = 118262993;</code>
     */
    const MOVED_PERMANENTLY_DEFAULT = 118262993;
    /**
     * Generated from protobuf enum <code>PERMANENT_REDIRECT = 113570925;</code>
     */
    const PERMANENT_REDIRECT = 113570925;
    /**
     * Generated from protobuf enum <code>SEE_OTHER = 176945124;</code>
     */
    const SEE_OTHER = 176945124;
    /**
     * Generated from protobuf enum <code>TEMPORARY_REDIRECT = 221114922;</code>
     */
    const TEMPORARY_REDIRECT = 221114922;

    private static $valueToName = [
        self::UNDEFINED_REDIRECT_RESPONSE_CODE => 'UNDEFINED_REDIRECT_RESPONSE_CODE',
        self::FOUND => 'FOUND',
        self::MOVED_PERMANENTLY_DEFAULT => 'MOVED_PERMANENTLY_DEFAULT',
        self::PERMANENT_REDIRECT => 'PERMANENT_REDIRECT',
        self::SEE_OTHER => 'SEE_OTHER',
        self::TEMPORARY_REDIRECT => 'TEMPORARY_REDIRECT',
    ];

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


