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

namespace Google\Cloud\ServiceControl\V1\Operation;

use UnexpectedValueException;

/**
 * Defines the importance of the data contained in the operation.
 *
 * Protobuf type <code>google.api.servicecontrol.v1.Operation.Importance</code>
 */
class Importance
{
    /**
     * Allows data caching, batching, and aggregation. It provides
     * higher performance with higher data loss risk.
     *
     * Generated from protobuf enum <code>LOW = 0;</code>
     */
    const LOW = 0;
    /**
     * Disables data aggregation to minimize data loss. It is for operations
     * that contains significant monetary value or audit trail. This feature
     * only applies to the client libraries.
     *
     * Generated from protobuf enum <code>HIGH = 1;</code>
     */
    const HIGH = 1;

    private static $valueToName = [
        self::LOW => 'LOW',
        self::HIGH => 'HIGH',
    ];

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


