@maxim_mazurok/gapi.client.chat-v1 0.0.20230727 → 0.0.20230801
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +34 -26
- package/package.json +1 -1
- package/readme.md +2 -2
- package/tests.ts +15 -17
package/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
10
10
|
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
11
11
|
// Generated from: https://chat.googleapis.com/$discovery/rest?version=v1
|
|
12
|
-
// Revision:
|
|
12
|
+
// Revision: 20230801
|
|
13
13
|
|
|
14
14
|
/// <reference types="gapi.client" />
|
|
15
15
|
|
|
@@ -1343,11 +1343,13 @@ declare namespace gapi.client {
|
|
|
1343
1343
|
}
|
|
1344
1344
|
interface SetUpSpaceRequest {
|
|
1345
1345
|
/**
|
|
1346
|
-
* Optional. The
|
|
1347
|
-
*
|
|
1348
|
-
*
|
|
1346
|
+
* Optional. The Google Chat users to invite to join the space. Omit the calling user, as they are added automatically. The set currently allows up to 20 memberships (in addition to
|
|
1347
|
+
* the caller). The `Membership.member` field must contain a `user` with `name` populated (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only add human users
|
|
1348
|
+
* when setting up a space (adding Chat apps is only supported for direct message setup with the calling app). You can also add members using the user's email as an alias for {user}.
|
|
1349
|
+
* For example, the `user.name` can be `users/example@gmail.com`." To invite Gmail users or users from external Google Workspace domains, user's email must be used for `{user}`.
|
|
1350
|
+
* Optional when setting `Space.spaceType` to `SPACE`. Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at least two memberships. Required when setting
|
|
1349
1351
|
* `Space.spaceType` to `DIRECT_MESSAGE` with a human user, along with exactly one membership. Must be empty when creating a 1:1 conversation between a human and the calling Chat app
|
|
1350
|
-
* (when setting `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`).
|
|
1352
|
+
* (when setting `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`).
|
|
1351
1353
|
*/
|
|
1352
1354
|
memberships?:
|
|
1353
1355
|
Membership[];
|
|
@@ -1402,7 +1404,10 @@ declare namespace gapi.client {
|
|
|
1402
1404
|
*/
|
|
1403
1405
|
displayName?:
|
|
1404
1406
|
string;
|
|
1405
|
-
/**
|
|
1407
|
+
/**
|
|
1408
|
+
* Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. For Google Chat users that use a Google
|
|
1409
|
+
* Account, omit this field when creating a space (By default, the space permits any Google Chat user). For existing spaces, this field is output only.
|
|
1410
|
+
*/
|
|
1406
1411
|
externalUserAllowed?:
|
|
1407
1412
|
boolean;
|
|
1408
1413
|
/** Resource name of the space. Format: `spaces/{space}` */
|
|
@@ -1689,10 +1694,10 @@ declare namespace gapi.client {
|
|
|
1689
1694
|
* they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user
|
|
1690
1695
|
* authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.memberships` (for human membership) or `chat.memberships.app` (for app membership) scope. To
|
|
1691
1696
|
* specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use
|
|
1692
|
-
* `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}`
|
|
1693
|
-
*
|
|
1694
|
-
*
|
|
1695
|
-
*
|
|
1697
|
+
* `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace
|
|
1698
|
+
* organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person
|
|
1699
|
+
* `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or
|
|
1700
|
+
* `users/123456789`.
|
|
1696
1701
|
*/
|
|
1697
1702
|
create(request: {
|
|
1698
1703
|
/** V1 error format. */
|
|
@@ -1799,8 +1804,9 @@ declare namespace gapi.client {
|
|
|
1799
1804
|
string;
|
|
1800
1805
|
/**
|
|
1801
1806
|
* Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships. When deleting a
|
|
1802
|
-
* human membership, requires the `chat.memberships` scope and `spaces/{space}/members/{member}` format.
|
|
1803
|
-
*
|
|
1807
|
+
* human membership, requires the `chat.memberships` scope and `spaces/{space}/members/{member}` format. You can use the email as an alias for `{member}`. For example,
|
|
1808
|
+
* `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. When deleting an app membership, requires the `chat.memberships.app`
|
|
1809
|
+
* scope and `spaces/{space}/members/app` format. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`.
|
|
1804
1810
|
*/
|
|
1805
1811
|
name:
|
|
1806
1812
|
string;
|
|
@@ -1847,7 +1853,8 @@ declare namespace gapi.client {
|
|
|
1847
1853
|
string;
|
|
1848
1854
|
/**
|
|
1849
1855
|
* Required. Resource name of the membership to retrieve. To get the app's own membership, you can optionally use `spaces/{space}/members/app`. Format:
|
|
1850
|
-
* `spaces/{space}/members/{member}` or `spaces/{space}/members/app`
|
|
1856
|
+
* `spaces/{space}/members/{member}` or `spaces/{space}/members/app` When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the
|
|
1857
|
+
* user's email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.
|
|
1851
1858
|
*/
|
|
1852
1859
|
name:
|
|
1853
1860
|
string;
|
|
@@ -2724,9 +2731,8 @@ declare namespace gapi.client {
|
|
|
2724
2731
|
}
|
|
2725
2732
|
interface SpacesResource {
|
|
2726
2733
|
/**
|
|
2727
|
-
* Creates a named space. Spaces grouped by topics
|
|
2728
|
-
*
|
|
2729
|
-
* `chat.spaces.create` or `chat.spaces` scope.
|
|
2734
|
+
* Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a space](https://developers.google.com/chat/api/guides/v1/spaces/create). Requires
|
|
2735
|
+
* [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.
|
|
2730
2736
|
*/
|
|
2731
2737
|
create(request: {
|
|
2732
2738
|
/** V1 error format. */
|
|
@@ -2887,7 +2893,9 @@ declare namespace gapi.client {
|
|
|
2887
2893
|
* Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `{person_id}` for the
|
|
2888
2894
|
* [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the
|
|
2889
2895
|
* [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person.resourceName` is
|
|
2890
|
-
* `people/123456789`, you can find a direct message with that person by using `users/123456789` as the `name`.
|
|
2896
|
+
* `people/123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a
|
|
2897
|
+
* user](https://developers.google.com/chat/api/guides/auth/users), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com`
|
|
2898
|
+
* is the email of the Google Chat user.
|
|
2891
2899
|
*/
|
|
2892
2900
|
name?:
|
|
2893
2901
|
string;
|
|
@@ -3124,15 +3132,15 @@ declare namespace gapi.client {
|
|
|
3124
3132
|
/**
|
|
3125
3133
|
* Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see
|
|
3126
3134
|
* [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the
|
|
3127
|
-
* `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}`
|
|
3128
|
-
* from the People API, or the `id` for the
|
|
3129
|
-
*
|
|
3130
|
-
*
|
|
3131
|
-
*
|
|
3132
|
-
*
|
|
3133
|
-
*
|
|
3134
|
-
*
|
|
3135
|
-
*
|
|
3135
|
+
* `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be
|
|
3136
|
+
* the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is
|
|
3137
|
+
* `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the
|
|
3138
|
+
* caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user,
|
|
3139
|
+
* specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the
|
|
3140
|
+
* calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a
|
|
3141
|
+
* member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists
|
|
3142
|
+
* between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies or guest access aren't
|
|
3143
|
+
* supported. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.
|
|
3136
3144
|
*/
|
|
3137
3145
|
setup(request: {
|
|
3138
3146
|
/** V1 error format. */
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -119,7 +119,7 @@ Uploads an attachment. For an example, see [Upload media as a file attachment](h
|
|
|
119
119
|
await gapi.client.chat.media.upload({ parent: "parent", });
|
|
120
120
|
|
|
121
121
|
/*
|
|
122
|
-
Creates a named space. Spaces grouped by topics
|
|
122
|
+
Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a space](https://developers.google.com/chat/api/guides/v1/spaces/create). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.
|
|
123
123
|
*/
|
|
124
124
|
await gapi.client.chat.spaces.create({ });
|
|
125
125
|
|
|
@@ -149,7 +149,7 @@ Updates a space. For an example, see [Update a space](https://developers.google.
|
|
|
149
149
|
await gapi.client.chat.spaces.patch({ name: "name", });
|
|
150
150
|
|
|
151
151
|
/*
|
|
152
|
-
Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}`
|
|
152
|
+
Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies or guest access aren't supported. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.
|
|
153
153
|
*/
|
|
154
154
|
await gapi.client.chat.spaces.setup({ });
|
|
155
155
|
```
|
package/tests.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
4
|
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
5
|
|
|
6
|
-
// Revision:
|
|
6
|
+
// Revision: 20230801
|
|
7
7
|
|
|
8
8
|
gapi.load('client', async () => {
|
|
9
9
|
/** now we can use gapi.client */
|
|
@@ -73,9 +73,8 @@ gapi.load('client', async () => {
|
|
|
73
73
|
filename: "Test string",
|
|
74
74
|
});
|
|
75
75
|
/**
|
|
76
|
-
* Creates a named space. Spaces grouped by topics
|
|
77
|
-
*
|
|
78
|
-
* `chat.spaces.create` or `chat.spaces` scope.
|
|
76
|
+
* Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a space](https://developers.google.com/chat/api/guides/v1/spaces/create). Requires [user
|
|
77
|
+
* authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.
|
|
79
78
|
*/
|
|
80
79
|
await gapi.client.chat.spaces.create({
|
|
81
80
|
requestId: "Test string",
|
|
@@ -159,15 +158,15 @@ gapi.load('client', async () => {
|
|
|
159
158
|
/**
|
|
160
159
|
* Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set
|
|
161
160
|
* up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the
|
|
162
|
-
* `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}`
|
|
163
|
-
* the People API, or the `id` for the
|
|
164
|
-
* `
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
161
|
+
* `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the
|
|
162
|
+
* `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is
|
|
163
|
+
* `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller
|
|
164
|
+
* blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify
|
|
165
|
+
* exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling
|
|
166
|
+
* app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a
|
|
167
|
+
* space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users,
|
|
168
|
+
* even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies or guest access aren't supported. Requires [user
|
|
169
|
+
* authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.
|
|
171
170
|
*/
|
|
172
171
|
await gapi.client.chat.spaces.setup({
|
|
173
172
|
}, {
|
|
@@ -210,10 +209,9 @@ gapi.load('client', async () => {
|
|
|
210
209
|
* invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user
|
|
211
210
|
* authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.memberships` (for human membership) or `chat.memberships.app` (for app membership) scope. To
|
|
212
211
|
* specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use
|
|
213
|
-
* `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}`
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* can add the user to the space by setting the `membership.member.name` to `users/123456789`.
|
|
212
|
+
* `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace
|
|
213
|
+
* organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person
|
|
214
|
+
* `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`.
|
|
217
215
|
*/
|
|
218
216
|
await gapi.client.chat.spaces.members.create({
|
|
219
217
|
parent: "Test string",
|