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

Subscription

import type { Subscription } from "https://googleapis.deno.dev/v1/workspaceevents:v1.ts";

Developer Preview. A subscription to receive events about a Google Workspace resource. To learn more about subscriptions, see the Google Workspace Events API overview.

interface Subscription {
readonly authority?: string;
readonly createTime?: Date;
etag?: string;
eventTypes?: string[];
expireTime?: Date;
name?: string;
notificationEndpoint?: NotificationEndpoint;
payloadOptions?: PayloadOptions;
readonly reconciling?: boolean;
readonly state?:
| "STATE_UNSPECIFIED"
| "ACTIVE"
| "SUSPENDED"
| "DELETED";
readonly suspensionReason?:
| "ERROR_TYPE_UNSPECIFIED"
| "USER_SCOPE_REVOKED"
| "RESOURCE_DELETED"
| "USER_AUTHORIZATION_FAILURE"
| "ENDPOINT_PERMISSION_DENIED"
| "ENDPOINT_NOT_FOUND"
| "ENDPOINT_RESOURCE_EXHAUSTED"
| "OTHER";
targetResource?: string;
ttl?: number;
readonly uid?: string;
readonly updateTime?: Date;
}

§Properties

§
readonly authority?: string
[src]

Output only. The user who authorized the creation of the subscription. Format: users/{user} For Google Workspace users, the {user} value is the user.id field from the Directory API.

§
readonly createTime?: Date
[src]

Output only. The time when the subscription is created.

§
etag?: string
[src]

Optional. This checksum is computed by the server based on the value of other fields, and might be sent on update requests to ensure the client has an up-to-date value before proceeding.

§
eventTypes?: string[]
[src]

Required. Immutable. Unordered list. Input for creating a subscription. Otherwise, output only. One or more types of events to receive about the target resource. Formatted according to the CloudEvents specification. The supported event types depend on the target resource of your subscription. For details, see Supported Google Workspace events. By default, you also receive events about the lifecycle of your subscription. You don't need to specify lifecycle events for this field. If you specify an event type that doesn't exist for the target resource, the request returns an HTTP 400 Bad Request status code.

§
expireTime?: Date
[src]

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.

§
name?: string
[src]

Optional. Immutable. Identifier. Resource name of the subscription. Format: subscriptions/{subscription}

§
notificationEndpoint?: NotificationEndpoint
[src]

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

§
payloadOptions?: PayloadOptions
[src]

Optional. Options about what data to include in the event payload. Only supported for Google Chat events.

§
readonly reconciling?: boolean
[src]

Output only. If true, the subscription is in the process of being updated.

§
readonly state?: "STATE_UNSPECIFIED" | "ACTIVE" | "SUSPENDED" | "DELETED"
[src]

Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.

§
readonly suspensionReason?: "ERROR_TYPE_UNSPECIFIED" | "USER_SCOPE_REVOKED" | "RESOURCE_DELETED" | "USER_AUTHORIZATION_FAILURE" | "ENDPOINT_PERMISSION_DENIED" | "ENDPOINT_NOT_FOUND" | "ENDPOINT_RESOURCE_EXHAUSTED" | "OTHER"
[src]

Output only. The error that suspended the subscription. To reactivate the subscription, resolve the error and call the ReactivateSubscription method.

§
targetResource?: string
[src]

Required. Immutable. The Google Workspace resource that's monitored for events, formatted as the full resource name. To learn about target resources and the events that they support, see Supported Google Workspace events. A user can only authorize your app to create one subscription for a given target resource. If your app tries to create another subscription with the same user credentials, the request returns an ALREADY_EXISTS error.

§
ttl?: number
[src]

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration.

§
readonly uid?: string
[src]

Output only. System-assigned unique identifier for the subscription.

§
readonly updateTime?: Date
[src]

Output only. The last time that the subscription is updated.