Skip to main content

Class: Any

google.protobuf.Any

Represents an Any.

Properties

type_url

type_url: string

Any type_url.


value

value: Uint8Array

Any value.

Methods

toJSON

toJSON(): Object

Converts this Any to JSON.

Returns

Object

JSON object


create

create(properties?): Any & $Properties

Creates a new Any instance using the specified properties.

Parameters

NameTypeDescription
properties?$PropertiesProperties to set

Returns

Any & $Properties

Any instance

create(properties?): Any

Parameters

NameType
properties?$Properties

Returns

Any


decode

decode(reader, length?): Any & $Properties

Decodes an Any message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

Any & $Properties

Any

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): Any & $Properties

Decodes an Any message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Any & $Properties

Any

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode

encode(message, writer?): Writer

Encodes the specified Any message. Does not implicitly google.protobuf.Any.verify|verify messages.

Parameters

NameTypeDescription
message$PropertiesAny message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified Any message, length delimited. Does not implicitly google.protobuf.Any.verify|verify messages.

Parameters

NameTypeDescription
message$PropertiesAny message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): Any

Creates an Any message from a plain object. Also converts values to their respective internal types.

Parameters

NameTypeDescription
objectObjectPlain object

Returns

Any

Any


toObject

toObject(message, options?): Object

Creates a plain object from an Any message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageAnyAny
options?IConversionOptionsConversion options

Returns

Object

Plain object