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

namespace Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\ScoreSource;

use UnexpectedValueException;

/**
 * What created the score.
 *
 * Protobuf type <code>google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource.SourceType</code>
 */
class SourceType
{
    /**
     * Source type is unspecified.
     *
     * Generated from protobuf enum <code>SOURCE_TYPE_UNSPECIFIED = 0;</code>
     */
    const SOURCE_TYPE_UNSPECIFIED = 0;
    /**
     * Score is derived only from system-generated answers.
     *
     * Generated from protobuf enum <code>SYSTEM_GENERATED_ONLY = 1;</code>
     */
    const SYSTEM_GENERATED_ONLY = 1;
    /**
     * Score is derived from both system-generated answers, and includes
     * any manual edits if they exist.
     *
     * Generated from protobuf enum <code>INCLUDES_MANUAL_EDITS = 2;</code>
     */
    const INCLUDES_MANUAL_EDITS = 2;

    private static $valueToName = [
        self::SOURCE_TYPE_UNSPECIFIED => 'SOURCE_TYPE_UNSPECIFIED',
        self::SYSTEM_GENERATED_ONLY => 'SYSTEM_GENERATED_ONLY',
        self::INCLUDES_MANUAL_EDITS => 'INCLUDES_MANUAL_EDITS',
    ];

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


