proto library Client - Class Value (v5.36.2)

Reference documentation and code samples for the proto library Client class Value.

Represents a JSON value.

Value represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of these variants. Absence of any variant is an invalid state.

Generated from protobuf message google.protobuf.Value

Namespace

Google \ Protobuf

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ null_value int

Represents a JSON null.

↳ number_value float

Represents a JSON number. Must not be NaN, Infinity or -Infinity, since those are not supported in JSON. This also cannot represent large Int64 values, since JSON format generally does not support them in its number type.

↳ string_value string

Represents a JSON string.

↳ bool_value bool

Represents a JSON boolean (true or false literal in JSON).

↳ struct_value Struct

Represents a JSON object.

↳ list_value ListValue

Represents a JSON array.

getNullValue

Represents a JSON null.

Returns
Type Description
int Enum of type NullValue. one of the values in {@see \Google\Protobuf\NullValue}

hasNullValue

setNullValue

Represents a JSON null.

Parameter
Name Description
var int

Enum of type NullValue. one of the values in NullValue

Returns
Type Description
$this

getNumberValue

Represents a JSON number. Must not be NaN, Infinity or -Infinity, since those are not supported in JSON. This also cannot represent large Int64 values, since JSON format generally does not support them in its number type.

Returns
Type Description
float

hasNumberValue

setNumberValue

Represents a JSON number. Must not be NaN, Infinity or -Infinity, since those are not supported in JSON. This also cannot represent large Int64 values, since JSON format generally does not support them in its number type.

Parameter
Name Description
var float
Returns
Type Description
$this

getStringValue

Represents a JSON string.

Returns
Type Description
string

hasStringValue

setStringValue

Represents a JSON string.

Parameter
Name Description
var string
Returns
Type Description
$this

getBoolValue

Represents a JSON boolean (true or false literal in JSON).

Returns
Type Description
bool

hasBoolValue

setBoolValue

Represents a JSON boolean (true or false literal in JSON).

Parameter
Name Description
var bool
Returns
Type Description
$this

getStructValue

Represents a JSON object.

Returns
Type Description
Struct|null

hasStructValue

setStructValue

Represents a JSON object.

Parameter
Name Description
var Struct
Returns
Type Description
$this

getListValue

Represents a JSON array.

Returns
Type Description
ListValue|null

hasListValue

setListValue

Represents a JSON array.

Parameter
Name Description
var ListValue
Returns
Type Description
$this

getKind

Returns
Type Description
string