Skip to main content

Class: Method

protocol.Method

Represents a Method.

Implements

Constructors

constructor

new Method(properties?): Method

Constructs a new Method.

Parameters

NameTypeDescription
properties?IMethodProperties to set

Returns

Method

Properties

name

name: string

Method name.

Implementation of

IMethod.name


payload

payload: string

Method payload.

Implementation of

IMethod.payload

Methods

create

create(properties?): Method

Creates a new Method instance using the specified properties.

Parameters

NameTypeDescription
properties?IMethodProperties to set

Returns

Method

Method instance


decode

decode(reader, length?): Method

Decodes a Method message from the specified reader or buffer.

Parameters

NameTypeDescription
readerReader | Uint8ArrayReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

Method

Method

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): Method

Decodes a Method message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerReader | Uint8ArrayReader or buffer to decode from

Returns

Method

Method

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 Method message. Does not implicitly verify messages.

Parameters

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

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified Method message, length delimited. Does not implicitly verify messages.

Parameters

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

Returns

Writer

Writer


fromObject

fromObject(object): Method

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

Parameters

NameTypeDescription
objectObjectPlain object

Returns

Method

Method


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Method

Parameters

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

Returns

string

The default type url


toJSON

toJSON(): Object

Converts this Method to JSON.

Returns

Object

JSON object


toObject

toObject(message, options?): Object

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

Parameters

NameTypeDescription
messageMethodMethod
options?IConversionOptionsConversion options

Returns

Object

Plain object


verify

verify(message): string

Verifies a Method message.

Parameters

NameTypeDescription
messageObjectPlain object to verify

Returns

string

null if valid, otherwise the reason why it is not