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

namespace Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Query;

use UnexpectedValueException;

/**
 * Priority given to the query.
 *
 * Protobuf type <code>google.cloud.audit.BigQueryAuditMetadata.JobConfig.Query.Priority</code>
 */
class Priority
{
    /**
     * Unknown.
     *
     * Generated from protobuf enum <code>PRIORITY_UNSPECIFIED = 0;</code>
     */
    const PRIORITY_UNSPECIFIED = 0;
    /**
     * Interactive query.
     *
     * Generated from protobuf enum <code>QUERY_INTERACTIVE = 1;</code>
     */
    const QUERY_INTERACTIVE = 1;
    /**
     * Batch query.
     *
     * Generated from protobuf enum <code>QUERY_BATCH = 2;</code>
     */
    const QUERY_BATCH = 2;

    private static $valueToName = [
        self::PRIORITY_UNSPECIFIED => 'PRIORITY_UNSPECIFIED',
        self::QUERY_INTERACTIVE => 'QUERY_INTERACTIVE',
        self::QUERY_BATCH => 'QUERY_BATCH',
    ];

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


