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

namespace Google\Cloud\DataCatalog\V1\Taxonomy;

use UnexpectedValueException;

/**
 * Defines policy types where the policy tags can be used for.
 *
 * Protobuf type <code>google.cloud.datacatalog.v1.Taxonomy.PolicyType</code>
 */
class PolicyType
{
    /**
     * Unspecified policy type.
     *
     * Generated from protobuf enum <code>POLICY_TYPE_UNSPECIFIED = 0;</code>
     */
    const POLICY_TYPE_UNSPECIFIED = 0;
    /**
     * Fine-grained access control policy that enables access control on
     * tagged sub-resources.
     *
     * Generated from protobuf enum <code>FINE_GRAINED_ACCESS_CONTROL = 1;</code>
     */
    const FINE_GRAINED_ACCESS_CONTROL = 1;

    private static $valueToName = [
        self::POLICY_TYPE_UNSPECIFIED => 'POLICY_TYPE_UNSPECIFIED',
        self::FINE_GRAINED_ACCESS_CONTROL => 'FINE_GRAINED_ACCESS_CONTROL',
    ];

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


