google.cloud.OperationResponseMapping
*/
class OperationResponseMapping
{
/**
* Do not use.
*
* Generated from protobuf enum UNDEFINED = 0;
*/
const UNDEFINED = 0;
/**
* A field in an API-specific (custom) Operation object which carries the same
* meaning as google.longrunning.Operation.name.
*
* Generated from protobuf enum NAME = 1;
*/
const NAME = 1;
/**
* A field in an API-specific (custom) Operation object which carries the same
* meaning as google.longrunning.Operation.done. If the annotated field is of
* an enum type, `annotated_field_name == EnumType.DONE` semantics should be
* equivalent to `Operation.done == true`. If the annotated field is of type
* boolean, then it should follow the same semantics as Operation.done.
* Otherwise, a non-empty value should be treated as `Operation.done == true`.
*
* Generated from protobuf enum STATUS = 2;
*/
const STATUS = 2;
/**
* A field in an API-specific (custom) Operation object which carries the same
* meaning as google.longrunning.Operation.error.code.
*
* Generated from protobuf enum ERROR_CODE = 3;
*/
const ERROR_CODE = 3;
/**
* A field in an API-specific (custom) Operation object which carries the same
* meaning as google.longrunning.Operation.error.message.
*
* Generated from protobuf enum ERROR_MESSAGE = 4;
*/
const ERROR_MESSAGE = 4;
private static $valueToName = [self::UNDEFINED => 'UNDEFINED', self::NAME => 'NAME', self::STATUS => 'STATUS', self::ERROR_CODE => 'ERROR_CODE', self::ERROR_MESSAGE => 'ERROR_MESSAGE'];
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);
}
}