google.api.servicecontrol.v1.QuotaError.Code
*/
class Code
{
/**
* This is never used.
*
* Generated from protobuf enum UNSPECIFIED = 0;
*/
const UNSPECIFIED = 0;
/**
* Quota allocation failed.
* Same as [google.rpc.Code.RESOURCE_EXHAUSTED][].
*
* Generated from protobuf enum RESOURCE_EXHAUSTED = 8;
*/
const RESOURCE_EXHAUSTED = 8;
/**
* Consumer cannot access the service because the service requires active
* billing.
*
* Generated from protobuf enum BILLING_NOT_ACTIVE = 107;
*/
const BILLING_NOT_ACTIVE = 107;
/**
* Consumer's project has been marked as deleted (soft deletion).
*
* Generated from protobuf enum PROJECT_DELETED = 108;
*/
const PROJECT_DELETED = 108;
/**
* Specified API key is invalid.
*
* Generated from protobuf enum API_KEY_INVALID = 105;
*/
const API_KEY_INVALID = 105;
/**
* Specified API Key has expired.
*
* Generated from protobuf enum API_KEY_EXPIRED = 112;
*/
const API_KEY_EXPIRED = 112;
private static $valueToName = [
self::UNSPECIFIED => 'UNSPECIFIED',
self::RESOURCE_EXHAUSTED => 'RESOURCE_EXHAUSTED',
self::BILLING_NOT_ACTIVE => 'BILLING_NOT_ACTIVE',
self::PROJECT_DELETED => 'PROJECT_DELETED',
self::API_KEY_INVALID => 'API_KEY_INVALID',
self::API_KEY_EXPIRED => 'API_KEY_EXPIRED',
];
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(Code::class, \Google\Api\Servicecontrol\V1\QuotaError_Code::class);