Class protos.google.pubsub.v1.Subscription (2.18.3)

Represents a Subscription.

Package

@google-cloud/pubsub

Constructors

(constructor)(properties)

constructor(properties?: google.pubsub.v1.ISubscription);

Constructs a new Subscription.

Parameter
NameDescription
properties google.pubsub.v1.ISubscription

Properties to set

Properties

ackDeadlineSeconds

public ackDeadlineSeconds: number;

Subscription ackDeadlineSeconds.

Property Value
TypeDescription
number

deadLetterPolicy

public deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null);

Subscription deadLetterPolicy.

Property Value
TypeDescription
(google.pubsub.v1.IDeadLetterPolicy|null)

detached

public detached: boolean;

Subscription detached.

Property Value
TypeDescription
boolean

enableMessageOrdering

public enableMessageOrdering: boolean;

Subscription enableMessageOrdering.

Property Value
TypeDescription
boolean

expirationPolicy

public expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null);

Subscription expirationPolicy.

Property Value
TypeDescription
(google.pubsub.v1.IExpirationPolicy|null)

filter

public filter: string;

Subscription filter.

Property Value
TypeDescription
string

labels

public labels: { [k: string]: string };

Subscription labels.

Property Value
TypeDescription
{ [k: string]: string }

messageRetentionDuration

public messageRetentionDuration?: (google.protobuf.IDuration|null);

Subscription messageRetentionDuration.

Property Value
TypeDescription
(google.protobuf.IDuration|null)

name

public name: string;

Subscription name.

Property Value
TypeDescription
string

pushConfig

public pushConfig?: (google.pubsub.v1.IPushConfig|null);

Subscription pushConfig.

Property Value
TypeDescription
(google.pubsub.v1.IPushConfig|null)

retainAckedMessages

public retainAckedMessages: boolean;

Subscription retainAckedMessages.

Property Value
TypeDescription
boolean

retryPolicy

public retryPolicy?: (google.pubsub.v1.IRetryPolicy|null);

Subscription retryPolicy.

Property Value
TypeDescription
(google.pubsub.v1.IRetryPolicy|null)

topic

public topic: string;

Subscription topic.

Property Value
TypeDescription
string

topicMessageRetentionDuration

public topicMessageRetentionDuration?: (google.protobuf.IDuration|null);

Subscription topicMessageRetentionDuration.

Property Value
TypeDescription
(google.protobuf.IDuration|null)

Methods

create(properties)

public static create(properties?: google.pubsub.v1.ISubscription): google.pubsub.v1.Subscription;

Creates a new Subscription instance using the specified properties.

Parameter
NameDescription
properties google.pubsub.v1.ISubscription

Properties to set

Returns
TypeDescription
google.pubsub.v1.Subscription

Subscription instance

decode(reader, length)

public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Subscription;

Decodes a Subscription 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.pubsub.v1.Subscription

Subscription

decodeDelimited(reader)

public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Subscription;

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

Parameter
NameDescription
reader ($protobuf.Reader|Uint8Array)

Reader or buffer to decode from

Returns
TypeDescription
google.pubsub.v1.Subscription

Subscription

encode(message, writer)

public static encode(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer;

Encodes the specified Subscription message. Does not implicitly messages.

Parameters
NameDescription
message google.pubsub.v1.ISubscription

Subscription 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.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer;

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

Parameters
NameDescription
message google.pubsub.v1.ISubscription

Subscription 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.pubsub.v1.Subscription;

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

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

Plain object

Returns
TypeDescription
google.pubsub.v1.Subscription

Subscription

toJSON()

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

Converts this Subscription to JSON.

Returns
TypeDescription
{ [k: string]: any }

JSON object

toObject(message, options)

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

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

Parameters
NameDescription
message google.pubsub.v1.Subscription

Subscription

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 Subscription 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