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

namespace Google\Cloud\Dataplex\V1\Schema;

use UnexpectedValueException;

/**
 * Additional qualifiers to define field semantics.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.Schema.Mode</code>
 */
class Mode
{
    /**
     * Mode unspecified.
     *
     * Generated from protobuf enum <code>MODE_UNSPECIFIED = 0;</code>
     */
    const MODE_UNSPECIFIED = 0;
    /**
     * The field has required semantics.
     *
     * Generated from protobuf enum <code>REQUIRED = 1;</code>
     */
    const REQUIRED = 1;
    /**
     * The field has optional semantics, and may be null.
     *
     * Generated from protobuf enum <code>NULLABLE = 2;</code>
     */
    const NULLABLE = 2;
    /**
     * The field has repeated (0 or more) semantics, and is a list of values.
     *
     * Generated from protobuf enum <code>REPEATED = 3;</code>
     */
    const REPEATED = 3;

    private static $valueToName = [
        self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED',
        self::REQUIRED => 'REQUIRED',
        self::NULLABLE => 'NULLABLE',
        self::REPEATED => 'REPEATED',
    ];

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


