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

namespace Google\Cloud\Tasks\V2beta3\UriOverride;

use UnexpectedValueException;

/**
 * UriOverrideEnforceMode mode is to define enforcing mode for the override
 * modes.
 *
 * Protobuf type <code>google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode</code>
 */
class UriOverrideEnforceMode
{
    /**
     * OverrideMode Unspecified. Defaults to ALWAYS.
     *
     * Generated from protobuf enum <code>URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0;</code>
     */
    const URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0;
    /**
     * In the IF_NOT_EXISTS mode, queue-level configuration is only
     * applied where task-level configuration does not exist.
     *
     * Generated from protobuf enum <code>IF_NOT_EXISTS = 1;</code>
     */
    const IF_NOT_EXISTS = 1;
    /**
     * In the ALWAYS mode, queue-level configuration overrides all
     * task-level configuration
     *
     * Generated from protobuf enum <code>ALWAYS = 2;</code>
     */
    const ALWAYS = 2;

    private static $valueToName = [
        self::URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED => 'URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED',
        self::IF_NOT_EXISTS => 'IF_NOT_EXISTS',
        self::ALWAYS => 'ALWAYS',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UriOverrideEnforceMode::class, \Google\Cloud\Tasks\V2beta3\UriOverride_UriOverrideEnforceMode::class);

