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

namespace Google\Ads\GoogleAds\V21\Errors\FinalUrlExpansionAssetViewErrorEnum;

use UnexpectedValueException;

/**
 * Enum describing possible final url expansion asset view errors.
 *
 * Protobuf type <code>google.ads.googleads.v21.errors.FinalUrlExpansionAssetViewErrorEnum.FinalUrlExpansionAssetViewError</code>
 */
class FinalUrlExpansionAssetViewError
{
    /**
     * Name 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;
    /**
     * At least one required filter has to be applied in the query.
     *
     * Generated from protobuf enum <code>MISSING_REQUIRED_FILTER = 2;</code>
     */
    const MISSING_REQUIRED_FILTER = 2;
    /**
     * Advertising channel type filter is required.
     *
     * Generated from protobuf enum <code>REQUIRES_ADVERTISING_CHANNEL_TYPE_FILTER = 3;</code>
     */
    const REQUIRES_ADVERTISING_CHANNEL_TYPE_FILTER = 3;
    /**
     * Advertising channel type filter has an invalid value.
     *
     * Generated from protobuf enum <code>INVALID_ADVERTISING_CHANNEL_TYPE_IN_FILTER = 4;</code>
     */
    const INVALID_ADVERTISING_CHANNEL_TYPE_IN_FILTER = 4;
    /**
     * Asset group cannot be selected in the query.
     *
     * Generated from protobuf enum <code>CANNOT_SELECT_ASSET_GROUP = 5;</code>
     */
    const CANNOT_SELECT_ASSET_GROUP = 5;
    /**
     * Ad group cannot be selected in the query.
     *
     * Generated from protobuf enum <code>CANNOT_SELECT_AD_GROUP = 6;</code>
     */
    const CANNOT_SELECT_AD_GROUP = 6;
    /**
     * A selected field/resource requires filtering by a single resource.
     *
     * Generated from protobuf enum <code>REQUIRES_FILTER_BY_SINGLE_RESOURCE = 7;</code>
     */
    const REQUIRES_FILTER_BY_SINGLE_RESOURCE = 7;
    /**
     * Both ad group and asset group cannot be selected in the query.
     *
     * Generated from protobuf enum <code>CANNOT_SELECT_BOTH_AD_GROUP_AND_ASSET_GROUP = 8;</code>
     */
    const CANNOT_SELECT_BOTH_AD_GROUP_AND_ASSET_GROUP = 8;
    /**
     * Both ad group and asset group cannot be filtered in the query.
     *
     * Generated from protobuf enum <code>CANNOT_FILTER_BY_BOTH_AD_GROUP_AND_ASSET_GROUP = 9;</code>
     */
    const CANNOT_FILTER_BY_BOTH_AD_GROUP_AND_ASSET_GROUP = 9;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::MISSING_REQUIRED_FILTER => 'MISSING_REQUIRED_FILTER',
        self::REQUIRES_ADVERTISING_CHANNEL_TYPE_FILTER => 'REQUIRES_ADVERTISING_CHANNEL_TYPE_FILTER',
        self::INVALID_ADVERTISING_CHANNEL_TYPE_IN_FILTER => 'INVALID_ADVERTISING_CHANNEL_TYPE_IN_FILTER',
        self::CANNOT_SELECT_ASSET_GROUP => 'CANNOT_SELECT_ASSET_GROUP',
        self::CANNOT_SELECT_AD_GROUP => 'CANNOT_SELECT_AD_GROUP',
        self::REQUIRES_FILTER_BY_SINGLE_RESOURCE => 'REQUIRES_FILTER_BY_SINGLE_RESOURCE',
        self::CANNOT_SELECT_BOTH_AD_GROUP_AND_ASSET_GROUP => 'CANNOT_SELECT_BOTH_AD_GROUP_AND_ASSET_GROUP',
        self::CANNOT_FILTER_BY_BOTH_AD_GROUP_AND_ASSET_GROUP => 'CANNOT_FILTER_BY_BOTH_AD_GROUP_AND_ASSET_GROUP',
    ];

    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(FinalUrlExpansionAssetViewError::class, \Google\Ads\GoogleAds\V21\Errors\FinalUrlExpansionAssetViewErrorEnum_FinalUrlExpansionAssetViewError::class);

