<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v21/enums/search_term_match_source.proto

namespace Google\Ads\GoogleAds\V21\Enums\SearchTermMatchSourceEnum;

use UnexpectedValueException;

/**
 * The search term match sources.
 *
 * Protobuf type <code>google.ads.googleads.v21.enums.SearchTermMatchSourceEnum.SearchTermMatchSource</code>
 */
class SearchTermMatchSource
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * Used for return value only. Represents value unknown in this version.
     *
     * Generated from protobuf enum <code>UNKNOWN = 1;</code>
     */
    const UNKNOWN = 1;
    /**
     * The match is from a user-provided keyword.
     *
     * Generated from protobuf enum <code>ADVERTISER_PROVIDED_KEYWORD = 2;</code>
     */
    const ADVERTISER_PROVIDED_KEYWORD = 2;
    /**
     * The match is from the keywordless expansion portion of AI Max.
     *
     * Generated from protobuf enum <code>AI_MAX_KEYWORDLESS = 3;</code>
     */
    const AI_MAX_KEYWORDLESS = 3;
    /**
     * The match is from the broad match expansion portion of AI Max.
     *
     * Generated from protobuf enum <code>AI_MAX_BROAD_MATCH = 4;</code>
     */
    const AI_MAX_BROAD_MATCH = 4;
    /**
     * The match is from a Dynamic Search Ad.
     *
     * Generated from protobuf enum <code>DYNAMIC_SEARCH_ADS = 5;</code>
     */
    const DYNAMIC_SEARCH_ADS = 5;
    /**
     * The match is from the search term matching functionality in PMax.
     *
     * Generated from protobuf enum <code>PERFORMANCE_MAX = 6;</code>
     */
    const PERFORMANCE_MAX = 6;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::ADVERTISER_PROVIDED_KEYWORD => 'ADVERTISER_PROVIDED_KEYWORD',
        self::AI_MAX_KEYWORDLESS => 'AI_MAX_KEYWORDLESS',
        self::AI_MAX_BROAD_MATCH => 'AI_MAX_BROAD_MATCH',
        self::DYNAMIC_SEARCH_ADS => 'DYNAMIC_SEARCH_ADS',
        self::PERFORMANCE_MAX => 'PERFORMANCE_MAX',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SearchTermMatchSource::class, \Google\Ads\GoogleAds\V21\Enums\SearchTermMatchSourceEnum_SearchTermMatchSource::class);

