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

namespace Google\Cloud\Compute\V1\SecurityPolicy;

use UnexpectedValueException;

/**
 * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. This field can be set only at resource creation time.
 *
 * Protobuf type <code>google.cloud.compute.v1.SecurityPolicy.Type</code>
 */
class Type
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_TYPE = 0;</code>
     */
    const UNDEFINED_TYPE = 0;
    /**
     * Generated from protobuf enum <code>CLOUD_ARMOR = 260640373;</code>
     */
    const CLOUD_ARMOR = 260640373;
    /**
     * Generated from protobuf enum <code>CLOUD_ARMOR_EDGE = 250728775;</code>
     */
    const CLOUD_ARMOR_EDGE = 250728775;
    /**
     * Generated from protobuf enum <code>CLOUD_ARMOR_NETWORK = 488527428;</code>
     */
    const CLOUD_ARMOR_NETWORK = 488527428;

    private static $valueToName = [
        self::UNDEFINED_TYPE => 'UNDEFINED_TYPE',
        self::CLOUD_ARMOR => 'CLOUD_ARMOR',
        self::CLOUD_ARMOR_EDGE => 'CLOUD_ARMOR_EDGE',
        self::CLOUD_ARMOR_NETWORK => 'CLOUD_ARMOR_NETWORK',
    ];

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


