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

namespace Google\Ads\GoogleAds\V22\Errors\CampaignGoalConfigErrorEnum;

use UnexpectedValueException;

/**
 * Enum describing possible campaign goal config errors.
 *
 * Protobuf type <code>google.ads.googleads.v22.errors.CampaignGoalConfigErrorEnum.CampaignGoalConfigError</code>
 */
class CampaignGoalConfigError
{
    /**
     * 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;
    /**
     * Goal is either removed or does not exist for this account.
     *
     * Generated from protobuf enum <code>GOAL_NOT_FOUND = 3;</code>
     */
    const GOAL_NOT_FOUND = 3;
    /**
     * Campaign is either removed or does not exist.
     *
     * Generated from protobuf enum <code>CAMPAIGN_NOT_FOUND = 4;</code>
     */
    const CAMPAIGN_NOT_FOUND = 4;
    /**
     * If high lifetime value is present then value should be present.
     *
     * Generated from protobuf enum <code>HIGH_LIFETIME_VALUE_PRESENT_BUT_VALUE_ABSENT = 9;</code>
     */
    const HIGH_LIFETIME_VALUE_PRESENT_BUT_VALUE_ABSENT = 9;
    /**
     * High lifetime value should be greater than value.
     *
     * Generated from protobuf enum <code>HIGH_LIFETIME_VALUE_LESS_THAN_OR_EQUAL_TO_VALUE = 10;</code>
     */
    const HIGH_LIFETIME_VALUE_LESS_THAN_OR_EQUAL_TO_VALUE = 10;
    /**
     * When using customer lifecycle optimization goal, campaign type should be
     * supported.
     *
     * Generated from protobuf enum <code>CUSTOMER_LIFECYCLE_OPTIMIZATION_CAMPAIGN_TYPE_NOT_SUPPORTED = 11;</code>
     */
    const CUSTOMER_LIFECYCLE_OPTIMIZATION_CAMPAIGN_TYPE_NOT_SUPPORTED = 11;
    /**
     * Customer must be allowlisted to use retention only goal.
     *
     * Generated from protobuf enum <code>CUSTOMER_NOT_ALLOWLISTED_FOR_RETENTION_ONLY = 12;</code>
     */
    const CUSTOMER_NOT_ALLOWLISTED_FOR_RETENTION_ONLY = 12;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::GOAL_NOT_FOUND => 'GOAL_NOT_FOUND',
        self::CAMPAIGN_NOT_FOUND => 'CAMPAIGN_NOT_FOUND',
        self::HIGH_LIFETIME_VALUE_PRESENT_BUT_VALUE_ABSENT => 'HIGH_LIFETIME_VALUE_PRESENT_BUT_VALUE_ABSENT',
        self::HIGH_LIFETIME_VALUE_LESS_THAN_OR_EQUAL_TO_VALUE => 'HIGH_LIFETIME_VALUE_LESS_THAN_OR_EQUAL_TO_VALUE',
        self::CUSTOMER_LIFECYCLE_OPTIMIZATION_CAMPAIGN_TYPE_NOT_SUPPORTED => 'CUSTOMER_LIFECYCLE_OPTIMIZATION_CAMPAIGN_TYPE_NOT_SUPPORTED',
        self::CUSTOMER_NOT_ALLOWLISTED_FOR_RETENTION_ONLY => 'CUSTOMER_NOT_ALLOWLISTED_FOR_RETENTION_ONLY',
    ];

    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(CampaignGoalConfigError::class, \Google\Ads\GoogleAds\V22\Errors\CampaignGoalConfigErrorEnum_CampaignGoalConfigError::class);

