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

namespace Google\Cloud\BigQuery\Reservation\V1;

use UnexpectedValueException;

/**
 * The type of editions.
 * Different features and behaviors are provided to different editions
 * Capacity commitments and reservations are linked to editions.
 *
 * Protobuf type <code>google.cloud.bigquery.reservation.v1.Edition</code>
 */
class Edition
{
    /**
     * Default value, which will be treated as ENTERPRISE.
     *
     * Generated from protobuf enum <code>EDITION_UNSPECIFIED = 0;</code>
     */
    const EDITION_UNSPECIFIED = 0;
    /**
     * Standard edition.
     *
     * Generated from protobuf enum <code>STANDARD = 1;</code>
     */
    const STANDARD = 1;
    /**
     * Enterprise edition.
     *
     * Generated from protobuf enum <code>ENTERPRISE = 2;</code>
     */
    const ENTERPRISE = 2;
    /**
     * Enterprise plus edition.
     *
     * Generated from protobuf enum <code>ENTERPRISE_PLUS = 3;</code>
     */
    const ENTERPRISE_PLUS = 3;

    private static $valueToName = [
        self::EDITION_UNSPECIFIED => 'EDITION_UNSPECIFIED',
        self::STANDARD => 'STANDARD',
        self::ENTERPRISE => 'ENTERPRISE',
        self::ENTERPRISE_PLUS => 'ENTERPRISE_PLUS',
    ];

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

