blob: dcc0bdf7c4297c5c39a0e489c8fb6db2c50d9d52 [file] [log] [blame]
Paul Yang77f64bb2017-10-05 21:03:57 -07001<?php
2# Generated by the protocol buffer compiler. DO NOT EDIT!
3# source: google/protobuf/struct.proto
4
5namespace Google\Protobuf;
6
7use Google\Protobuf\Internal\GPBType;
8use Google\Protobuf\Internal\RepeatedField;
9use Google\Protobuf\Internal\GPBUtil;
10
11/**
12 * `Value` represents a dynamically typed value which can be either
13 * null, a number, a string, a boolean, a recursive struct value, or a
Joshua Habermane5c570b2021-09-09 08:21:42 -070014 * list of values. A producer of value is expected to set one of these
15 * variants. Absence of any variant indicates an error.
Paul Yang77f64bb2017-10-05 21:03:57 -070016 * The JSON representation for `Value` is JSON value.
17 *
18 * Generated from protobuf message <code>google.protobuf.Value</code>
19 */
20class Value extends \Google\Protobuf\Internal\Message
21{
22 protected $kind;
23
Brent Shaffer67379542018-05-23 16:43:30 -070024 /**
25 * Constructor.
26 *
27 * @param array $data {
28 * Optional. Data for populating the Message object.
29 *
30 * @type int $null_value
31 * Represents a null value.
32 * @type float $number_value
33 * Represents a double value.
34 * @type string $string_value
35 * Represents a string value.
36 * @type bool $bool_value
37 * Represents a boolean value.
38 * @type \Google\Protobuf\Struct $struct_value
39 * Represents a structured value.
40 * @type \Google\Protobuf\ListValue $list_value
41 * Represents a repeated `Value`.
42 * }
43 */
44 public function __construct($data = NULL) {
Paul Yang77f64bb2017-10-05 21:03:57 -070045 \GPBMetadata\Google\Protobuf\Struct::initOnce();
Brent Shaffer67379542018-05-23 16:43:30 -070046 parent::__construct($data);
Paul Yang77f64bb2017-10-05 21:03:57 -070047 }
48
49 /**
50 * Represents a null value.
51 *
52 * Generated from protobuf field <code>.google.protobuf.NullValue null_value = 1;</code>
53 * @return int
54 */
55 public function getNullValue()
56 {
57 return $this->readOneof(1);
58 }
59
Joshua Habermanad5a2152020-07-17 13:49:23 -070060 public function hasNullValue()
61 {
62 return $this->hasOneof(1);
63 }
64
Paul Yang77f64bb2017-10-05 21:03:57 -070065 /**
66 * Represents a null value.
67 *
68 * Generated from protobuf field <code>.google.protobuf.NullValue null_value = 1;</code>
69 * @param int $var
70 * @return $this
71 */
72 public function setNullValue($var)
73 {
74 GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class);
75 $this->writeOneof(1, $var);
76
77 return $this;
78 }
79
80 /**
81 * Represents a double value.
82 *
83 * Generated from protobuf field <code>double number_value = 2;</code>
84 * @return float
85 */
86 public function getNumberValue()
87 {
88 return $this->readOneof(2);
89 }
90
Joshua Habermanad5a2152020-07-17 13:49:23 -070091 public function hasNumberValue()
92 {
93 return $this->hasOneof(2);
94 }
95
Paul Yang77f64bb2017-10-05 21:03:57 -070096 /**
97 * Represents a double value.
98 *
99 * Generated from protobuf field <code>double number_value = 2;</code>
100 * @param float $var
101 * @return $this
102 */
103 public function setNumberValue($var)
104 {
105 GPBUtil::checkDouble($var);
106 $this->writeOneof(2, $var);
107
108 return $this;
109 }
110
111 /**
112 * Represents a string value.
113 *
114 * Generated from protobuf field <code>string string_value = 3;</code>
115 * @return string
116 */
117 public function getStringValue()
118 {
119 return $this->readOneof(3);
120 }
121
Joshua Habermanad5a2152020-07-17 13:49:23 -0700122 public function hasStringValue()
123 {
124 return $this->hasOneof(3);
125 }
126
Paul Yang77f64bb2017-10-05 21:03:57 -0700127 /**
128 * Represents a string value.
129 *
130 * Generated from protobuf field <code>string string_value = 3;</code>
131 * @param string $var
132 * @return $this
133 */
134 public function setStringValue($var)
135 {
136 GPBUtil::checkString($var, True);
137 $this->writeOneof(3, $var);
138
139 return $this;
140 }
141
142 /**
143 * Represents a boolean value.
144 *
145 * Generated from protobuf field <code>bool bool_value = 4;</code>
146 * @return bool
147 */
148 public function getBoolValue()
149 {
150 return $this->readOneof(4);
151 }
152
Joshua Habermanad5a2152020-07-17 13:49:23 -0700153 public function hasBoolValue()
154 {
155 return $this->hasOneof(4);
156 }
157
Paul Yang77f64bb2017-10-05 21:03:57 -0700158 /**
159 * Represents a boolean value.
160 *
161 * Generated from protobuf field <code>bool bool_value = 4;</code>
162 * @param bool $var
163 * @return $this
164 */
165 public function setBoolValue($var)
166 {
167 GPBUtil::checkBool($var);
168 $this->writeOneof(4, $var);
169
170 return $this;
171 }
172
173 /**
174 * Represents a structured value.
175 *
176 * Generated from protobuf field <code>.google.protobuf.Struct struct_value = 5;</code>
Joshua Haberman7089ff02021-01-07 14:58:38 -0800177 * @return \Google\Protobuf\Struct|null
Paul Yang77f64bb2017-10-05 21:03:57 -0700178 */
179 public function getStructValue()
180 {
181 return $this->readOneof(5);
182 }
183
Joshua Habermanad5a2152020-07-17 13:49:23 -0700184 public function hasStructValue()
185 {
186 return $this->hasOneof(5);
187 }
188
Paul Yang77f64bb2017-10-05 21:03:57 -0700189 /**
190 * Represents a structured value.
191 *
192 * Generated from protobuf field <code>.google.protobuf.Struct struct_value = 5;</code>
193 * @param \Google\Protobuf\Struct $var
194 * @return $this
195 */
196 public function setStructValue($var)
197 {
198 GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
199 $this->writeOneof(5, $var);
200
201 return $this;
202 }
203
204 /**
205 * Represents a repeated `Value`.
206 *
207 * Generated from protobuf field <code>.google.protobuf.ListValue list_value = 6;</code>
Joshua Haberman7089ff02021-01-07 14:58:38 -0800208 * @return \Google\Protobuf\ListValue|null
Paul Yang77f64bb2017-10-05 21:03:57 -0700209 */
210 public function getListValue()
211 {
212 return $this->readOneof(6);
213 }
214
Joshua Habermanad5a2152020-07-17 13:49:23 -0700215 public function hasListValue()
216 {
217 return $this->hasOneof(6);
218 }
219
Paul Yang77f64bb2017-10-05 21:03:57 -0700220 /**
221 * Represents a repeated `Value`.
222 *
223 * Generated from protobuf field <code>.google.protobuf.ListValue list_value = 6;</code>
224 * @param \Google\Protobuf\ListValue $var
225 * @return $this
226 */
227 public function setListValue($var)
228 {
229 GPBUtil::checkMessage($var, \Google\Protobuf\ListValue::class);
230 $this->writeOneof(6, $var);
231
232 return $this;
233 }
234
235 /**
236 * @return string
237 */
238 public function getKind()
239 {
240 return $this->whichOneof("kind");
241 }
242
243}
244