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

namespace Google\Cloud\Compute\V1\GetReservationBlockRequest;

use UnexpectedValueException;

/**
 * View of the Block.
 *
 * Protobuf type <code>google.cloud.compute.v1.GetReservationBlockRequest.View</code>
 */
class View
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_VIEW = 0;</code>
     */
    const UNDEFINED_VIEW = 0;
    /**
     * This view includes basic information about the reservation block
     *
     * Generated from protobuf enum <code>BASIC = 62970894;</code>
     */
    const BASIC = 62970894;
    /**
     * The default / unset value. The API will default to the BASIC view.
     *
     * Generated from protobuf enum <code>BLOCK_VIEW_UNSPECIFIED = 275070479;</code>
     */
    const BLOCK_VIEW_UNSPECIFIED = 275070479;
    /**
     * Includes detailed topology view.
     *
     * Generated from protobuf enum <code>FULL = 2169487;</code>
     */
    const FULL = 2169487;

    private static $valueToName = [
        self::UNDEFINED_VIEW => 'UNDEFINED_VIEW',
        self::BASIC => 'BASIC',
        self::BLOCK_VIEW_UNSPECIFIED => 'BLOCK_VIEW_UNSPECIFIED',
        self::FULL => 'FULL',
    ];

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

