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

namespace Google\Ads\GoogleAds\V23\Enums\LocalServicesLeadCreditIssuanceDecisionEnum;

use UnexpectedValueException;

/**
 * Decision of bonus credit issued or rejected.
 *
 * Protobuf type <code>google.ads.googleads.v23.enums.LocalServicesLeadCreditIssuanceDecisionEnum.CreditIssuanceDecision</code>
 */
class CreditIssuanceDecision
{
    /**
     * 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;
    /**
     * Bonus credit is issued successfully and bonus credit cap has not reached
     * the threshold after issuing this bonus credit.
     *
     * Generated from protobuf enum <code>SUCCESS_NOT_REACHED_THRESHOLD = 2;</code>
     */
    const SUCCESS_NOT_REACHED_THRESHOLD = 2;
    /**
     * Bonus credit is issued successfully and bonus credit cap has reached the
     * threshold after issuing this bonus credit.
     *
     * Generated from protobuf enum <code>SUCCESS_REACHED_THRESHOLD = 3;</code>
     */
    const SUCCESS_REACHED_THRESHOLD = 3;
    /**
     * Bonus credit is not issued because the provider has reached the bonus
     * credit cap.
     *
     * Generated from protobuf enum <code>FAIL_OVER_THRESHOLD = 4;</code>
     */
    const FAIL_OVER_THRESHOLD = 4;
    /**
     * Bonus credit is not issued because this lead is not eligible for bonus
     * credit.
     *
     * Generated from protobuf enum <code>FAIL_NOT_ELIGIBLE = 5;</code>
     */
    const FAIL_NOT_ELIGIBLE = 5;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::SUCCESS_NOT_REACHED_THRESHOLD => 'SUCCESS_NOT_REACHED_THRESHOLD',
        self::SUCCESS_REACHED_THRESHOLD => 'SUCCESS_REACHED_THRESHOLD',
        self::FAIL_OVER_THRESHOLD => 'FAIL_OVER_THRESHOLD',
        self::FAIL_NOT_ELIGIBLE => 'FAIL_NOT_ELIGIBLE',
    ];

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

