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

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

use UnexpectedValueException;

/**
 * Enum describing possible experiment arm errors.
 *
 * Protobuf type <code>google.ads.googleads.v20.errors.ExperimentArmErrorEnum.ExperimentArmError</code>
 */
class ExperimentArmError
{
    /**
     * 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;
    /**
     * Number of experiment arms is above limit.
     *
     * Generated from protobuf enum <code>EXPERIMENT_ARM_COUNT_LIMIT_EXCEEDED = 2;</code>
     */
    const EXPERIMENT_ARM_COUNT_LIMIT_EXCEEDED = 2;
    /**
     * Cannot add campaign with invalid status to the experiment arm.
     *
     * Generated from protobuf enum <code>INVALID_CAMPAIGN_STATUS = 3;</code>
     */
    const INVALID_CAMPAIGN_STATUS = 3;
    /**
     * Cannot add duplicate experiment arm name in one experiment.
     *
     * Generated from protobuf enum <code>DUPLICATE_EXPERIMENT_ARM_NAME = 4;</code>
     */
    const DUPLICATE_EXPERIMENT_ARM_NAME = 4;
    /**
     * Cannot set campaigns of treatment experiment arm.
     *
     * Generated from protobuf enum <code>CANNOT_SET_TREATMENT_ARM_CAMPAIGN = 5;</code>
     */
    const CANNOT_SET_TREATMENT_ARM_CAMPAIGN = 5;
    /**
     * Cannot edit campaign ids in trial arms in non SETUP experiment.
     *
     * Generated from protobuf enum <code>CANNOT_MODIFY_CAMPAIGN_IDS = 6;</code>
     */
    const CANNOT_MODIFY_CAMPAIGN_IDS = 6;
    /**
     * Cannot modify the campaigns in the control arm
     * if there is not a suffix set in the trial.
     *
     * Generated from protobuf enum <code>CANNOT_MODIFY_CAMPAIGN_WITHOUT_SUFFIX_SET = 7;</code>
     */
    const CANNOT_MODIFY_CAMPAIGN_WITHOUT_SUFFIX_SET = 7;
    /**
     * Traffic split related settings (like traffic share bounds) can't be
     * modified after the trial has started.
     *
     * Generated from protobuf enum <code>CANNOT_MUTATE_TRAFFIC_SPLIT_AFTER_START = 8;</code>
     */
    const CANNOT_MUTATE_TRAFFIC_SPLIT_AFTER_START = 8;
    /**
     * Cannot use shared budget on experiment's control campaign.
     *
     * Generated from protobuf enum <code>CANNOT_ADD_CAMPAIGN_WITH_SHARED_BUDGET = 9;</code>
     */
    const CANNOT_ADD_CAMPAIGN_WITH_SHARED_BUDGET = 9;
    /**
     * Cannot use custom budget on experiment's control campaigns.
     *
     * Generated from protobuf enum <code>CANNOT_ADD_CAMPAIGN_WITH_CUSTOM_BUDGET = 10;</code>
     */
    const CANNOT_ADD_CAMPAIGN_WITH_CUSTOM_BUDGET = 10;
    /**
     * Cannot have enable_dynamic_assets turned on in experiment's campaigns.
     *
     * Generated from protobuf enum <code>CANNOT_ADD_CAMPAIGNS_WITH_DYNAMIC_ASSETS_ENABLED = 11;</code>
     */
    const CANNOT_ADD_CAMPAIGNS_WITH_DYNAMIC_ASSETS_ENABLED = 11;
    /**
     * Cannot use campaign's advertising channel sub type in experiment.
     *
     * Generated from protobuf enum <code>UNSUPPORTED_CAMPAIGN_ADVERTISING_CHANNEL_SUB_TYPE = 12;</code>
     */
    const UNSUPPORTED_CAMPAIGN_ADVERTISING_CHANNEL_SUB_TYPE = 12;
    /**
     * Experiment date range must be within base campaign's date range.
     *
     * Generated from protobuf enum <code>CANNOT_ADD_BASE_CAMPAIGN_WITH_DATE_RANGE = 13;</code>
     */
    const CANNOT_ADD_BASE_CAMPAIGN_WITH_DATE_RANGE = 13;
    /**
     * Bidding strategy is not supported in experiments.
     *
     * Generated from protobuf enum <code>BIDDING_STRATEGY_NOT_SUPPORTED_IN_EXPERIMENTS = 14;</code>
     */
    const BIDDING_STRATEGY_NOT_SUPPORTED_IN_EXPERIMENTS = 14;
    /**
     * Traffic split is not supported for some channel types.
     *
     * Generated from protobuf enum <code>TRAFFIC_SPLIT_NOT_SUPPORTED_FOR_CHANNEL_TYPE = 15;</code>
     */
    const TRAFFIC_SPLIT_NOT_SUPPORTED_FOR_CHANNEL_TYPE = 15;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::EXPERIMENT_ARM_COUNT_LIMIT_EXCEEDED => 'EXPERIMENT_ARM_COUNT_LIMIT_EXCEEDED',
        self::INVALID_CAMPAIGN_STATUS => 'INVALID_CAMPAIGN_STATUS',
        self::DUPLICATE_EXPERIMENT_ARM_NAME => 'DUPLICATE_EXPERIMENT_ARM_NAME',
        self::CANNOT_SET_TREATMENT_ARM_CAMPAIGN => 'CANNOT_SET_TREATMENT_ARM_CAMPAIGN',
        self::CANNOT_MODIFY_CAMPAIGN_IDS => 'CANNOT_MODIFY_CAMPAIGN_IDS',
        self::CANNOT_MODIFY_CAMPAIGN_WITHOUT_SUFFIX_SET => 'CANNOT_MODIFY_CAMPAIGN_WITHOUT_SUFFIX_SET',
        self::CANNOT_MUTATE_TRAFFIC_SPLIT_AFTER_START => 'CANNOT_MUTATE_TRAFFIC_SPLIT_AFTER_START',
        self::CANNOT_ADD_CAMPAIGN_WITH_SHARED_BUDGET => 'CANNOT_ADD_CAMPAIGN_WITH_SHARED_BUDGET',
        self::CANNOT_ADD_CAMPAIGN_WITH_CUSTOM_BUDGET => 'CANNOT_ADD_CAMPAIGN_WITH_CUSTOM_BUDGET',
        self::CANNOT_ADD_CAMPAIGNS_WITH_DYNAMIC_ASSETS_ENABLED => 'CANNOT_ADD_CAMPAIGNS_WITH_DYNAMIC_ASSETS_ENABLED',
        self::UNSUPPORTED_CAMPAIGN_ADVERTISING_CHANNEL_SUB_TYPE => 'UNSUPPORTED_CAMPAIGN_ADVERTISING_CHANNEL_SUB_TYPE',
        self::CANNOT_ADD_BASE_CAMPAIGN_WITH_DATE_RANGE => 'CANNOT_ADD_BASE_CAMPAIGN_WITH_DATE_RANGE',
        self::BIDDING_STRATEGY_NOT_SUPPORTED_IN_EXPERIMENTS => 'BIDDING_STRATEGY_NOT_SUPPORTED_IN_EXPERIMENTS',
        self::TRAFFIC_SPLIT_NOT_SUPPORTED_FOR_CHANNEL_TYPE => 'TRAFFIC_SPLIT_NOT_SUPPORTED_FOR_CHANNEL_TYPE',
    ];

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

