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

namespace Google\Cloud\ContactCenterInsights\V1\BulkUploadFeedbackLabelsRequest\GcsSource;

use UnexpectedValueException;

/**
 * All permissible file formats.
 *
 * Protobuf type <code>google.cloud.contactcenterinsights.v1.BulkUploadFeedbackLabelsRequest.GcsSource.Format</code>
 */
class Format
{
    /**
     * Unspecified format.
     *
     * Generated from protobuf enum <code>FORMAT_UNSPECIFIED = 0;</code>
     */
    const FORMAT_UNSPECIFIED = 0;
    /**
     * CSV format.
     *
     * Generated from protobuf enum <code>CSV = 1;</code>
     */
    const CSV = 1;
    /**
     * JSON format.
     *
     * Generated from protobuf enum <code>JSON = 2;</code>
     */
    const JSON = 2;

    private static $valueToName = [
        self::FORMAT_UNSPECIFIED => 'FORMAT_UNSPECIFIED',
        self::CSV => 'CSV',
        self::JSON => 'JSON',
    ];

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

