Class protos.google.api.Usage (1.1.4)

Represents a Usage.

Package

@google-cloud/service-usage!

Constructors

(constructor)(properties)

constructor(properties?: google.api.IUsage);

Constructs a new Usage.

Parameter
NameDescription
properties IUsage

Properties to set

Properties

producerNotificationChannel

public producerNotificationChannel: string;

Usage producerNotificationChannel.

Property Value
TypeDescription
string

requirements

public requirements: string[];

Usage requirements.

Property Value
TypeDescription
string[]

rules

public rules: google.api.IUsageRule[];

Usage rules.

Property Value
TypeDescription
google.api.IUsageRule[]

Methods

create(properties)

public static create(properties?: google.api.IUsage): google.api.Usage;

Creates a new Usage instance using the specified properties.

Parameter
NameDescription
properties IUsage

Properties to set

Returns
TypeDescription
google.api.Usage

Usage instance

decode(reader, length)

public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Usage;

Decodes a Usage message from the specified reader or buffer.

Parameters
NameDescription
reader ($protobuf.Reader|Uint8Array)

Reader or buffer to decode from

length number

Message length if known beforehand

Returns
TypeDescription
google.api.Usage

Usage

decodeDelimited(reader)

public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Usage;

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

Parameter
NameDescription
reader ($protobuf.Reader|Uint8Array)

Reader or buffer to decode from

Returns
TypeDescription
google.api.Usage

Usage

encode(message, writer)

public static encode(message: google.api.IUsage, writer?: $protobuf.Writer): $protobuf.Writer;

Encodes the specified Usage message. Does not implicitly messages.

Parameters
NameDescription
message IUsage

Usage message or plain object to encode

writer $protobuf.Writer

Writer to encode to

Returns
TypeDescription
$protobuf.Writer

Writer

encodeDelimited(message, writer)

public static encodeDelimited(message: google.api.IUsage, writer?: $protobuf.Writer): $protobuf.Writer;

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

Parameters
NameDescription
message IUsage

Usage message or plain object to encode

writer $protobuf.Writer

Writer to encode to

Returns
TypeDescription
$protobuf.Writer

Writer

fromObject(object)

public static fromObject(object: { [k: string]: any }): google.api.Usage;

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

Parameter
NameDescription
object { [k: string]: any }

Plain object

Returns
TypeDescription
google.api.Usage

Usage

toJSON()

public toJSON(): { [k: string]: any };

Converts this Usage to JSON.

Returns
TypeDescription
{ [k: string]: any }

JSON object

toObject(message, options)

public static toObject(message: google.api.Usage, options?: $protobuf.IConversionOptions): { [k: string]: any };

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

Parameters
NameDescription
message google.api.Usage

Usage

options $protobuf.IConversionOptions

Conversion options

Returns
TypeDescription
{ [k: string]: any }

Plain object

verify(message)

public static verify(message: { [k: string]: any }): (string|null);

Verifies a Usage message.

Parameter
NameDescription
message { [k: string]: any }

Plain object to verify

Returns
TypeDescription
(string|null)

null if valid, otherwise the reason why it is not