<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/channel/v1/entitlements.proto

namespace Google\Cloud\Channel\V1\TransferEligibility;

use UnexpectedValueException;

/**
 * Reason of ineligibility.
 *
 * Protobuf type <code>google.cloud.channel.v1.TransferEligibility.Reason</code>
 */
class Reason
{
    /**
     * Not used.
     *
     * Generated from protobuf enum <code>REASON_UNSPECIFIED = 0;</code>
     */
    const REASON_UNSPECIFIED = 0;
    /**
     * Reseller needs to accept TOS before transferring the SKU.
     *
     * Generated from protobuf enum <code>PENDING_TOS_ACCEPTANCE = 1;</code>
     */
    const PENDING_TOS_ACCEPTANCE = 1;
    /**
     * Reseller not eligible to sell the SKU.
     *
     * Generated from protobuf enum <code>SKU_NOT_ELIGIBLE = 2;</code>
     */
    const SKU_NOT_ELIGIBLE = 2;
    /**
     * SKU subscription is suspended
     *
     * Generated from protobuf enum <code>SKU_SUSPENDED = 3;</code>
     */
    const SKU_SUSPENDED = 3;

    private static $valueToName = [
        self::REASON_UNSPECIFIED => 'REASON_UNSPECIFIED',
        self::PENDING_TOS_ACCEPTANCE => 'PENDING_TOS_ACCEPTANCE',
        self::SKU_NOT_ELIGIBLE => 'SKU_NOT_ELIGIBLE',
        self::SKU_SUSPENDED => 'SKU_SUSPENDED',
    ];

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


