| 1 |
<?php |
| 2 |
|
| 3 |
# Generated by the protocol buffer compiler. DO NOT EDIT! |
| 4 |
# source: google/api/field_behavior.proto |
| 5 |
namespace Dudlewebs\WPMCS\Google\Api; |
| 6 |
|
| 7 |
use UnexpectedValueException; |
| 8 |
/** |
| 9 |
* An indicator of the behavior of a given field (for example, that a field |
| 10 |
* is required in requests, or given as output but ignored as input). |
| 11 |
* This **does not** change the behavior in protocol buffers itself; it only |
| 12 |
* denotes the behavior and may affect how API tooling handles the field. |
| 13 |
* Note: This enum **may** receive new values in the future. |
| 14 |
* |
| 15 |
* Protobuf type <code>google.api.FieldBehavior</code> |
| 16 |
*/ |
| 17 |
class FieldBehavior |
| 18 |
{ |
| 19 |
/** |
| 20 |
* Conventional default for enums. Do not use this. |
| 21 |
* |
| 22 |
* Generated from protobuf enum <code>FIELD_BEHAVIOR_UNSPECIFIED = 0;</code> |
| 23 |
*/ |
| 24 |
const FIELD_BEHAVIOR_UNSPECIFIED = 0; |
| 25 |
/** |
| 26 |
* Specifically denotes a field as optional. |
| 27 |
* While all fields in protocol buffers are optional, this may be specified |
| 28 |
* for emphasis if appropriate. |
| 29 |
* |
| 30 |
* Generated from protobuf enum <code>OPTIONAL = 1;</code> |
| 31 |
*/ |
| 32 |
const OPTIONAL = 1; |
| 33 |
/** |
| 34 |
* Denotes a field as required. |
| 35 |
* This indicates that the field **must** be provided as part of the request, |
| 36 |
* and failure to do so will cause an error (usually `INVALID_ARGUMENT`). |
| 37 |
* |
| 38 |
* Generated from protobuf enum <code>REQUIRED = 2;</code> |
| 39 |
*/ |
| 40 |
const REQUIRED = 2; |
| 41 |
/** |
| 42 |
* Denotes a field as output only. |
| 43 |
* This indicates that the field is provided in responses, but including the |
| 44 |
* field in a request does nothing (the server *must* ignore it and |
| 45 |
* *must not* throw an error as a result of the field's presence). |
| 46 |
* |
| 47 |
* Generated from protobuf enum <code>OUTPUT_ONLY = 3;</code> |
| 48 |
*/ |
| 49 |
const OUTPUT_ONLY = 3; |
| 50 |
/** |
| 51 |
* Denotes a field as input only. |
| 52 |
* This indicates that the field is provided in requests, and the |
| 53 |
* corresponding field is not included in output. |
| 54 |
* |
| 55 |
* Generated from protobuf enum <code>INPUT_ONLY = 4;</code> |
| 56 |
*/ |
| 57 |
const INPUT_ONLY = 4; |
| 58 |
/** |
| 59 |
* Denotes a field as immutable. |
| 60 |
* This indicates that the field may be set once in a request to create a |
| 61 |
* resource, but may not be changed thereafter. |
| 62 |
* |
| 63 |
* Generated from protobuf enum <code>IMMUTABLE = 5;</code> |
| 64 |
*/ |
| 65 |
const IMMUTABLE = 5; |
| 66 |
/** |
| 67 |
* Denotes that a (repeated) field is an unordered list. |
| 68 |
* This indicates that the service may provide the elements of the list |
| 69 |
* in any arbitrary order, rather than the order the user originally |
| 70 |
* provided. Additionally, the list's order may or may not be stable. |
| 71 |
* |
| 72 |
* Generated from protobuf enum <code>UNORDERED_LIST = 6;</code> |
| 73 |
*/ |
| 74 |
const UNORDERED_LIST = 6; |
| 75 |
/** |
| 76 |
* Denotes that this field returns a non-empty default value if not set. |
| 77 |
* This indicates that if the user provides the empty value in a request, |
| 78 |
* a non-empty value will be returned. The user will not be aware of what |
| 79 |
* non-empty value to expect. |
| 80 |
* |
| 81 |
* Generated from protobuf enum <code>NON_EMPTY_DEFAULT = 7;</code> |
| 82 |
*/ |
| 83 |
const NON_EMPTY_DEFAULT = 7; |
| 84 |
/** |
| 85 |
* Denotes that the field in a resource (a message annotated with |
| 86 |
* google.api.resource) is used in the resource name to uniquely identify the |
| 87 |
* resource. For AIP-compliant APIs, this should only be applied to the |
| 88 |
* `name` field on the resource. |
| 89 |
* This behavior should not be applied to references to other resources within |
| 90 |
* the message. |
| 91 |
* The identifier field of resources often have different field behavior |
| 92 |
* depending on the request it is embedded in (e.g. for Create methods name |
| 93 |
* is optional and unused, while for Update methods it is required). Instead |
| 94 |
* of method-specific annotations, only `IDENTIFIER` is required. |
| 95 |
* |
| 96 |
* Generated from protobuf enum <code>IDENTIFIER = 8;</code> |
| 97 |
*/ |
| 98 |
const IDENTIFIER = 8; |
| 99 |
private static $valueToName = [self::FIELD_BEHAVIOR_UNSPECIFIED => 'FIELD_BEHAVIOR_UNSPECIFIED', self::OPTIONAL => 'OPTIONAL', self::REQUIRED => 'REQUIRED', self::OUTPUT_ONLY => 'OUTPUT_ONLY', self::INPUT_ONLY => 'INPUT_ONLY', self::IMMUTABLE => 'IMMUTABLE', self::UNORDERED_LIST => 'UNORDERED_LIST', self::NON_EMPTY_DEFAULT => 'NON_EMPTY_DEFAULT', self::IDENTIFIER => 'IDENTIFIER']; |
| 100 |
public static function name($value) |
| 101 |
{ |
| 102 |
if (!isset(self::$valueToName[$value])) { |
| 103 |
throw new UnexpectedValueException(sprintf('Enum %s has no name defined for value %s', __CLASS__, $value)); |
| 104 |
} |
| 105 |
return self::$valueToName[$value]; |
| 106 |
} |
| 107 |
public static function value($name) |
| 108 |
{ |
| 109 |
$const = __CLASS__ . '::' . strtoupper($name); |
| 110 |
if (!defined($const)) { |
| 111 |
throw new UnexpectedValueException(sprintf('Enum %s has no value defined for name %s', __CLASS__, $name)); |
| 112 |
} |
| 113 |
return constant($const); |
| 114 |
} |
| 115 |
} |
| 116 |
|