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

namespace Google\Cloud\Compute\V1\PublicDelegatedPrefix;

use UnexpectedValueException;

/**
 * Output only. [Output Only] The version of BYOIP API.
 *
 * Protobuf type <code>google.cloud.compute.v1.PublicDelegatedPrefix.ByoipApiVersion</code>
 */
class ByoipApiVersion
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_BYOIP_API_VERSION = 0;</code>
     */
    const UNDEFINED_BYOIP_API_VERSION = 0;
    /**
     * This public delegated prefix usually takes 4 weeks to delete, and the BGP
     * status cannot be changed. Announce and Withdraw APIs can not be used on
     * this prefix.
     *
     * Generated from protobuf enum <code>V1 = 2715;</code>
     */
    const V1 = 2715;
    /**
     * This public delegated prefix takes minutes to delete. Announce and
     * Withdraw APIs can be used on this prefix to change the BGP status.
     *
     * Generated from protobuf enum <code>V2 = 2716;</code>
     */
    const V2 = 2716;

    private static $valueToName = [
        self::UNDEFINED_BYOIP_API_VERSION => 'UNDEFINED_BYOIP_API_VERSION',
        self::V1 => 'V1',
        self::V2 => 'V2',
    ];

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


