<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto

namespace Google\Cloud\BigQuery\DataPolicies\V1beta1\DataPolicy;

use UnexpectedValueException;

/**
 * A list of supported data policy types.
 *
 * Protobuf type <code>google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType</code>
 */
class DataPolicyType
{
    /**
     * Default value for the data policy type. This should not be used.
     *
     * Generated from protobuf enum <code>DATA_POLICY_TYPE_UNSPECIFIED = 0;</code>
     */
    const DATA_POLICY_TYPE_UNSPECIFIED = 0;
    /**
     * Used to create a data policy for column-level security, without data
     * masking.
     *
     * Generated from protobuf enum <code>COLUMN_LEVEL_SECURITY_POLICY = 3;</code>
     */
    const COLUMN_LEVEL_SECURITY_POLICY = 3;
    /**
     * Used to create a data policy for data masking.
     *
     * Generated from protobuf enum <code>DATA_MASKING_POLICY = 2;</code>
     */
    const DATA_MASKING_POLICY = 2;

    private static $valueToName = [
        self::DATA_POLICY_TYPE_UNSPECIFIED => 'DATA_POLICY_TYPE_UNSPECIFIED',
        self::COLUMN_LEVEL_SECURITY_POLICY => 'COLUMN_LEVEL_SECURITY_POLICY',
        self::DATA_MASKING_POLICY => 'DATA_MASKING_POLICY',
    ];

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


