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

namespace Google\Cloud\Datastream\V1\JsonFileFormat;

use UnexpectedValueException;

/**
 * Schema file format.
 *
 * Protobuf type <code>google.cloud.datastream.v1.JsonFileFormat.SchemaFileFormat</code>
 */
class SchemaFileFormat
{
    /**
     * Unspecified schema file format.
     *
     * Generated from protobuf enum <code>SCHEMA_FILE_FORMAT_UNSPECIFIED = 0;</code>
     */
    const SCHEMA_FILE_FORMAT_UNSPECIFIED = 0;
    /**
     * Do not attach schema file.
     *
     * Generated from protobuf enum <code>NO_SCHEMA_FILE = 1;</code>
     */
    const NO_SCHEMA_FILE = 1;
    /**
     * Avro schema format.
     *
     * Generated from protobuf enum <code>AVRO_SCHEMA_FILE = 2;</code>
     */
    const AVRO_SCHEMA_FILE = 2;

    private static $valueToName = [
        self::SCHEMA_FILE_FORMAT_UNSPECIFIED => 'SCHEMA_FILE_FORMAT_UNSPECIFIED',
        self::NO_SCHEMA_FILE => 'NO_SCHEMA_FILE',
        self::AVRO_SCHEMA_FILE => 'AVRO_SCHEMA_FILE',
    ];

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


