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

namespace Google\Cloud\Functions\V1\HttpsTrigger;

use UnexpectedValueException;

/**
 * Available security level settings.
 * This controls the methods to enforce security (HTTPS) on a URL.
 * If unspecified, SECURE_OPTIONAL will be used.
 *
 * Protobuf type <code>google.cloud.functions.v1.HttpsTrigger.SecurityLevel</code>
 */
class SecurityLevel
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>SECURITY_LEVEL_UNSPECIFIED = 0;</code>
     */
    const SECURITY_LEVEL_UNSPECIFIED = 0;
    /**
     * Requests for a URL that match this handler that do not use HTTPS are
     * automatically redirected to the HTTPS URL with the same path. Query
     * parameters are reserved for the redirect.
     *
     * Generated from protobuf enum <code>SECURE_ALWAYS = 1;</code>
     */
    const SECURE_ALWAYS = 1;
    /**
     * Both HTTP and HTTPS requests with URLs that match the handler succeed
     * without redirects. The application can examine the request to determine
     * which protocol was used and respond accordingly.
     *
     * Generated from protobuf enum <code>SECURE_OPTIONAL = 2;</code>
     */
    const SECURE_OPTIONAL = 2;

    private static $valueToName = [
        self::SECURITY_LEVEL_UNSPECIFIED => 'SECURITY_LEVEL_UNSPECIFIED',
        self::SECURE_ALWAYS => 'SECURE_ALWAYS',
        self::SECURE_OPTIONAL => 'SECURE_OPTIONAL',
    ];

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


