Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

pubsub

import { pubsub } from "https://googleapis.deno.dev/v1/pubsub:v1.ts";

Provides reliable, many-to-many, asynchronous messaging between applications.

class pubsub {
constructor(client?: CredentialsClient, baseUrl?: string);
async projectsSchemasCommit(name: string, req: CommitSchemaRequest): Promise<Schema>;
async projectsSchemasCreate(
parent: string,
req: Schema,
): Promise<Schema>;
async projectsSchemasDelete(name: string): Promise<Empty>;
async projectsSchemasDeleteRevision(name: string, opts?: ProjectsSchemasDeleteRevisionOptions): Promise<Schema>;
async projectsSchemasGet(name: string, opts?: ProjectsSchemasGetOptions): Promise<Schema>;
async projectsSchemasGetIamPolicy(resource: string, opts?: ProjectsSchemasGetIamPolicyOptions): Promise<Policy>;
async projectsSchemasList(parent: string, opts?: ProjectsSchemasListOptions): Promise<ListSchemasResponse>;
async projectsSchemasListRevisions(name: string, opts?: ProjectsSchemasListRevisionsOptions): Promise<ListSchemaRevisionsResponse>;
async projectsSchemasRollback(name: string, req: RollbackSchemaRequest): Promise<Schema>;
async projectsSchemasSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>;
async projectsSchemasTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>;
async projectsSchemasValidate(parent: string, req: ValidateSchemaRequest): Promise<ValidateSchemaResponse>;
async projectsSchemasValidateMessage(parent: string, req: ValidateMessageRequest): Promise<ValidateMessageResponse>;
async projectsSnapshotsCreate(name: string, req: CreateSnapshotRequest): Promise<Snapshot>;
async projectsSnapshotsDelete(snapshot: string): Promise<Empty>;
async projectsSnapshotsGet(snapshot: string): Promise<Snapshot>;
async projectsSnapshotsGetIamPolicy(resource: string, opts?: ProjectsSnapshotsGetIamPolicyOptions): Promise<Policy>;
async projectsSnapshotsList(project: string, opts?: ProjectsSnapshotsListOptions): Promise<ListSnapshotsResponse>;
async projectsSnapshotsPatch(name: string, req: UpdateSnapshotRequest): Promise<Snapshot>;
async projectsSnapshotsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>;
async projectsSnapshotsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>;
async projectsSubscriptionsAcknowledge(subscription: string, req: AcknowledgeRequest): Promise<Empty>;
async projectsSubscriptionsCreate(name: string, req: Subscription): Promise<Subscription>;
async projectsSubscriptionsDelete(subscription: string): Promise<Empty>;
async projectsSubscriptionsDetach(subscription: string): Promise<DetachSubscriptionResponse>;
async projectsSubscriptionsGet(subscription: string): Promise<Subscription>;
async projectsSubscriptionsGetIamPolicy(resource: string, opts?: ProjectsSubscriptionsGetIamPolicyOptions): Promise<Policy>;
async projectsSubscriptionsList(project: string, opts?: ProjectsSubscriptionsListOptions): Promise<ListSubscriptionsResponse>;
async projectsSubscriptionsModifyAckDeadline(subscription: string, req: ModifyAckDeadlineRequest): Promise<Empty>;
async projectsSubscriptionsModifyPushConfig(subscription: string, req: ModifyPushConfigRequest): Promise<Empty>;
async projectsSubscriptionsPatch(name: string, req: UpdateSubscriptionRequest): Promise<Subscription>;
async projectsSubscriptionsPull(subscription: string, req: PullRequest): Promise<PullResponse>;
async projectsSubscriptionsSeek(subscription: string, req: SeekRequest): Promise<SeekResponse>;
async projectsSubscriptionsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>;
async projectsSubscriptionsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>;
async projectsTopicsCreate(name: string, req: Topic): Promise<Topic>;
async projectsTopicsDelete(topic: string): Promise<Empty>;
async projectsTopicsGet(topic: string): Promise<Topic>;
async projectsTopicsGetIamPolicy(resource: string, opts?: ProjectsTopicsGetIamPolicyOptions): Promise<Policy>;
async projectsTopicsList(project: string, opts?: ProjectsTopicsListOptions): Promise<ListTopicsResponse>;
async projectsTopicsPatch(name: string, req: UpdateTopicRequest): Promise<Topic>;
async projectsTopicsPublish(topic: string, req: PublishRequest): Promise<PublishResponse>;
async projectsTopicsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>;
async projectsTopicsSnapshotsList(topic: string, opts?: ProjectsTopicsSnapshotsListOptions): Promise<ListTopicSnapshotsResponse>;
async projectsTopicsSubscriptionsList(topic: string, opts?: ProjectsTopicsSubscriptionsListOptions): Promise<ListTopicSubscriptionsResponse>;
async projectsTopicsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>;
}

§Constructors

§
new pubsub(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§
projectsSchemasCommit(name: string, req: CommitSchemaRequest): Promise<Schema>
[src]

Commits a new schema revision to an existing schema.

@param name

Required. The name of the schema we are revising. Format is projects/{project}/schemas/{schema}.

§
projectsSchemasCreate(parent: string, req: Schema, opts?: ProjectsSchemasCreateOptions): Promise<Schema>
[src]

Creates a schema.

@param parent

Required. The name of the project in which to create the schema. Format is projects/{project-id}.

§
projectsSchemasDelete(name: string): Promise<Empty>
[src]

Deletes a schema.

@param name

Required. Name of the schema to delete. Format is projects/{project}/schemas/{schema}.

§
projectsSchemasDeleteRevision(name: string, opts?: ProjectsSchemasDeleteRevisionOptions): Promise<Schema>
[src]

Deletes a specific schema revision.

@param name

Required. The name of the schema revision to be deleted, with a revision ID explicitly included. Example: projects/123/schemas/my-schema@c7cfa2a8

§
projectsSchemasGet(name: string, opts?: ProjectsSchemasGetOptions): Promise<Schema>
[src]

Gets a schema.

@param name

Required. The name of the schema to get. Format is projects/{project}/schemas/{schema}.

§
projectsSchemasGetIamPolicy(resource: string, opts?: ProjectsSchemasGetIamPolicyOptions): Promise<Policy>
[src]

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

@param resource

REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

§
projectsSchemasList(parent: string, opts?: ProjectsSchemasListOptions): Promise<ListSchemasResponse>
[src]

Lists schemas in a project.

@param parent

Required. The name of the project in which to list schemas. Format is projects/{project-id}.

§
projectsSchemasListRevisions(name: string, opts?: ProjectsSchemasListRevisionsOptions): Promise<ListSchemaRevisionsResponse>
[src]

Lists all schema revisions for the named schema.

@param name

Required. The name of the schema to list revisions for.

§
projectsSchemasRollback(name: string, req: RollbackSchemaRequest): Promise<Schema>
[src]

Creates a new schema revision that is a copy of the provided revision_id.

@param name

Required. The schema being rolled back with revision id.

§
projectsSchemasSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>
[src]

Sets the access control policy on the specified resource. Replaces any existing policy. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

@param resource

REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

§
projectsSchemasTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>
[src]

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

@param resource

REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

§
projectsSchemasValidate(parent: string, req: ValidateSchemaRequest): Promise<ValidateSchemaResponse>
[src]

Validates a schema.

@param parent

Required. The name of the project in which to validate schemas. Format is projects/{project-id}.

§
projectsSchemasValidateMessage(parent: string, req: ValidateMessageRequest): Promise<ValidateMessageResponse>
[src]

Validates a message against a schema.

@param parent

Required. The name of the project in which to validate schemas. Format is projects/{project-id}.

§
projectsSnapshotsCreate(name: string, req: CreateSnapshotRequest): Promise<Snapshot>
[src]

Creates a snapshot from the requested subscription. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. If the snapshot already exists, returns ALREADY_EXISTS. If the requested subscription doesn't exist, returns NOT_FOUND. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then FAILED_PRECONDITION is returned. See also the Snapshot.expire_time field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.

@param name

Required. User-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. See the resource name rules. Format is projects/{project}/snapshots/{snap}.

§
projectsSnapshotsDelete(snapshot: string): Promise<Empty>
[src]

Removes an existing snapshot. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.

@param snapshot

Required. The name of the snapshot to delete. Format is projects/{project}/snapshots/{snap}.

§
projectsSnapshotsGet(snapshot: string): Promise<Snapshot>
[src]

Gets the configuration details of a snapshot. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

@param snapshot

Required. The name of the snapshot to get. Format is projects/{project}/snapshots/{snap}.

§
projectsSnapshotsGetIamPolicy(resource: string, opts?: ProjectsSnapshotsGetIamPolicyOptions): Promise<Policy>
[src]

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

@param resource

REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

§
projectsSnapshotsList(project: string, opts?: ProjectsSnapshotsListOptions): Promise<ListSnapshotsResponse>
[src]

Lists the existing snapshots. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

@param project

Required. The name of the project in which to list snapshots. Format is projects/{project-id}.

§
projectsSnapshotsPatch(name: string, req: UpdateSnapshotRequest): Promise<Snapshot>
[src]

Updates an existing snapshot by updating the fields specified in the update mask. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

@param name

Optional. The name of the snapshot.

§
projectsSnapshotsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>
[src]

Sets the access control policy on the specified resource. Replaces any existing policy. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

@param resource

REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

§
projectsSnapshotsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>
[src]

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

@param resource

REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

§
projectsSubscriptionsAcknowledge(subscription: string, req: AcknowledgeRequest): Promise<Empty>
[src]

Acknowledges the messages associated with the ack_ids in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.

@param subscription

Required. The subscription whose message is being acknowledged. Format is projects/{project}/subscriptions/{sub}.

§
projectsSubscriptionsCreate(name: string, req: Subscription): Promise<Subscription>
[src]

Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

@param name

Required. The name of the subscription. It must have the format "projects/{project}/subscriptions/{subscription}". {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".

§
projectsSubscriptionsDelete(subscription: string): Promise<Empty>
[src]

Deletes an existing subscription. All messages retained in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified.

@param subscription

Required. The subscription to delete. Format is projects/{project}/subscriptions/{sub}.

§
projectsSubscriptionsDetach(subscription: string): Promise<DetachSubscriptionResponse>
[src]

Detaches a subscription from this topic. All messages retained in the subscription are dropped. Subsequent Pull and StreamingPull requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.

@param subscription

Required. The subscription to detach. Format is projects/{project}/subscriptions/{subscription}.

§
projectsSubscriptionsGet(subscription: string): Promise<Subscription>
[src]

Gets the configuration details of a subscription.

@param subscription

Required. The name of the subscription to get. Format is projects/{project}/subscriptions/{sub}.

§
projectsSubscriptionsGetIamPolicy(resource: string, opts?: ProjectsSubscriptionsGetIamPolicyOptions): Promise<Policy>
[src]

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

@param resource

REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

§
projectsSubscriptionsList(project: string, opts?: ProjectsSubscriptionsListOptions): Promise<ListSubscriptionsResponse>
[src]

Lists matching subscriptions.

@param project

Required. The name of the project in which to list subscriptions. Format is projects/{project-id}.

§
projectsSubscriptionsModifyAckDeadline(subscription: string, req: ModifyAckDeadlineRequest): Promise<Empty>
[src]

Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. Note that this does not modify the subscription-level ackDeadlineSeconds used for subsequent messages.

@param subscription

Required. The name of the subscription. Format is projects/{project}/subscriptions/{sub}.

§
projectsSubscriptionsModifyPushConfig(subscription: string, req: ModifyPushConfigRequest): Promise<Empty>
[src]

Modifies the PushConfig for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the PushConfig.

@param subscription

Required. The name of the subscription. Format is projects/{project}/subscriptions/{sub}.

§
projectsSubscriptionsPatch(name: string, req: UpdateSubscriptionRequest): Promise<Subscription>
[src]

Updates an existing subscription by updating the fields specified in the update mask. Note that certain properties of a subscription, such as its topic, are not modifiable.

@param name

Required. The name of the subscription. It must have the format "projects/{project}/subscriptions/{subscription}". {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".

§
projectsSubscriptionsPull(subscription: string, req: PullRequest): Promise<PullResponse>
[src]

Pulls messages from the server.

@param subscription

Required. The subscription from which messages should be pulled. Format is projects/{project}/subscriptions/{sub}.

§
projectsSubscriptionsSeek(subscription: string, req: SeekRequest): Promise<SeekResponse>
[src]

Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. Note that both the subscription and the snapshot must be on the same topic.

@param subscription

Required. The subscription to affect.

§
projectsSubscriptionsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>
[src]

Sets the access control policy on the specified resource. Replaces any existing policy. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

@param resource

REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

§
projectsSubscriptionsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>
[src]

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

@param resource

REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

§
projectsTopicsCreate(name: string, req: Topic): Promise<Topic>
[src]

Creates the given topic with the given name. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).

@param name

Required. The name of the topic. It must have the format "projects/{project}/topics/{topic}". {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".

§
projectsTopicsDelete(topic: string): Promise<Empty>
[src]

Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their topic field is set to _deleted-topic_.

@param topic

Required. Name of the topic to delete. Format is projects/{project}/topics/{topic}.

§
projectsTopicsGet(topic: string): Promise<Topic>
[src]

Gets the configuration of a topic.

@param topic

Required. The name of the topic to get. Format is projects/{project}/topics/{topic}.

§
projectsTopicsGetIamPolicy(resource: string, opts?: ProjectsTopicsGetIamPolicyOptions): Promise<Policy>
[src]

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

@param resource

REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

§
projectsTopicsList(project: string, opts?: ProjectsTopicsListOptions): Promise<ListTopicsResponse>
[src]

Lists matching topics.

@param project

Required. The name of the project in which to list topics. Format is projects/{project-id}.

§
projectsTopicsPatch(name: string, req: UpdateTopicRequest): Promise<Topic>
[src]

Updates an existing topic by updating the fields specified in the update mask. Note that certain properties of a topic are not modifiable.

@param name

Required. The name of the topic. It must have the format "projects/{project}/topics/{topic}". {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".

§
projectsTopicsPublish(topic: string, req: PublishRequest): Promise<PublishResponse>
[src]

Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.

@param topic

Required. The messages in the request will be published on this topic. Format is projects/{project}/topics/{topic}.

§
projectsTopicsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise<Policy>
[src]

Sets the access control policy on the specified resource. Replaces any existing policy. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

@param resource

REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

§
projectsTopicsSnapshotsList(topic: string, opts?: ProjectsTopicsSnapshotsListOptions): Promise<ListTopicSnapshotsResponse>
[src]

Lists the names of the snapshots on this topic. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

@param topic

Required. The name of the topic that snapshots are attached to. Format is projects/{project}/topics/{topic}.

§
projectsTopicsSubscriptionsList(topic: string, opts?: ProjectsTopicsSubscriptionsListOptions): Promise<ListTopicSubscriptionsResponse>
[src]

Lists the names of the attached subscriptions on this topic.

@param topic

Required. The name of the topic that subscriptions are attached to. Format is projects/{project}/topics/{topic}.

§
projectsTopicsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise<TestIamPermissionsResponse>
[src]

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

@param resource

REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.