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

namespace Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\RetrievalMetadata;

use UnexpectedValueException;

/**
 * Describes the source to which the metadata is associated to.
 *
 * Protobuf type <code>google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata.Source</code>
 */
class Source
{
    /**
     * Unspecified source.
     *
     * Generated from protobuf enum <code>SOURCE_UNSPECIFIED = 0;</code>
     */
    const SOURCE_UNSPECIFIED = 0;
    /**
     * Vertex AI search.
     *
     * Generated from protobuf enum <code>VERTEX_AI_SEARCH = 1;</code>
     */
    const VERTEX_AI_SEARCH = 1;
    /**
     * Google Search.
     *
     * Generated from protobuf enum <code>GOOGLE_SEARCH = 3;</code>
     */
    const GOOGLE_SEARCH = 3;
    /**
     * User inline provided content.
     *
     * Generated from protobuf enum <code>INLINE_CONTENT = 2;</code>
     */
    const INLINE_CONTENT = 2;
    /**
     * Google Maps.
     *
     * Generated from protobuf enum <code>GOOGLE_MAPS = 4;</code>
     */
    const GOOGLE_MAPS = 4;

    private static $valueToName = [
        self::SOURCE_UNSPECIFIED => 'SOURCE_UNSPECIFIED',
        self::VERTEX_AI_SEARCH => 'VERTEX_AI_SEARCH',
        self::GOOGLE_SEARCH => 'GOOGLE_SEARCH',
        self::INLINE_CONTENT => 'INLINE_CONTENT',
        self::GOOGLE_MAPS => 'GOOGLE_MAPS',
    ];

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


