googleanalytics
/
lib
/
analytics-admin
/
vendor
/
google
/
common-protos
/
src
/
Cloud
/
OperationResponseMapping.php
googleanalytics
/
lib
/
analytics-admin
/
vendor
/
google
/
common-protos
/
src
/
Cloud
Last commit date
Iam
3 years ago
Location
3 years ago
Logging
3 years ago
OperationResponseMapping.php
3 years ago
OperationResponseMapping.php
87 lines
| 1 | <?php |
| 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! |
| 3 | # source: google/cloud/extended_operations.proto |
| 4 | |
| 5 | namespace Google\Cloud; |
| 6 | |
| 7 | use UnexpectedValueException; |
| 8 | |
| 9 | /** |
| 10 | * An enum to be used to mark the essential (for polling) fields in an |
| 11 | * API-specific Operation object. A custom Operation object may contain many |
| 12 | * different fields, but only few of them are essential to conduct a successful |
| 13 | * polling process. |
| 14 | * |
| 15 | * Protobuf type <code>google.cloud.OperationResponseMapping</code> |
| 16 | */ |
| 17 | class OperationResponseMapping |
| 18 | { |
| 19 | /** |
| 20 | * Do not use. |
| 21 | * |
| 22 | * Generated from protobuf enum <code>UNDEFINED = 0;</code> |
| 23 | */ |
| 24 | const UNDEFINED = 0; |
| 25 | /** |
| 26 | * A field in an API-specific (custom) Operation object which carries the same |
| 27 | * meaning as google.longrunning.Operation.name. |
| 28 | * |
| 29 | * Generated from protobuf enum <code>NAME = 1;</code> |
| 30 | */ |
| 31 | const NAME = 1; |
| 32 | /** |
| 33 | * A field in an API-specific (custom) Operation object which carries the same |
| 34 | * meaning as google.longrunning.Operation.done. If the annotated field is of |
| 35 | * an enum type, `annotated_field_name == EnumType.DONE` semantics should be |
| 36 | * equivalent to `Operation.done == true`. If the annotated field is of type |
| 37 | * boolean, then it should follow the same semantics as Operation.done. |
| 38 | * Otherwise, a non-empty value should be treated as `Operation.done == true`. |
| 39 | * |
| 40 | * Generated from protobuf enum <code>STATUS = 2;</code> |
| 41 | */ |
| 42 | const STATUS = 2; |
| 43 | /** |
| 44 | * A field in an API-specific (custom) Operation object which carries the same |
| 45 | * meaning as google.longrunning.Operation.error.code. |
| 46 | * |
| 47 | * Generated from protobuf enum <code>ERROR_CODE = 3;</code> |
| 48 | */ |
| 49 | const ERROR_CODE = 3; |
| 50 | /** |
| 51 | * A field in an API-specific (custom) Operation object which carries the same |
| 52 | * meaning as google.longrunning.Operation.error.message. |
| 53 | * |
| 54 | * Generated from protobuf enum <code>ERROR_MESSAGE = 4;</code> |
| 55 | */ |
| 56 | const ERROR_MESSAGE = 4; |
| 57 | |
| 58 | private static $valueToName = [ |
| 59 | self::UNDEFINED => 'UNDEFINED', |
| 60 | self::NAME => 'NAME', |
| 61 | self::STATUS => 'STATUS', |
| 62 | self::ERROR_CODE => 'ERROR_CODE', |
| 63 | self::ERROR_MESSAGE => 'ERROR_MESSAGE', |
| 64 | ]; |
| 65 | |
| 66 | public static function name($value) |
| 67 | { |
| 68 | if (!isset(self::$valueToName[$value])) { |
| 69 | throw new UnexpectedValueException(sprintf( |
| 70 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); |
| 71 | } |
| 72 | return self::$valueToName[$value]; |
| 73 | } |
| 74 | |
| 75 | |
| 76 | public static function value($name) |
| 77 | { |
| 78 | $const = __CLASS__ . '::' . strtoupper($name); |
| 79 | if (!defined($const)) { |
| 80 | throw new UnexpectedValueException(sprintf( |
| 81 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); |
| 82 | } |
| 83 | return constant($const); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 |