<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v20/errors/asset_group_signal_error.proto

namespace Google\Ads\GoogleAds\V20\Errors\AssetGroupSignalErrorEnum;

use UnexpectedValueException;

/**
 * Enum describing possible asset group signal errors.
 *
 * Protobuf type <code>google.ads.googleads.v20.errors.AssetGroupSignalErrorEnum.AssetGroupSignalError</code>
 */
class AssetGroupSignalError
{
    /**
     * Enum unspecified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * The received error code is not known in this version.
     *
     * Generated from protobuf enum <code>UNKNOWN = 1;</code>
     */
    const UNKNOWN = 1;
    /**
     * The number of words in the Search Theme signal exceed the allowed
     * maximum. You can add up to 10 words in a keyword. See
     * https://support.google.com/google-ads/answer/7476658 for details.
     *
     * Generated from protobuf enum <code>TOO_MANY_WORDS = 2;</code>
     */
    const TOO_MANY_WORDS = 2;
    /**
     * The search theme requested to be added violates certain policy.
     * See https://support.google.com/adspolicy/answer/6008942.
     *
     * Generated from protobuf enum <code>SEARCH_THEME_POLICY_VIOLATION = 3;</code>
     */
    const SEARCH_THEME_POLICY_VIOLATION = 3;
    /**
     * The asset group referenced by the asset group signal does not match the
     * asset group referenced by the audience being used in the asset group
     * signal.
     *
     * Generated from protobuf enum <code>AUDIENCE_WITH_WRONG_ASSET_GROUP_ID = 4;</code>
     */
    const AUDIENCE_WITH_WRONG_ASSET_GROUP_ID = 4;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::TOO_MANY_WORDS => 'TOO_MANY_WORDS',
        self::SEARCH_THEME_POLICY_VIOLATION => 'SEARCH_THEME_POLICY_VIOLATION',
        self::AUDIENCE_WITH_WRONG_ASSET_GROUP_ID => 'AUDIENCE_WITH_WRONG_ASSET_GROUP_ID',
    ];

    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(AssetGroupSignalError::class, \Google\Ads\GoogleAds\V20\Errors\AssetGroupSignalErrorEnum_AssetGroupSignalError::class);

