Skip to main content

Class: Any

google.protobuf.Any

Represents an Any.

Implements

Constructors

constructor

new Any(properties?)

Constructs a new Any.

Parameters

NameTypeDescription
properties?IAnyProperties to set

Properties

type_url

type_url: string

Any type_url.

Implementation of

IAny.type_url


value

value: Uint8Array

Any value.

Implementation of

IAny.value

Methods

toJSON

toJSON(): Object

Converts this Any to JSON.

Returns

Object

JSON object


create

Static create(properties?): Any

Creates a new Any instance using the specified properties.

Parameters

NameTypeDescription
properties?IAnyProperties to set

Returns

Any

Any instance


decode

Static decode(reader, length?): Any

Decodes an Any message from the specified reader or buffer.

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing

Parameters

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

Returns

Any

Any


decodeDelimited

Static decodeDelimited(reader): Any

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

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Any

Any


encode

Static encode(message, writer?): Writer

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

Parameters

NameTypeDescription
messageIAnyAny message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

Static encodeDelimited(message, writer?): Writer

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

Parameters

NameTypeDescription
messageIAnyAny message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

Static 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


getTypeUrl

Static getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Any

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


toObject

Static 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