media-cloud-sync
/
includes
/
sdk
/
google
/
google
/
protobuf
/
src
/
Google
/
Protobuf
/
Value.php
Value.php in Media Cloud Sync 1.0.1, at includes/sdk/google/google/protobuf/src/Google/Protobuf/Value.php
| 1 | <?php |
| 2 | |
| 3 | # Generated by the protocol buffer compiler. DO NOT EDIT! |
| 4 | # source: google/protobuf/struct.proto |
| 5 | namespace Dudlewebs\WPMCS\Google\Protobuf; |
| 6 | |
| 7 | use Dudlewebs\WPMCS\Google\Protobuf\Internal\GPBType; |
| 8 | use Dudlewebs\WPMCS\Google\Protobuf\Internal\RepeatedField; |
| 9 | use Dudlewebs\WPMCS\Google\Protobuf\Internal\GPBUtil; |
| 10 | /** |
| 11 | * `Value` represents a dynamically typed value which can be either |
| 12 | * null, a number, a string, a boolean, a recursive struct value, or a |
| 13 | * list of values. A producer of value is expected to set one of these |
| 14 | * variants. Absence of any variant indicates an error. |
| 15 | * The JSON representation for `Value` is JSON value. |
| 16 | * |
| 17 | * Generated from protobuf message <code>google.protobuf.Value</code> |
| 18 | */ |
| 19 | class Value extends \Dudlewebs\WPMCS\Google\Protobuf\Internal\Message |
| 20 | { |
| 21 | protected $kind; |
| 22 | /** |
| 23 | * Constructor. |
| 24 | * |
| 25 | * @param array $data { |
| 26 | * Optional. Data for populating the Message object. |
| 27 | * |
| 28 | * @type int $null_value |
| 29 | * Represents a null value. |
| 30 | * @type float $number_value |
| 31 | * Represents a double value. |
| 32 | * @type string $string_value |
| 33 | * Represents a string value. |
| 34 | * @type bool $bool_value |
| 35 | * Represents a boolean value. |
| 36 | * @type \Google\Protobuf\Struct $struct_value |
| 37 | * Represents a structured value. |
| 38 | * @type \Google\Protobuf\ListValue $list_value |
| 39 | * Represents a repeated `Value`. |
| 40 | * } |
| 41 | */ |
| 42 | public function __construct($data = NULL) |
| 43 | { |
| 44 | \Dudlewebs\WPMCS\GPBMetadata\Google\Protobuf\Struct::initOnce(); |
| 45 | parent::__construct($data); |
| 46 | } |
| 47 | /** |
| 48 | * Represents a null value. |
| 49 | * |
| 50 | * Generated from protobuf field <code>.google.protobuf.NullValue null_value = 1;</code> |
| 51 | * @return int |
| 52 | */ |
| 53 | public function getNullValue() |
| 54 | { |
| 55 | return $this->readOneof(1); |
| 56 | } |
| 57 | public function hasNullValue() |
| 58 | { |
| 59 | return $this->hasOneof(1); |
| 60 | } |
| 61 | /** |
| 62 | * Represents a null value. |
| 63 | * |
| 64 | * Generated from protobuf field <code>.google.protobuf.NullValue null_value = 1;</code> |
| 65 | * @param int $var |
| 66 | * @return $this |
| 67 | */ |
| 68 | public function setNullValue($var) |
| 69 | { |
| 70 | GPBUtil::checkEnum($var, \Dudlewebs\WPMCS\Google\Protobuf\NullValue::class); |
| 71 | $this->writeOneof(1, $var); |
| 72 | return $this; |
| 73 | } |
| 74 | /** |
| 75 | * Represents a double value. |
| 76 | * |
| 77 | * Generated from protobuf field <code>double number_value = 2;</code> |
| 78 | * @return float |
| 79 | */ |
| 80 | public function getNumberValue() |
| 81 | { |
| 82 | return $this->readOneof(2); |
| 83 | } |
| 84 | public function hasNumberValue() |
| 85 | { |
| 86 | return $this->hasOneof(2); |
| 87 | } |
| 88 | /** |
| 89 | * Represents a double value. |
| 90 | * |
| 91 | * Generated from protobuf field <code>double number_value = 2;</code> |
| 92 | * @param float $var |
| 93 | * @return $this |
| 94 | */ |
| 95 | public function setNumberValue($var) |
| 96 | { |
| 97 | GPBUtil::checkDouble($var); |
| 98 | $this->writeOneof(2, $var); |
| 99 | return $this; |
| 100 | } |
| 101 | /** |
| 102 | * Represents a string value. |
| 103 | * |
| 104 | * Generated from protobuf field <code>string string_value = 3;</code> |
| 105 | * @return string |
| 106 | */ |
| 107 | public function getStringValue() |
| 108 | { |
| 109 | return $this->readOneof(3); |
| 110 | } |
| 111 | public function hasStringValue() |
| 112 | { |
| 113 | return $this->hasOneof(3); |
| 114 | } |
| 115 | /** |
| 116 | * Represents a string value. |
| 117 | * |
| 118 | * Generated from protobuf field <code>string string_value = 3;</code> |
| 119 | * @param string $var |
| 120 | * @return $this |
| 121 | */ |
| 122 | public function setStringValue($var) |
| 123 | { |
| 124 | GPBUtil::checkString($var, True); |
| 125 | $this->writeOneof(3, $var); |
| 126 | return $this; |
| 127 | } |
| 128 | /** |
| 129 | * Represents a boolean value. |
| 130 | * |
| 131 | * Generated from protobuf field <code>bool bool_value = 4;</code> |
| 132 | * @return bool |
| 133 | */ |
| 134 | public function getBoolValue() |
| 135 | { |
| 136 | return $this->readOneof(4); |
| 137 | } |
| 138 | public function hasBoolValue() |
| 139 | { |
| 140 | return $this->hasOneof(4); |
| 141 | } |
| 142 | /** |
| 143 | * Represents a boolean value. |
| 144 | * |
| 145 | * Generated from protobuf field <code>bool bool_value = 4;</code> |
| 146 | * @param bool $var |
| 147 | * @return $this |
| 148 | */ |
| 149 | public function setBoolValue($var) |
| 150 | { |
| 151 | GPBUtil::checkBool($var); |
| 152 | $this->writeOneof(4, $var); |
| 153 | return $this; |
| 154 | } |
| 155 | /** |
| 156 | * Represents a structured value. |
| 157 | * |
| 158 | * Generated from protobuf field <code>.google.protobuf.Struct struct_value = 5;</code> |
| 159 | * @return \Google\Protobuf\Struct|null |
| 160 | */ |
| 161 | public function getStructValue() |
| 162 | { |
| 163 | return $this->readOneof(5); |
| 164 | } |
| 165 | public function hasStructValue() |
| 166 | { |
| 167 | return $this->hasOneof(5); |
| 168 | } |
| 169 | /** |
| 170 | * Represents a structured value. |
| 171 | * |
| 172 | * Generated from protobuf field <code>.google.protobuf.Struct struct_value = 5;</code> |
| 173 | * @param \Google\Protobuf\Struct $var |
| 174 | * @return $this |
| 175 | */ |
| 176 | public function setStructValue($var) |
| 177 | { |
| 178 | GPBUtil::checkMessage($var, \Dudlewebs\WPMCS\Google\Protobuf\Struct::class); |
| 179 | $this->writeOneof(5, $var); |
| 180 | return $this; |
| 181 | } |
| 182 | /** |
| 183 | * Represents a repeated `Value`. |
| 184 | * |
| 185 | * Generated from protobuf field <code>.google.protobuf.ListValue list_value = 6;</code> |
| 186 | * @return \Google\Protobuf\ListValue|null |
| 187 | */ |
| 188 | public function getListValue() |
| 189 | { |
| 190 | return $this->readOneof(6); |
| 191 | } |
| 192 | public function hasListValue() |
| 193 | { |
| 194 | return $this->hasOneof(6); |
| 195 | } |
| 196 | /** |
| 197 | * Represents a repeated `Value`. |
| 198 | * |
| 199 | * Generated from protobuf field <code>.google.protobuf.ListValue list_value = 6;</code> |
| 200 | * @param \Google\Protobuf\ListValue $var |
| 201 | * @return $this |
| 202 | */ |
| 203 | public function setListValue($var) |
| 204 | { |
| 205 | GPBUtil::checkMessage($var, \Dudlewebs\WPMCS\Google\Protobuf\ListValue::class); |
| 206 | $this->writeOneof(6, $var); |
| 207 | return $this; |
| 208 | } |
| 209 | /** |
| 210 | * @return string |
| 211 | */ |
| 212 | public function getKind() |
| 213 | { |
| 214 | return $this->whichOneof("kind"); |
| 215 | } |
| 216 | } |
| 217 |