@maxim_mazurok/gapi.client.workspaceevents-v1
Advanced tools
Comparing version 0.0.20240211 to 0.0.20240213
382
index.d.ts
@@ -12,3 +12,3 @@ /* Type definitions for non-npm package Google Workspace Events API v1 0.0 */ | ||
// Generated from: https://workspaceevents.googleapis.com/$discovery/rest?version=v1 | ||
// Revision: 20240211 | ||
// Revision: 20240213 | ||
@@ -30,2 +30,382 @@ /// <reference types="gapi.client" /> | ||
): void; | ||
namespace workspaceevents { | ||
interface ListSubscriptionsResponse { | ||
/** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */ | ||
nextPageToken?: string; | ||
/** List of subscriptions. */ | ||
subscriptions?: Subscription[]; | ||
} | ||
interface NotificationEndpoint { | ||
/** Immutable. The Cloud Pub/Sub topic that receives events for the subscription. Format: `projects/{project}/topics/{topic}` You must create the topic in the same Google Cloud project where you create this subscription. When the topic receives events, the events are encoded as Cloud Pub/Sub messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md). */ | ||
pubsubTopic?: string; | ||
} | ||
interface Operation { | ||
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ | ||
done?: boolean; | ||
/** The error result of the operation in case of failure or cancellation. */ | ||
error?: Status; | ||
/** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ | ||
metadata?: {[P in string]: any}; | ||
/** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */ | ||
name?: string; | ||
/** The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ | ||
response?: {[P in string]: any}; | ||
} | ||
interface PayloadOptions { | ||
/** Optional. If `include_resource` is set to `true`, the list of fields to include in the event payload. Separate fields with a comma. For example, to include a Google Chat message's sender and create time, enter `message.sender,message.createTime`. If omitted, the payload includes all fields for the resource. If you specify a field that doesn't exist for the resource, the system ignores the field. */ | ||
fieldMask?: string; | ||
/** Optional. Whether the event payload includes data about the resource that changed. For example, for an event where a Google Chat message was created, whether the payload contains data about the [`Message`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages) resource. If false, the event payload only includes the name of the changed resource. */ | ||
includeResource?: boolean; | ||
} | ||
interface ReactivateSubscriptionRequest {} | ||
interface Status { | ||
/** The status code, which should be an enum value of google.rpc.Code. */ | ||
code?: number; | ||
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ | ||
details?: Array<{[P in string]: any}>; | ||
/** A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. */ | ||
message?: string; | ||
} | ||
interface Subscription { | ||
/** 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`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids) field from the Directory API. */ | ||
authority?: string; | ||
/** Output only. The time when the subscription is created. */ | ||
createTime?: string; | ||
/** 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. */ | ||
etag?: string; | ||
/** 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. For a list of supported event types, see the following documentation: * [Google Chat events](https://developers.google.com/workspace/events/guides/events-chat) * [Google Meet events](https://developers.google.com/workspace/events/guides/events-meet) By default, you also receive events about the [lifecycle of your subscription](https://developers.google.com/workspace/events/guides/events-lifecycle). 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. */ | ||
eventTypes?: string[]; | ||
/** Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input. */ | ||
expireTime?: string; | ||
/** Optional. Immutable. Identifier. Resource name of the subscription. Format: `subscriptions/{subscription}` */ | ||
name?: string; | ||
/** Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic. */ | ||
notificationEndpoint?: NotificationEndpoint; | ||
/** Optional. Options about what data to include in the event payload. Only supported for Google Chat events. */ | ||
payloadOptions?: PayloadOptions; | ||
/** Output only. If `true`, the subscription is in the process of being updated. */ | ||
reconciling?: boolean; | ||
/** Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint. */ | ||
state?: string; | ||
/** Output only. The error that suspended the subscription. To reactivate the subscription, resolve the error and call the `ReactivateSubscription` method. */ | ||
suspensionReason?: string; | ||
/** Required. Immutable. The Google Workspace resource that's monitored for events, formatted as the [full resource name](https://google.aip.dev/122#full-resource-names). To learn about target resources, see [Supported Google Workspace resources](https://developers.google.com/workspace/events/guides#supported-resources). 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. */ | ||
targetResource?: string; | ||
/** Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to `0`, uses the maximum possible duration. */ | ||
ttl?: string; | ||
/** Output only. System-assigned unique identifier for the subscription. */ | ||
uid?: string; | ||
/** Output only. The last time that the subscription is updated. */ | ||
updateTime?: string; | ||
} | ||
interface OperationsResource { | ||
/** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */ | ||
get(request?: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** The name of the operation resource. */ | ||
name: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
}): Request<Operation>; | ||
} | ||
interface SubscriptionsResource { | ||
/** [Developer Preview](https://developers.google.com/workspace/preview): Creates a Google Workspace subscription. To learn how to use this method, see [Create a Google Workspace subscription](https://developers.google.com/workspace/events/guides/create-subscription). */ | ||
create(request: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
/** Optional. If set to `true`, validates and previews the request, but doesn't create the subscription. */ | ||
validateOnly?: boolean; | ||
/** Request body */ | ||
resource: Subscription; | ||
}): Request<Operation>; | ||
create( | ||
request: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
/** Optional. If set to `true`, validates and previews the request, but doesn't create the subscription. */ | ||
validateOnly?: boolean; | ||
}, | ||
body: Subscription | ||
): Request<Operation>; | ||
/** [Developer Preview](https://developers.google.com/workspace/preview): Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google Workspace subscription](https://developers.google.com/workspace/events/guides/delete-subscription). */ | ||
delete(request?: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Optional. If set to `true` and the subscription isn't found, the request succeeds but doesn't delete the subscription. */ | ||
allowMissing?: boolean; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Optional. Etag of the subscription. If present, it must match with the server's etag. Otherwise, request fails with the status `ABORTED`. */ | ||
etag?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** Required. Resource name of the subscription to delete. Format: `subscriptions/{subscription}` */ | ||
name: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
/** Optional. If set to `true`, validates and previews the request, but doesn't delete the subscription. */ | ||
validateOnly?: boolean; | ||
}): Request<Operation>; | ||
/** [Developer Preview](https://developers.google.com/workspace/preview): Gets details about a Google Workspace subscription. To learn how to use this method, see [Get details about a Google Workspace subscription](https://developers.google.com/workspace/events/guides/get-subscription). */ | ||
get(request?: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** Required. Resource name of the subscription. Format: `subscriptions/{subscription}` */ | ||
name: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
}): Request<Subscription>; | ||
/** [Developer Preview](https://developers.google.com/workspace/preview): Lists Google Workspace subscriptions. To learn how to use this method, see [List Google Workspace subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions). */ | ||
list(request?: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** Required. A query filter. You can filter subscriptions by event type (`event_types`) and target resource (`target_resource`). You must specify at least one event type in your query. To filter for multiple event types, use the `OR` operator. To filter by both event type and target resource, use the `AND` operator and specify the full resource name, such as `//chat.googleapis.com/spaces/{space}`. For example, the following queries are valid: ``` event_types:"google.workspace.chat.membership.v1.updated" OR event_types:"google.workspace.chat.message.v1.created" event_types:"google.workspace.chat.message.v1.created" AND target_resource="//chat.googleapis.com/spaces/{space}" ( event_types:"google.workspace.chat.membership.v1.updated" OR event_types:"google.workspace.chat.message.v1.created" ) AND target_resource="//chat.googleapis.com/spaces/{space}" ``` The server rejects invalid queries with an `INVALID_ARGUMENT` error. */ | ||
filter?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Optional. The maximum number of subscriptions to return. The service might return fewer than this value. If unspecified or set to `0`, up to 50 subscriptions are returned. The maximum value is 100. If you specify a value more than 100, the system only returns 100 subscriptions. */ | ||
pageSize?: number; | ||
/** Optional. A page token, received from a previous list subscriptions call. Provide this parameter to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results. */ | ||
pageToken?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
}): Request<ListSubscriptionsResponse>; | ||
/** [Developer Preview](https://developers.google.com/workspace/preview): Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update or renew a Google Workspace subscription](https://developers.google.com/workspace/events/guides/update-subscription). */ | ||
patch(request: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** Optional. Immutable. Identifier. Resource name of the subscription. Format: `subscriptions/{subscription}` */ | ||
name: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Optional. Required. The field to update. You can update one of the following fields in a subscription: * `expire_time`: The timestamp when the subscription expires. * `ttl`: The time-to-live (TTL) or duration of the subscription. */ | ||
updateMask?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
/** Optional. If set to `true`, validates and previews the request, but doesn't update the subscription. */ | ||
validateOnly?: boolean; | ||
/** Request body */ | ||
resource: Subscription; | ||
}): Request<Operation>; | ||
patch( | ||
request: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** Optional. Immutable. Identifier. Resource name of the subscription. Format: `subscriptions/{subscription}` */ | ||
name: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Optional. Required. The field to update. You can update one of the following fields in a subscription: * `expire_time`: The timestamp when the subscription expires. * `ttl`: The time-to-live (TTL) or duration of the subscription. */ | ||
updateMask?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
/** Optional. If set to `true`, validates and previews the request, but doesn't update the subscription. */ | ||
validateOnly?: boolean; | ||
}, | ||
body: Subscription | ||
): Request<Operation>; | ||
/** [Developer Preview](https://developers.google.com/workspace/preview): Reactivates a suspended Google Workspace subscription. This method resets your subscription's `State` field to `ACTIVE`. Before you use this method, you must fix the error that suspended the subscription. To learn how to use this method, see [Reactivate a Google Workspace subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription). */ | ||
reactivate(request: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** Required. Resource name of the subscription. Format: `subscriptions/{subscription}` */ | ||
name: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
/** Request body */ | ||
resource: ReactivateSubscriptionRequest; | ||
}): Request<Operation>; | ||
reactivate( | ||
request: { | ||
/** V1 error format. */ | ||
'$.xgafv'?: string; | ||
/** OAuth access token. */ | ||
access_token?: string; | ||
/** Data format for response. */ | ||
alt?: string; | ||
/** JSONP */ | ||
callback?: string; | ||
/** Selector specifying which fields to include in a partial response. */ | ||
fields?: string; | ||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ | ||
key?: string; | ||
/** Required. Resource name of the subscription. Format: `subscriptions/{subscription}` */ | ||
name: string; | ||
/** OAuth 2.0 token for the current user. */ | ||
oauth_token?: string; | ||
/** Returns response with indentations and line breaks. */ | ||
prettyPrint?: boolean; | ||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ | ||
quotaUser?: string; | ||
/** Upload protocol for media (e.g. "raw", "multipart"). */ | ||
upload_protocol?: string; | ||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */ | ||
uploadType?: string; | ||
}, | ||
body: ReactivateSubscriptionRequest | ||
): Request<Operation>; | ||
} | ||
const operations: OperationsResource; | ||
const subscriptions: SubscriptionsResource; | ||
} | ||
} |
{ | ||
"name": "@maxim_mazurok/gapi.client.workspaceevents-v1", | ||
"version": "0.0.20240211", | ||
"version": "0.0.20240213", | ||
"description": "TypeScript typings for Google Workspace Events API v1", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -32,2 +32,3 @@ # TypeScript typings for Google Workspace Events API v1 | ||
// now we can use: | ||
// gapi.client.workspaceevents | ||
} | ||
@@ -41,9 +42,91 @@ ); | ||
// now we can use: | ||
// gapi.client.workspaceevents | ||
}); | ||
``` | ||
Don't forget to authenticate your client before sending any request to resources: | ||
```typescript | ||
// declare client_id registered in Google Developers Console | ||
var client_id = '', | ||
scope = [ | ||
// Private Service: https://www.googleapis.com/auth/chat.bot | ||
'https://www.googleapis.com/auth/chat.bot', | ||
// View, add, and remove members from conversations in Google Chat | ||
'https://www.googleapis.com/auth/chat.memberships', | ||
// View members in Google Chat conversations. | ||
'https://www.googleapis.com/auth/chat.memberships.readonly', | ||
// View, compose, send, update, and delete messages, and add, view, and delete reactions to messages. | ||
'https://www.googleapis.com/auth/chat.messages', | ||
// View, add, and delete reactions to messages in Google Chat | ||
'https://www.googleapis.com/auth/chat.messages.reactions', | ||
// View reactions to messages in Google Chat | ||
'https://www.googleapis.com/auth/chat.messages.reactions.readonly', | ||
// View messages and reactions in Google Chat | ||
'https://www.googleapis.com/auth/chat.messages.readonly', | ||
// Create conversations and spaces and see or edit metadata (including history settings and access settings) in Google Chat | ||
'https://www.googleapis.com/auth/chat.spaces', | ||
// View chat and spaces in Google Chat | ||
'https://www.googleapis.com/auth/chat.spaces.readonly', | ||
], | ||
immediate = true; | ||
// ... | ||
gapi.auth.authorize( | ||
{client_id: client_id, scope: scope, immediate: immediate}, | ||
authResult => { | ||
if (authResult && !authResult.error) { | ||
/* handle successful authorization */ | ||
} else { | ||
/* handle authorization error */ | ||
} | ||
} | ||
); | ||
``` | ||
After that you can use Google Workspace Events API resources: <!-- TODO: make this work for multiple namespaces --> | ||
```typescript | ||
/* | ||
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. | ||
*/ | ||
await gapi.client.workspaceevents.operations.get({name: 'name'}); | ||
/* | ||
[Developer Preview](https://developers.google.com/workspace/preview): Creates a Google Workspace subscription. To learn how to use this method, see [Create a Google Workspace subscription](https://developers.google.com/workspace/events/guides/create-subscription). | ||
*/ | ||
await gapi.client.workspaceevents.subscriptions.create({}); | ||
/* | ||
[Developer Preview](https://developers.google.com/workspace/preview): Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google Workspace subscription](https://developers.google.com/workspace/events/guides/delete-subscription). | ||
*/ | ||
await gapi.client.workspaceevents.subscriptions.delete({name: 'name'}); | ||
/* | ||
[Developer Preview](https://developers.google.com/workspace/preview): Gets details about a Google Workspace subscription. To learn how to use this method, see [Get details about a Google Workspace subscription](https://developers.google.com/workspace/events/guides/get-subscription). | ||
*/ | ||
await gapi.client.workspaceevents.subscriptions.get({name: 'name'}); | ||
/* | ||
[Developer Preview](https://developers.google.com/workspace/preview): Lists Google Workspace subscriptions. To learn how to use this method, see [List Google Workspace subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions). | ||
*/ | ||
await gapi.client.workspaceevents.subscriptions.list({}); | ||
/* | ||
[Developer Preview](https://developers.google.com/workspace/preview): Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update or renew a Google Workspace subscription](https://developers.google.com/workspace/events/guides/update-subscription). | ||
*/ | ||
await gapi.client.workspaceevents.subscriptions.patch({name: 'name'}); | ||
/* | ||
[Developer Preview](https://developers.google.com/workspace/preview): Reactivates a suspended Google Workspace subscription. This method resets your subscription's `State` field to `ACTIVE`. Before you use this method, you must fix the error that suspended the subscription. To learn how to use this method, see [Reactivate a Google Workspace subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription). | ||
*/ | ||
await gapi.client.workspaceevents.subscriptions.reactivate({name: 'name'}); | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
33074
417
131
1