@google-apps/chat 0.1.0

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +202 -0
  3. package/README.md +220 -0
  4. package/build/protos/google/apps/card/v1/card.proto +1918 -0
  5. package/build/protos/google/chat/v1/action_status.proto +38 -0
  6. package/build/protos/google/chat/v1/annotation.proto +137 -0
  7. package/build/protos/google/chat/v1/attachment.proto +122 -0
  8. package/build/protos/google/chat/v1/chat_service.proto +493 -0
  9. package/build/protos/google/chat/v1/contextual_addon.proto +106 -0
  10. package/build/protos/google/chat/v1/deletion_metadata.proto +56 -0
  11. package/build/protos/google/chat/v1/group.proto +37 -0
  12. package/build/protos/google/chat/v1/history_state.proto +41 -0
  13. package/build/protos/google/chat/v1/matched_url.proto +35 -0
  14. package/build/protos/google/chat/v1/membership.proto +292 -0
  15. package/build/protos/google/chat/v1/message.proto +645 -0
  16. package/build/protos/google/chat/v1/reaction.proto +183 -0
  17. package/build/protos/google/chat/v1/slash_command.proto +32 -0
  18. package/build/protos/google/chat/v1/space.proto +360 -0
  19. package/build/protos/google/chat/v1/space_setup.proto +91 -0
  20. package/build/protos/google/chat/v1/user.proto +82 -0
  21. package/build/protos/google/chat/v1/widgets.proto +277 -0
  22. package/build/protos/protos.d.ts +20339 -0
  23. package/build/protos/protos.js +52506 -0
  24. package/build/protos/protos.json +5114 -0
  25. package/build/src/index.d.ts +11 -0
  26. package/build/src/index.js +28 -0
  27. package/build/src/index.js.map +1 -0
  28. package/build/src/v1/chat_service_client.d.ts +2194 -0
  29. package/build/src/v1/chat_service_client.js +1763 -0
  30. package/build/src/v1/chat_service_client.js.map +1 -0
  31. package/build/src/v1/chat_service_client_config.json +148 -0
  32. package/build/src/v1/index.d.ts +1 -0
  33. package/build/src/v1/index.js +23 -0
  34. package/build/src/v1/index.js.map +1 -0
  35. package/package.json +70 -0
@@ -0,0 +1,37 @@
1
+ // Copyright 2023 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.chat.v1;
18
+
19
+ option csharp_namespace = "Google.Chat.V1";
20
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
21
+ option java_multiple_files = true;
22
+ option java_outer_classname = "GroupProto";
23
+ option java_package = "com.google.chat.v1";
24
+ option php_namespace = "Google\\Chat\\V1";
25
+ option ruby_package = "Google::Chat::V1";
26
+
27
+ // A Google Group in Google Chat.
28
+ message Group {
29
+ // Resource name for a Google Group.
30
+ //
31
+ // Represents a
32
+ // [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in
33
+ // Cloud Identity Groups API.
34
+ //
35
+ // Format: groups/{group}
36
+ string name = 1;
37
+ }
@@ -0,0 +1,41 @@
1
+ // Copyright 2023 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.chat.v1;
18
+
19
+ option csharp_namespace = "Google.Chat.V1";
20
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
21
+ option java_multiple_files = true;
22
+ option java_outer_classname = "HistoryStateProto";
23
+ option java_package = "com.google.chat.v1";
24
+ option php_namespace = "Google\\Chat\\V1";
25
+ option ruby_package = "Google::Chat::V1";
26
+
27
+ // The history state for messages and spaces. Specifies how long messages and
28
+ // conversation threads are kept after creation.
29
+ enum HistoryState {
30
+ // Default value. Do not use.
31
+ HISTORY_STATE_UNSPECIFIED = 0;
32
+
33
+ // History off. [Messages and threads are kept for 24
34
+ // hours](https://support.google.com/chat/answer/7664687).
35
+ HISTORY_OFF = 1;
36
+
37
+ // History on. The organization's [Vault retention
38
+ // rules](https://support.google.com/vault/answer/7657597) specify for
39
+ // how long messages and threads are kept.
40
+ HISTORY_ON = 2;
41
+ }
@@ -0,0 +1,35 @@
1
+ // Copyright 2023 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.chat.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+
21
+ option csharp_namespace = "Google.Chat.V1";
22
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
23
+ option java_multiple_files = true;
24
+ option java_outer_classname = "MatchedUrlProto";
25
+ option java_package = "com.google.chat.v1";
26
+ option php_namespace = "Google\\Chat\\V1";
27
+ option ruby_package = "Google::Chat::V1";
28
+
29
+ // A matched URL in a Chat message. Chat apps can preview matched URLs. For more
30
+ // information, see [Preview
31
+ // links](https://developers.google.com/chat/how-tos/preview-links).
32
+ message MatchedUrl {
33
+ // Output only. The URL that was matched.
34
+ string url = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
35
+ }
@@ -0,0 +1,292 @@
1
+ // Copyright 2023 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.chat.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/chat/v1/group.proto";
22
+ import "google/chat/v1/user.proto";
23
+ import "google/protobuf/timestamp.proto";
24
+
25
+ option csharp_namespace = "Google.Chat.V1";
26
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
27
+ option java_multiple_files = true;
28
+ option java_outer_classname = "MembershipProto";
29
+ option java_package = "com.google.chat.v1";
30
+ option php_namespace = "Google\\Chat\\V1";
31
+ option ruby_package = "Google::Chat::V1";
32
+
33
+ // Represents a membership relation in Google Chat, such as whether a user or
34
+ // Chat app is invited to, part of, or absent from a space.
35
+ message Membership {
36
+ option (google.api.resource) = {
37
+ type: "chat.googleapis.com/Membership"
38
+ pattern: "spaces/{space}/members/{member}"
39
+ };
40
+
41
+ // Specifies the member's relationship with a space. Other membership states
42
+ // might be supported in the future.
43
+ enum MembershipState {
44
+ // Default value. Don't use.
45
+ MEMBERSHIP_STATE_UNSPECIFIED = 0;
46
+
47
+ // The user is added to the space, and can participate in the space.
48
+ JOINED = 1;
49
+
50
+ // The user is invited to join the space, but hasn't joined it.
51
+ INVITED = 2;
52
+
53
+ // The user doesn't belong to the space and doesn't have a pending
54
+ // invitation to join the space.
55
+ NOT_A_MEMBER = 3;
56
+ }
57
+
58
+ // Represents a user's permitted actions in a Chat space. More enum values
59
+ // might be added in the future.
60
+ enum MembershipRole {
61
+ // Default value. For [users][google.chat.v1.Membership.member]: they
62
+ // aren't a member of the space, but can be invited. For
63
+ // [Google Groups][google.chat.v1.Membership.group_member]: they're always
64
+ // assigned this role (other enum values might be used in the future).
65
+ MEMBERSHIP_ROLE_UNSPECIFIED = 0;
66
+
67
+ // A member of the space. The user has basic permissions, like sending
68
+ // messages to the space. In 1:1 and unnamed group conversations, everyone
69
+ // has this role.
70
+ ROLE_MEMBER = 1;
71
+
72
+ // A space manager. The user has all basic permissions plus administrative
73
+ // permissions that let them manage the space, like adding or removing
74
+ // members. Only supported in
75
+ // [SpaceType.SPACE][google.chat.v1.Space.SpaceType].
76
+ ROLE_MANAGER = 2;
77
+ }
78
+
79
+ // Resource name of the membership, assigned by the server.
80
+ //
81
+ // Format: `spaces/{space}/members/{member}`
82
+ string name = 1 [
83
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" }
84
+ ];
85
+
86
+ // Output only. State of the membership.
87
+ MembershipState state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
88
+
89
+ // Optional. User's role within a Chat space, which determines their permitted
90
+ // actions in the space.
91
+ //
92
+ // [Developer Preview](https://developers.google.com/workspace/preview):
93
+ // This field can only be used as input in `UpdateMembership`.
94
+ MembershipRole role = 7 [(google.api.field_behavior) = OPTIONAL];
95
+
96
+ // Member associated with this membership. Other member types might be
97
+ // supported in the future.
98
+ oneof memberType {
99
+ // The Google Chat user or app the membership corresponds to.
100
+ // If your Chat app [authenticates as a
101
+ // user](https://developers.google.com/chat/api/guides/auth/users), the
102
+ // output populates the
103
+ // [user](https://developers.google.com/chat/api/reference/rest/v1/User)
104
+ // `name` and `type`.
105
+ User member = 3;
106
+
107
+ // The Google Group the membership corresponds to.
108
+ // Only supports read operations. Other operations, like creating or
109
+ // updating a membership, aren't currently supported.
110
+ Group group_member = 5;
111
+ }
112
+
113
+ // Optional. Immutable. The creation time of the membership, such as when a
114
+ // member joined or was invited to join a space. This field is output only,
115
+ // except when used to import historical memberships in import mode spaces.
116
+ google.protobuf.Timestamp create_time = 4 [
117
+ (google.api.field_behavior) = IMMUTABLE,
118
+ (google.api.field_behavior) = OPTIONAL
119
+ ];
120
+
121
+ // Optional. Immutable. The deletion time of the membership, such as when a
122
+ // member left or was removed from a space. This field is output only, except
123
+ // when used to import historical memberships in import mode spaces.
124
+ google.protobuf.Timestamp delete_time = 8 [
125
+ (google.api.field_behavior) = IMMUTABLE,
126
+ (google.api.field_behavior) = OPTIONAL
127
+ ];
128
+ }
129
+
130
+ message CreateMembershipRequest {
131
+ // Required. The resource name of the space for which to create the
132
+ // membership.
133
+ //
134
+ // Format: spaces/{space}
135
+ string parent = 1 [
136
+ (google.api.field_behavior) = REQUIRED,
137
+ (google.api.resource_reference) = {
138
+ child_type: "chat.googleapis.com/Membership"
139
+ }
140
+ ];
141
+
142
+ // Required. The membership relation to create.
143
+ // The `memberType` field must contain a user with the `user.name` and
144
+ // `user.type` fields populated. The server will assign a resource name
145
+ // and overwrite anything specified.
146
+ // When a Chat app creates a membership relation for a human user, it must use
147
+ // the `chat.memberships` scope, set `user.type` to `HUMAN`, and set
148
+ // `user.name` with format `users/{user}`, where `{user}` can be the email
149
+ // address for the user. For users in the same Workspace organization `{user}`
150
+ // can also be the `id` of the
151
+ // [person](https://developers.google.com/people/api/rest/v1/people) from the
152
+ // People API, or the `id` for the user in the Directory API. For example, if
153
+ // the People API Person profile ID for `user@example.com` is `123456789`, you
154
+ // can add the user to the space by setting the `membership.member.name` to
155
+ // `users/user@example.com` or `users/123456789`. When a Chat app creates a
156
+ // membership relation for itself, it must use the `chat.memberships.app`
157
+ // scope, set `user.type` to `BOT`, and set `user.name` to `users/app`.
158
+ Membership membership = 2 [(google.api.field_behavior) = REQUIRED];
159
+ }
160
+
161
+ message ListMembershipsRequest {
162
+ // Required. The resource name of the space for which to fetch a membership
163
+ // list.
164
+ //
165
+ // Format: spaces/{space}
166
+ string parent = 1 [
167
+ (google.api.field_behavior) = REQUIRED,
168
+ (google.api.resource_reference) = {
169
+ child_type: "chat.googleapis.com/Membership"
170
+ }
171
+ ];
172
+
173
+ // Optional. The maximum number of memberships to return. The service might
174
+ // return fewer than this value.
175
+ //
176
+ // If unspecified, at most 100 memberships are returned.
177
+ //
178
+ // The maximum value is 1,000. If you use a value more than 1,000, it's
179
+ // automatically changed to 1,000.
180
+ //
181
+ // Negative values return an `INVALID_ARGUMENT` error.
182
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
183
+
184
+ // Optional. A page token, received from a previous call to list memberships.
185
+ // Provide this parameter to retrieve the subsequent page.
186
+ //
187
+ // When paginating, all other parameters provided should match the call that
188
+ // provided the page token. Passing different values to the other parameters
189
+ // might lead to unexpected results.
190
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
191
+
192
+ // Optional. A query filter.
193
+ //
194
+ // You can filter memberships by a member's role
195
+ // ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole))
196
+ // and type
197
+ // ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)).
198
+ //
199
+ // To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`.
200
+ //
201
+ // To filter by type, set `member.type` to `HUMAN` or `BOT`.
202
+ //
203
+ // To filter by both role and type, use the `AND` operator. To filter by
204
+ // either role or type, use the `OR` operator.
205
+ //
206
+ // For example, the following queries are valid:
207
+ //
208
+ // ```
209
+ // role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
210
+ // member.type = "HUMAN" AND role = "ROLE_MANAGER"
211
+ // ```
212
+ //
213
+ // The following queries are invalid:
214
+ //
215
+ // ```
216
+ // member.type = "HUMAN" AND member.type = "BOT"
217
+ // role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"
218
+ // ```
219
+ //
220
+ // Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
221
+ // error.
222
+ string filter = 5 [(google.api.field_behavior) = OPTIONAL];
223
+
224
+ // Optional. When `true`, also returns memberships associated with a
225
+ // [Google Group][google.chat.v1.Membership.group_member], in
226
+ // addition to other types of memberships. If a
227
+ // [filter][google.chat.v1.ListMembershipsRequest.filter] is set,
228
+ // [Google Group][google.chat.v1.Membership.group_member]
229
+ // memberships that don't match the filter criteria aren't returned.
230
+ bool show_groups = 6 [(google.api.field_behavior) = OPTIONAL];
231
+
232
+ // Optional. When `true`, also returns memberships associated with
233
+ // [invited][google.chat.v1.Membership.MembershipState.INVITED] members, in
234
+ // addition to other types of memberships. If a
235
+ // filter is set,
236
+ // [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships
237
+ // that don't match the filter criteria aren't returned.
238
+ //
239
+ // Currently requires [user
240
+ // authentication](https://developers.google.com/chat/api/guides/auth/users).
241
+ bool show_invited = 7 [(google.api.field_behavior) = OPTIONAL];
242
+ }
243
+
244
+ message ListMembershipsResponse {
245
+ // Unordered list. List of memberships in the requested (or first) page.
246
+ repeated Membership memberships = 1
247
+ [(google.api.field_behavior) = UNORDERED_LIST];
248
+
249
+ // A token that you can send as `pageToken` to retrieve the next page of
250
+ // results. If empty, there are no subsequent pages.
251
+ string next_page_token = 2;
252
+ }
253
+
254
+ message GetMembershipRequest {
255
+ // Required. Resource name of the membership to retrieve.
256
+ //
257
+ // To get the app's own membership, you can optionally use
258
+ // `spaces/{space}/members/app`.
259
+ //
260
+ // Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`
261
+ //
262
+ // When [authenticated as a
263
+ // user](https://developers.google.com/chat/api/guides/auth/users), you can
264
+ // use the user's email as an alias for `{member}`. For example,
265
+ // `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
266
+ // email of the Google Chat user.
267
+ string name = 1 [
268
+ (google.api.field_behavior) = REQUIRED,
269
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" }
270
+ ];
271
+ }
272
+
273
+ message DeleteMembershipRequest {
274
+ // Required. Resource name of the membership to delete. Chat apps can delete
275
+ // human users' or their own memberships. Chat apps can't delete other apps'
276
+ // memberships.
277
+ //
278
+ // When deleting a human membership, requires the `chat.memberships` scope and
279
+ // `spaces/{space}/members/{member}` format. You can use the email as an
280
+ // alias for `{member}`. For example,
281
+ // `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
282
+ // email of the Google Chat user.
283
+ //
284
+ // When deleting an app membership, requires the `chat.memberships.app` scope
285
+ // and `spaces/{space}/members/app` format.
286
+ //
287
+ // Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`.
288
+ string name = 1 [
289
+ (google.api.field_behavior) = REQUIRED,
290
+ (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" }
291
+ ];
292
+ }