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

namespace Google\Ads\GoogleAds\V24\Enums\IncentiveStateEnum;

use UnexpectedValueException;

/**
 * The possible states of a redeemed incentive.
 *
 * Protobuf type <code>google.ads.googleads.v24.enums.IncentiveStateEnum.IncentiveState</code>
 */
class IncentiveState
{
    /**
     * 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 incentive has been redeemed but the requirements are not yet met.
     *
     * Generated from protobuf enum <code>REDEEMED = 2;</code>
     */
    const REDEEMED = 2;
    /**
     * The incentive's requirements have been met but the reward has not yet
     * been granted.
     *
     * Generated from protobuf enum <code>FULFILLED = 3;</code>
     */
    const FULFILLED = 3;
    /**
     * The reward for the incentive has been granted.
     *
     * Generated from protobuf enum <code>REWARD_GRANTED = 4;</code>
     */
    const REWARD_GRANTED = 4;
    /**
     * The incentive expired before the requirements were met.
     *
     * Generated from protobuf enum <code>EXPIRED = 5;</code>
     */
    const EXPIRED = 5;
    /**
     * The granted reward has expired.
     *
     * Generated from protobuf enum <code>REWARD_EXPIRED = 6;</code>
     */
    const REWARD_EXPIRED = 6;
    /**
     * The incentive was marked as invalid after redemption.
     *
     * Generated from protobuf enum <code>INVALIDATED = 7;</code>
     */
    const INVALIDATED = 7;
    /**
     * The granted reward has been fully used.
     *
     * Generated from protobuf enum <code>REWARD_EXHAUSTED = 8;</code>
     */
    const REWARD_EXHAUSTED = 8;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::REDEEMED => 'REDEEMED',
        self::FULFILLED => 'FULFILLED',
        self::REWARD_GRANTED => 'REWARD_GRANTED',
        self::EXPIRED => 'EXPIRED',
        self::REWARD_EXPIRED => 'REWARD_EXPIRED',
        self::INVALIDATED => 'INVALIDATED',
        self::REWARD_EXHAUSTED => 'REWARD_EXHAUSTED',
    ];

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

