@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.
- package/CHANGELOG.md +8 -0
- package/LICENSE +202 -0
- package/README.md +220 -0
- package/build/protos/google/apps/card/v1/card.proto +1918 -0
- package/build/protos/google/chat/v1/action_status.proto +38 -0
- package/build/protos/google/chat/v1/annotation.proto +137 -0
- package/build/protos/google/chat/v1/attachment.proto +122 -0
- package/build/protos/google/chat/v1/chat_service.proto +493 -0
- package/build/protos/google/chat/v1/contextual_addon.proto +106 -0
- package/build/protos/google/chat/v1/deletion_metadata.proto +56 -0
- package/build/protos/google/chat/v1/group.proto +37 -0
- package/build/protos/google/chat/v1/history_state.proto +41 -0
- package/build/protos/google/chat/v1/matched_url.proto +35 -0
- package/build/protos/google/chat/v1/membership.proto +292 -0
- package/build/protos/google/chat/v1/message.proto +645 -0
- package/build/protos/google/chat/v1/reaction.proto +183 -0
- package/build/protos/google/chat/v1/slash_command.proto +32 -0
- package/build/protos/google/chat/v1/space.proto +360 -0
- package/build/protos/google/chat/v1/space_setup.proto +91 -0
- package/build/protos/google/chat/v1/user.proto +82 -0
- package/build/protos/google/chat/v1/widgets.proto +277 -0
- package/build/protos/protos.d.ts +20339 -0
- package/build/protos/protos.js +52506 -0
- package/build/protos/protos.json +5114 -0
- package/build/src/index.d.ts +11 -0
- package/build/src/index.js +28 -0
- package/build/src/index.js.map +1 -0
- package/build/src/v1/chat_service_client.d.ts +2194 -0
- package/build/src/v1/chat_service_client.js +1763 -0
- package/build/src/v1/chat_service_client.js.map +1 -0
- package/build/src/v1/chat_service_client_config.json +148 -0
- package/build/src/v1/index.d.ts +1 -0
- package/build/src/v1/index.js +23 -0
- package/build/src/v1/index.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,1918 @@
|
|
|
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.apps.card.v1;
|
|
18
|
+
|
|
19
|
+
import "google/type/color.proto";
|
|
20
|
+
|
|
21
|
+
option csharp_namespace = "Google.Apps.Card.V1";
|
|
22
|
+
option go_package = "google.golang.org/genproto/googleapis/apps/card/v1;card";
|
|
23
|
+
option java_multiple_files = true;
|
|
24
|
+
option java_outer_classname = "CardProto";
|
|
25
|
+
option java_package = "com.google.apps.card.v1";
|
|
26
|
+
option php_namespace = "Google\\Apps\\Card\\V1";
|
|
27
|
+
option ruby_package = "Google::Apps::Card::V1";
|
|
28
|
+
|
|
29
|
+
// A card interface displayed in a Google Chat message or Google Workspace
|
|
30
|
+
// Add-on.
|
|
31
|
+
//
|
|
32
|
+
// Cards support a defined layout, interactive UI elements like buttons, and
|
|
33
|
+
// rich media like images. Use cards to present detailed information,
|
|
34
|
+
// gather information from users, and guide users to take a next step.
|
|
35
|
+
//
|
|
36
|
+
// [Card builder](https://addons.gsuite.google.com/uikit/builder)
|
|
37
|
+
//
|
|
38
|
+
// To learn how
|
|
39
|
+
// to build cards, see the following documentation:
|
|
40
|
+
//
|
|
41
|
+
// * For Google Chat apps, see [Design dynamic, interactive, and consistent UIs
|
|
42
|
+
// with cards](https://developers.google.com/chat/ui).
|
|
43
|
+
// * For Google Workspace Add-ons, see [Card-based
|
|
44
|
+
// interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards).
|
|
45
|
+
//
|
|
46
|
+
// **Example: Card message for a Google Chat app**
|
|
47
|
+
//
|
|
48
|
+
// 
|
|
50
|
+
//
|
|
51
|
+
// To create the sample card message in Google Chat, use the following JSON:
|
|
52
|
+
//
|
|
53
|
+
// ```
|
|
54
|
+
// {
|
|
55
|
+
// "cardsV2": [
|
|
56
|
+
// {
|
|
57
|
+
// "cardId": "unique-card-id",
|
|
58
|
+
// "card": {
|
|
59
|
+
// "header": {
|
|
60
|
+
// "title": "Sasha",
|
|
61
|
+
// "subtitle": "Software Engineer",
|
|
62
|
+
// "imageUrl":
|
|
63
|
+
// "https://developers.google.com/chat/images/quickstart-app-avatar.png",
|
|
64
|
+
// "imageType": "CIRCLE",
|
|
65
|
+
// "imageAltText": "Avatar for Sasha",
|
|
66
|
+
// },
|
|
67
|
+
// "sections": [
|
|
68
|
+
// {
|
|
69
|
+
// "header": "Contact Info",
|
|
70
|
+
// "collapsible": true,
|
|
71
|
+
// "uncollapsibleWidgetsCount": 1,
|
|
72
|
+
// "widgets": [
|
|
73
|
+
// {
|
|
74
|
+
// "decoratedText": {
|
|
75
|
+
// "startIcon": {
|
|
76
|
+
// "knownIcon": "EMAIL",
|
|
77
|
+
// },
|
|
78
|
+
// "text": "sasha@example.com",
|
|
79
|
+
// }
|
|
80
|
+
// },
|
|
81
|
+
// {
|
|
82
|
+
// "decoratedText": {
|
|
83
|
+
// "startIcon": {
|
|
84
|
+
// "knownIcon": "PERSON",
|
|
85
|
+
// },
|
|
86
|
+
// "text": "<font color=\"#80e27e\">Online</font>",
|
|
87
|
+
// },
|
|
88
|
+
// },
|
|
89
|
+
// {
|
|
90
|
+
// "decoratedText": {
|
|
91
|
+
// "startIcon": {
|
|
92
|
+
// "knownIcon": "PHONE",
|
|
93
|
+
// },
|
|
94
|
+
// "text": "+1 (555) 555-1234",
|
|
95
|
+
// }
|
|
96
|
+
// },
|
|
97
|
+
// {
|
|
98
|
+
// "buttonList": {
|
|
99
|
+
// "buttons": [
|
|
100
|
+
// {
|
|
101
|
+
// "text": "Share",
|
|
102
|
+
// "onClick": {
|
|
103
|
+
// "openLink": {
|
|
104
|
+
// "url": "https://example.com/share",
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
107
|
+
// },
|
|
108
|
+
// {
|
|
109
|
+
// "text": "Edit",
|
|
110
|
+
// "onClick": {
|
|
111
|
+
// "action": {
|
|
112
|
+
// "function": "goToView",
|
|
113
|
+
// "parameters": [
|
|
114
|
+
// {
|
|
115
|
+
// "key": "viewType",
|
|
116
|
+
// "value": "EDIT",
|
|
117
|
+
// }
|
|
118
|
+
// ],
|
|
119
|
+
// }
|
|
120
|
+
// }
|
|
121
|
+
// },
|
|
122
|
+
// ],
|
|
123
|
+
// }
|
|
124
|
+
// },
|
|
125
|
+
// ],
|
|
126
|
+
// },
|
|
127
|
+
// ],
|
|
128
|
+
// },
|
|
129
|
+
// }
|
|
130
|
+
// ],
|
|
131
|
+
// }
|
|
132
|
+
// ```
|
|
133
|
+
message Card {
|
|
134
|
+
// Represents a card header. For an example in Google Chat apps, see [Card
|
|
135
|
+
// header](https://developers.google.com/chat/ui/widgets/card-header).
|
|
136
|
+
//
|
|
137
|
+
// [Google Workspace Add-ons and Chat
|
|
138
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
139
|
+
message CardHeader {
|
|
140
|
+
// Required. The title of the card header.
|
|
141
|
+
// The header has a fixed height: if both a
|
|
142
|
+
// title and subtitle are specified, each takes up one line. If only the
|
|
143
|
+
// title is specified, it takes up both lines.
|
|
144
|
+
string title = 1;
|
|
145
|
+
|
|
146
|
+
// The subtitle of the card header. If specified, appears on its own line
|
|
147
|
+
// below the `title`.
|
|
148
|
+
string subtitle = 2;
|
|
149
|
+
|
|
150
|
+
// The shape used to crop the image.
|
|
151
|
+
//
|
|
152
|
+
// [Google Workspace Add-ons and Chat
|
|
153
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
154
|
+
Widget.ImageType image_type = 3;
|
|
155
|
+
|
|
156
|
+
// The HTTPS URL of the image in the card header.
|
|
157
|
+
string image_url = 4;
|
|
158
|
+
|
|
159
|
+
// The alternative text of this image that's used for accessibility.
|
|
160
|
+
string image_alt_text = 5;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// A section contains a collection of widgets that are rendered
|
|
164
|
+
// vertically in the order that they're specified.
|
|
165
|
+
//
|
|
166
|
+
// [Google Workspace Add-ons and Chat
|
|
167
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
168
|
+
message Section {
|
|
169
|
+
// Text that appears at the top of a section.
|
|
170
|
+
// Supports simple HTML formatted text. For more information
|
|
171
|
+
// about formatting text, see
|
|
172
|
+
// [Formatting text in Google Chat
|
|
173
|
+
// apps](https://developers.google.com/chat/format-messages#card-formatting)
|
|
174
|
+
// and
|
|
175
|
+
// [Formatting
|
|
176
|
+
// text in Google Workspace
|
|
177
|
+
// Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
|
|
178
|
+
string header = 1;
|
|
179
|
+
|
|
180
|
+
// All the widgets in the section.
|
|
181
|
+
// Must contain at least one widget.
|
|
182
|
+
repeated Widget widgets = 2;
|
|
183
|
+
|
|
184
|
+
// Indicates whether this section is collapsible.
|
|
185
|
+
//
|
|
186
|
+
// Collapsible sections hide some or all widgets, but users can expand the
|
|
187
|
+
// section to reveal the hidden widgets by clicking **Show more**. Users
|
|
188
|
+
// can hide the widgets again by clicking **Show less**.
|
|
189
|
+
//
|
|
190
|
+
// To determine which widgets are hidden, specify
|
|
191
|
+
// `uncollapsibleWidgetsCount`.
|
|
192
|
+
bool collapsible = 5;
|
|
193
|
+
|
|
194
|
+
// The number of uncollapsible widgets which remain visible even when a
|
|
195
|
+
// section is collapsed.
|
|
196
|
+
//
|
|
197
|
+
// For example, when a section
|
|
198
|
+
// contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`,
|
|
199
|
+
// the first two widgets are always shown and the last three are collapsed
|
|
200
|
+
// by default. The `uncollapsibleWidgetsCount` is taken into account only
|
|
201
|
+
// when `collapsible` is `true`.
|
|
202
|
+
int32 uncollapsible_widgets_count = 6;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// The divider style of a card. Currently only used for dividers betweens card
|
|
206
|
+
// sections.
|
|
207
|
+
//
|
|
208
|
+
// [Google Workspace Add-ons and Chat
|
|
209
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
210
|
+
enum DividerStyle {
|
|
211
|
+
// Don't use. Unspecified.
|
|
212
|
+
DIVIDER_STYLE_UNSPECIFIED = 0;
|
|
213
|
+
|
|
214
|
+
// Default option. Render a solid divider between sections.
|
|
215
|
+
SOLID_DIVIDER = 1;
|
|
216
|
+
|
|
217
|
+
// If set, no divider is rendered between sections.
|
|
218
|
+
NO_DIVIDER = 2;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// A card action is the action associated with the card. For example,
|
|
222
|
+
// an invoice card might include actions such as delete invoice, email
|
|
223
|
+
// invoice, or open the invoice in a browser.
|
|
224
|
+
//
|
|
225
|
+
// [Google Workspace
|
|
226
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
227
|
+
message CardAction {
|
|
228
|
+
// The label that displays as the action menu item.
|
|
229
|
+
string action_label = 1;
|
|
230
|
+
|
|
231
|
+
// The `onClick` action for this action item.
|
|
232
|
+
OnClick on_click = 2;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// A persistent (sticky) footer that that appears at the bottom of the card.
|
|
236
|
+
//
|
|
237
|
+
// Setting `fixedFooter` without specifying a `primaryButton` or a
|
|
238
|
+
// `secondaryButton` causes an error.
|
|
239
|
+
//
|
|
240
|
+
// For Chat apps, you can use fixed footers in
|
|
241
|
+
// [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not
|
|
242
|
+
// [card
|
|
243
|
+
// messages](https://developers.google.com/chat/api/guides/v1/messages/create#create).
|
|
244
|
+
// For an example in Google Chat apps, see [Card
|
|
245
|
+
// footer](https://developers.google.com/chat/ui/widgets/card-fixed-footer).
|
|
246
|
+
//
|
|
247
|
+
// [Google Workspace Add-ons and Chat
|
|
248
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
249
|
+
message CardFixedFooter {
|
|
250
|
+
// The primary button of the fixed footer. The button must be a text button
|
|
251
|
+
// with text and color set.
|
|
252
|
+
Button primary_button = 1;
|
|
253
|
+
|
|
254
|
+
// The secondary button of the fixed footer. The button must be a text
|
|
255
|
+
// button with text and color set.
|
|
256
|
+
// If `secondaryButton` is set, you must also set `primaryButton`.
|
|
257
|
+
Button secondary_button = 2;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// In Google Workspace Add-ons,
|
|
261
|
+
// determines how a card is displayed.
|
|
262
|
+
//
|
|
263
|
+
// [Google Workspace
|
|
264
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
265
|
+
enum DisplayStyle {
|
|
266
|
+
// Don't use. Unspecified.
|
|
267
|
+
DISPLAY_STYLE_UNSPECIFIED = 0;
|
|
268
|
+
|
|
269
|
+
// The header of the card appears at the bottom of the
|
|
270
|
+
// sidebar, partially covering the current top card of the stack. Clicking
|
|
271
|
+
// the header pops the card into the card stack. If the card has no header,
|
|
272
|
+
// a generated header is used instead.
|
|
273
|
+
PEEK = 1;
|
|
274
|
+
|
|
275
|
+
// Default value. The card is shown by replacing the view of the top card in
|
|
276
|
+
// the card stack.
|
|
277
|
+
REPLACE = 2;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// The header of the card. A header usually contains a leading image and a
|
|
281
|
+
// title. Headers always appear at the top of a card.
|
|
282
|
+
CardHeader header = 1;
|
|
283
|
+
|
|
284
|
+
// Contains a collection of widgets. Each section has its own, optional
|
|
285
|
+
// header. Sections are visually separated by a line divider. For an example
|
|
286
|
+
// in Google Chat apps, see [Card
|
|
287
|
+
// section](https://developers.google.com/chat/ui/widgets/card-section).
|
|
288
|
+
repeated Section sections = 2;
|
|
289
|
+
|
|
290
|
+
// The divider style between sections.
|
|
291
|
+
DividerStyle section_divider_style = 9;
|
|
292
|
+
|
|
293
|
+
// The card's actions. Actions are added to the card's toolbar menu.
|
|
294
|
+
//
|
|
295
|
+
// [Google Workspace
|
|
296
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
297
|
+
//
|
|
298
|
+
// For example, the following JSON constructs a card action menu with
|
|
299
|
+
// `Settings` and `Send Feedback` options:
|
|
300
|
+
//
|
|
301
|
+
// ```
|
|
302
|
+
// "card_actions": [
|
|
303
|
+
// {
|
|
304
|
+
// "actionLabel": "Settings",
|
|
305
|
+
// "onClick": {
|
|
306
|
+
// "action": {
|
|
307
|
+
// "functionName": "goToView",
|
|
308
|
+
// "parameters": [
|
|
309
|
+
// {
|
|
310
|
+
// "key": "viewType",
|
|
311
|
+
// "value": "SETTING"
|
|
312
|
+
// }
|
|
313
|
+
// ],
|
|
314
|
+
// "loadIndicator": "LoadIndicator.SPINNER"
|
|
315
|
+
// }
|
|
316
|
+
// }
|
|
317
|
+
// },
|
|
318
|
+
// {
|
|
319
|
+
// "actionLabel": "Send Feedback",
|
|
320
|
+
// "onClick": {
|
|
321
|
+
// "openLink": {
|
|
322
|
+
// "url": "https://example.com/feedback"
|
|
323
|
+
// }
|
|
324
|
+
// }
|
|
325
|
+
// }
|
|
326
|
+
// ]
|
|
327
|
+
// ```
|
|
328
|
+
repeated CardAction card_actions = 3;
|
|
329
|
+
|
|
330
|
+
// Name of the card. Used as a card identifier in card navigation.
|
|
331
|
+
//
|
|
332
|
+
// [Google Workspace
|
|
333
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
334
|
+
string name = 4;
|
|
335
|
+
|
|
336
|
+
// The fixed footer shown at the bottom of this card.
|
|
337
|
+
//
|
|
338
|
+
// Setting `fixedFooter` without specifying a `primaryButton` or a
|
|
339
|
+
// `secondaryButton` causes an error. For Chat apps, you can use fixed footers
|
|
340
|
+
// in
|
|
341
|
+
// [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not
|
|
342
|
+
// [card
|
|
343
|
+
// messages](https://developers.google.com/chat/api/guides/v1/messages/create#create).
|
|
344
|
+
//
|
|
345
|
+
// [Google Workspace Add-ons and Chat
|
|
346
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
347
|
+
CardFixedFooter fixed_footer = 5;
|
|
348
|
+
|
|
349
|
+
// In Google Workspace Add-ons, sets the display properties of the
|
|
350
|
+
// `peekCardHeader`.
|
|
351
|
+
//
|
|
352
|
+
// [Google Workspace
|
|
353
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
354
|
+
DisplayStyle display_style = 6;
|
|
355
|
+
|
|
356
|
+
// When displaying contextual content, the peek card header acts as a
|
|
357
|
+
// placeholder so that the user can navigate forward between the homepage
|
|
358
|
+
// cards and the contextual cards.
|
|
359
|
+
//
|
|
360
|
+
// [Google Workspace
|
|
361
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
362
|
+
CardHeader peek_card_header = 7;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Each card is made up of widgets.
|
|
366
|
+
//
|
|
367
|
+
// A widget is a composite object that can represent one of text, images,
|
|
368
|
+
// buttons, and other object types.
|
|
369
|
+
message Widget {
|
|
370
|
+
// The shape used to crop the image.
|
|
371
|
+
//
|
|
372
|
+
// [Google Workspace Add-ons and Chat
|
|
373
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
374
|
+
enum ImageType {
|
|
375
|
+
// Default value. Applies a square mask to the image. For example, a 4x3
|
|
376
|
+
// image becomes 3x3.
|
|
377
|
+
SQUARE = 0;
|
|
378
|
+
|
|
379
|
+
// Applies a circular mask to the image. For example, a 4x3 image becomes a
|
|
380
|
+
// circle with a diameter of 3.
|
|
381
|
+
CIRCLE = 1;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// Specifies whether widgets align to the left, right, or center of a column.
|
|
385
|
+
//
|
|
386
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
387
|
+
enum HorizontalAlignment {
|
|
388
|
+
// Don't use. Unspecified.
|
|
389
|
+
HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0;
|
|
390
|
+
|
|
391
|
+
// Default value. Aligns widgets to the start position of the column. For
|
|
392
|
+
// left-to-right layouts, aligns to the left. For right-to-left layouts,
|
|
393
|
+
// aligns to the right.
|
|
394
|
+
START = 1;
|
|
395
|
+
|
|
396
|
+
// Aligns widgets to the center of the column.
|
|
397
|
+
CENTER = 2;
|
|
398
|
+
|
|
399
|
+
// Aligns widgets to the end position of the column. For left-to-right
|
|
400
|
+
// layouts, aligns widgets to the right. For right-to-left layouts, aligns
|
|
401
|
+
// widgets to the left.
|
|
402
|
+
END = 3;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// A widget can only have one of the following items. You can use multiple
|
|
406
|
+
// widget fields to display more items.
|
|
407
|
+
oneof data {
|
|
408
|
+
// Displays a text paragraph. Supports simple HTML formatted text. For more
|
|
409
|
+
// information about formatting text, see
|
|
410
|
+
// [Formatting text in Google Chat
|
|
411
|
+
// apps](https://developers.google.com/chat/format-messages#card-formatting)
|
|
412
|
+
// and
|
|
413
|
+
// [Formatting
|
|
414
|
+
// text in Google Workspace
|
|
415
|
+
// Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
|
|
416
|
+
//
|
|
417
|
+
// For example, the following JSON creates a bolded text:
|
|
418
|
+
// ```
|
|
419
|
+
// "textParagraph": {
|
|
420
|
+
// "text": " <b>bold text</b>"
|
|
421
|
+
// }
|
|
422
|
+
// ```
|
|
423
|
+
TextParagraph text_paragraph = 1;
|
|
424
|
+
|
|
425
|
+
// Displays an image.
|
|
426
|
+
//
|
|
427
|
+
// For example, the following JSON creates an image with alternative text:
|
|
428
|
+
// ```
|
|
429
|
+
// "image": {
|
|
430
|
+
// "imageUrl":
|
|
431
|
+
// "https://developers.google.com/chat/images/quickstart-app-avatar.png",
|
|
432
|
+
// "altText": "Chat app avatar"
|
|
433
|
+
// }
|
|
434
|
+
// ```
|
|
435
|
+
Image image = 2;
|
|
436
|
+
|
|
437
|
+
// Displays a decorated text item.
|
|
438
|
+
//
|
|
439
|
+
// For example, the following JSON creates a decorated text widget showing
|
|
440
|
+
// email address:
|
|
441
|
+
//
|
|
442
|
+
// ```
|
|
443
|
+
// "decoratedText": {
|
|
444
|
+
// "icon": {
|
|
445
|
+
// "knownIcon": "EMAIL"
|
|
446
|
+
// },
|
|
447
|
+
// "topLabel": "Email Address",
|
|
448
|
+
// "text": "sasha@example.com",
|
|
449
|
+
// "bottomLabel": "This is a new Email address!",
|
|
450
|
+
// "switchControl": {
|
|
451
|
+
// "name": "has_send_welcome_email_to_sasha",
|
|
452
|
+
// "selected": false,
|
|
453
|
+
// "controlType": "CHECKBOX"
|
|
454
|
+
// }
|
|
455
|
+
// }
|
|
456
|
+
// ```
|
|
457
|
+
DecoratedText decorated_text = 3;
|
|
458
|
+
|
|
459
|
+
// A list of buttons.
|
|
460
|
+
//
|
|
461
|
+
// For example, the following JSON creates two buttons. The first
|
|
462
|
+
// is a blue text button and the second is an image button that opens a
|
|
463
|
+
// link:
|
|
464
|
+
// ```
|
|
465
|
+
// "buttonList": {
|
|
466
|
+
// "buttons": [
|
|
467
|
+
// {
|
|
468
|
+
// "text": "Edit",
|
|
469
|
+
// "color": {
|
|
470
|
+
// "red": 0,
|
|
471
|
+
// "green": 0,
|
|
472
|
+
// "blue": 1,
|
|
473
|
+
// "alpha": 1
|
|
474
|
+
// },
|
|
475
|
+
// "disabled": true,
|
|
476
|
+
// },
|
|
477
|
+
// {
|
|
478
|
+
// "icon": {
|
|
479
|
+
// "knownIcon": "INVITE",
|
|
480
|
+
// "altText": "check calendar"
|
|
481
|
+
// },
|
|
482
|
+
// "onClick": {
|
|
483
|
+
// "openLink": {
|
|
484
|
+
// "url": "https://example.com/calendar"
|
|
485
|
+
// }
|
|
486
|
+
// }
|
|
487
|
+
// }
|
|
488
|
+
// ]
|
|
489
|
+
// }
|
|
490
|
+
// ```
|
|
491
|
+
ButtonList button_list = 4;
|
|
492
|
+
|
|
493
|
+
// Displays a text box that users can type into.
|
|
494
|
+
//
|
|
495
|
+
// For example, the following JSON creates a text input for an email
|
|
496
|
+
// address:
|
|
497
|
+
//
|
|
498
|
+
// ```
|
|
499
|
+
// "textInput": {
|
|
500
|
+
// "name": "mailing_address",
|
|
501
|
+
// "label": "Mailing Address"
|
|
502
|
+
// }
|
|
503
|
+
// ```
|
|
504
|
+
//
|
|
505
|
+
// As another example, the following JSON creates a text input for a
|
|
506
|
+
// programming language with static suggestions:
|
|
507
|
+
// ```
|
|
508
|
+
// "textInput": {
|
|
509
|
+
// "name": "preferred_programing_language",
|
|
510
|
+
// "label": "Preferred Language",
|
|
511
|
+
// "initialSuggestions": {
|
|
512
|
+
// "items": [
|
|
513
|
+
// {
|
|
514
|
+
// "text": "C++"
|
|
515
|
+
// },
|
|
516
|
+
// {
|
|
517
|
+
// "text": "Java"
|
|
518
|
+
// },
|
|
519
|
+
// {
|
|
520
|
+
// "text": "JavaScript"
|
|
521
|
+
// },
|
|
522
|
+
// {
|
|
523
|
+
// "text": "Python"
|
|
524
|
+
// }
|
|
525
|
+
// ]
|
|
526
|
+
// }
|
|
527
|
+
// }
|
|
528
|
+
// ```
|
|
529
|
+
TextInput text_input = 5;
|
|
530
|
+
|
|
531
|
+
// Displays a selection control that lets users select items. Selection
|
|
532
|
+
// controls can be checkboxes, radio buttons, switches, or dropdown menus.
|
|
533
|
+
//
|
|
534
|
+
// For example, the following JSON creates a dropdown menu that lets users
|
|
535
|
+
// choose a size:
|
|
536
|
+
//
|
|
537
|
+
// ```
|
|
538
|
+
// "selectionInput": {
|
|
539
|
+
// "name": "size",
|
|
540
|
+
// "label": "Size"
|
|
541
|
+
// "type": "DROPDOWN",
|
|
542
|
+
// "items": [
|
|
543
|
+
// {
|
|
544
|
+
// "text": "S",
|
|
545
|
+
// "value": "small",
|
|
546
|
+
// "selected": false
|
|
547
|
+
// },
|
|
548
|
+
// {
|
|
549
|
+
// "text": "M",
|
|
550
|
+
// "value": "medium",
|
|
551
|
+
// "selected": true
|
|
552
|
+
// },
|
|
553
|
+
// {
|
|
554
|
+
// "text": "L",
|
|
555
|
+
// "value": "large",
|
|
556
|
+
// "selected": false
|
|
557
|
+
// },
|
|
558
|
+
// {
|
|
559
|
+
// "text": "XL",
|
|
560
|
+
// "value": "extra_large",
|
|
561
|
+
// "selected": false
|
|
562
|
+
// }
|
|
563
|
+
// ]
|
|
564
|
+
// }
|
|
565
|
+
// ```
|
|
566
|
+
SelectionInput selection_input = 6;
|
|
567
|
+
|
|
568
|
+
// Displays a widget that lets users input a date, time, or date and time.
|
|
569
|
+
//
|
|
570
|
+
// For example, the following JSON creates a date time picker to schedule an
|
|
571
|
+
// appointment:
|
|
572
|
+
//
|
|
573
|
+
//
|
|
574
|
+
// ```
|
|
575
|
+
// "dateTimePicker": {
|
|
576
|
+
// "name": "appointment_time",
|
|
577
|
+
// "label": "Book your appointment at:",
|
|
578
|
+
// "type": "DATE_AND_TIME",
|
|
579
|
+
// "valueMsEpoch": "796435200000"
|
|
580
|
+
// }
|
|
581
|
+
// ```
|
|
582
|
+
DateTimePicker date_time_picker = 7;
|
|
583
|
+
|
|
584
|
+
// Displays a horizontal line divider between widgets.
|
|
585
|
+
//
|
|
586
|
+
// For example, the following JSON creates a divider:
|
|
587
|
+
// ```
|
|
588
|
+
// "divider": {
|
|
589
|
+
// }
|
|
590
|
+
// ```
|
|
591
|
+
Divider divider = 9;
|
|
592
|
+
|
|
593
|
+
// Displays a grid with a collection of items.
|
|
594
|
+
//
|
|
595
|
+
// A grid supports any number of columns and items. The number of rows is
|
|
596
|
+
// determined by the upper bounds of the number items divided by the number
|
|
597
|
+
// of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11
|
|
598
|
+
// items and 2 columns has 6 rows.
|
|
599
|
+
//
|
|
600
|
+
// [Google Workspace Add-ons and
|
|
601
|
+
// Chat apps](https://developers.google.com/workspace/extend):
|
|
602
|
+
//
|
|
603
|
+
// For example, the following JSON creates a 2 column grid with a single
|
|
604
|
+
// item:
|
|
605
|
+
//
|
|
606
|
+
// ```
|
|
607
|
+
// "grid": {
|
|
608
|
+
// "title": "A fine collection of items",
|
|
609
|
+
// "columnCount": 2,
|
|
610
|
+
// "borderStyle": {
|
|
611
|
+
// "type": "STROKE",
|
|
612
|
+
// "cornerRadius": 4
|
|
613
|
+
// },
|
|
614
|
+
// "items": [
|
|
615
|
+
// {
|
|
616
|
+
// "image": {
|
|
617
|
+
// "imageUri": "https://www.example.com/image.png",
|
|
618
|
+
// "cropStyle": {
|
|
619
|
+
// "type": "SQUARE"
|
|
620
|
+
// },
|
|
621
|
+
// "borderStyle": {
|
|
622
|
+
// "type": "STROKE"
|
|
623
|
+
// }
|
|
624
|
+
// },
|
|
625
|
+
// "title": "An item",
|
|
626
|
+
// "textAlignment": "CENTER"
|
|
627
|
+
// }
|
|
628
|
+
// ],
|
|
629
|
+
// "onClick": {
|
|
630
|
+
// "openLink": {
|
|
631
|
+
// "url": "https://www.example.com"
|
|
632
|
+
// }
|
|
633
|
+
// }
|
|
634
|
+
// }
|
|
635
|
+
// ```
|
|
636
|
+
Grid grid = 10;
|
|
637
|
+
|
|
638
|
+
// Displays up to 2 columns.
|
|
639
|
+
//
|
|
640
|
+
// To include more than 2 columns, or to use rows, use the `Grid` widget.
|
|
641
|
+
//
|
|
642
|
+
// For example, the following JSON creates 2 columns that each contain
|
|
643
|
+
// text paragraphs:
|
|
644
|
+
//
|
|
645
|
+
// ```
|
|
646
|
+
// "columns": {
|
|
647
|
+
// "columnItems": [
|
|
648
|
+
// {
|
|
649
|
+
// "horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
|
|
650
|
+
// "horizontalAlignment": "CENTER",
|
|
651
|
+
// "verticalAlignment": "CENTER",
|
|
652
|
+
// "widgets": [
|
|
653
|
+
// {
|
|
654
|
+
// "textParagraph": {
|
|
655
|
+
// "text": "First column text paragraph"
|
|
656
|
+
// }
|
|
657
|
+
// }
|
|
658
|
+
// ]
|
|
659
|
+
// },
|
|
660
|
+
// {
|
|
661
|
+
// "horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
|
|
662
|
+
// "horizontalAlignment": "CENTER",
|
|
663
|
+
// "verticalAlignment": "CENTER",
|
|
664
|
+
// "widgets": [
|
|
665
|
+
// {
|
|
666
|
+
// "textParagraph": {
|
|
667
|
+
// "text": "Second column text paragraph"
|
|
668
|
+
// }
|
|
669
|
+
// }
|
|
670
|
+
// ]
|
|
671
|
+
// }
|
|
672
|
+
// ]
|
|
673
|
+
// }
|
|
674
|
+
// ```
|
|
675
|
+
Columns columns = 11;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// Specifies whether widgets align to the left, right, or center of a column.
|
|
679
|
+
HorizontalAlignment horizontal_alignment = 8;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// A paragraph of text that supports formatting. For an example in
|
|
683
|
+
// Google Chat apps, see [Text
|
|
684
|
+
// paragraph](https://developers.google.com/chat/ui/widgets/text-paragraph).
|
|
685
|
+
// For more information
|
|
686
|
+
// about formatting text, see
|
|
687
|
+
// [Formatting text in Google Chat
|
|
688
|
+
// apps](https://developers.google.com/chat/format-messages#card-formatting)
|
|
689
|
+
// and
|
|
690
|
+
// [Formatting
|
|
691
|
+
// text in Google Workspace
|
|
692
|
+
// Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
|
|
693
|
+
//
|
|
694
|
+
// [Google Workspace Add-ons and
|
|
695
|
+
// Chat apps](https://developers.google.com/workspace/extend):
|
|
696
|
+
message TextParagraph {
|
|
697
|
+
// The text that's shown in the widget.
|
|
698
|
+
string text = 1;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
// An image that is specified by a URL and can have an `onClick` action. For an
|
|
702
|
+
// example, see [Image](https://developers.google.com/chat/ui/widgets/image).
|
|
703
|
+
//
|
|
704
|
+
// [Google Workspace Add-ons and Chat
|
|
705
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
706
|
+
message Image {
|
|
707
|
+
// The HTTPS URL that hosts the image.
|
|
708
|
+
//
|
|
709
|
+
// For example:
|
|
710
|
+
//
|
|
711
|
+
// ```
|
|
712
|
+
// https://developers.google.com/chat/images/quickstart-app-avatar.png
|
|
713
|
+
// ```
|
|
714
|
+
string image_url = 1;
|
|
715
|
+
|
|
716
|
+
// When a user clicks the image, the click triggers this action.
|
|
717
|
+
OnClick on_click = 2;
|
|
718
|
+
|
|
719
|
+
// The alternative text of this image that's used for accessibility.
|
|
720
|
+
string alt_text = 3;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// Displays a divider between widgets as a horizontal line. For an example in
|
|
724
|
+
// Google Chat apps, see
|
|
725
|
+
// [Divider](https://developers.google.com/chat/ui/widgets/divider).
|
|
726
|
+
//
|
|
727
|
+
// [Google Workspace Add-ons and Chat
|
|
728
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
729
|
+
//
|
|
730
|
+
// For example, the following JSON creates a divider:
|
|
731
|
+
//
|
|
732
|
+
// ```
|
|
733
|
+
// "divider": {}
|
|
734
|
+
// ```
|
|
735
|
+
message Divider {}
|
|
736
|
+
|
|
737
|
+
// A widget that displays text with optional decorations such as a label above
|
|
738
|
+
// or below the text, an icon in front of the text, a selection widget, or a
|
|
739
|
+
// button after the text. For an example in
|
|
740
|
+
// Google Chat apps, see [Decorated
|
|
741
|
+
// text](https://developers.google.com/chat/ui/widgets/decorated-text).
|
|
742
|
+
//
|
|
743
|
+
// [Google Workspace Add-ons and Chat
|
|
744
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
745
|
+
message DecoratedText {
|
|
746
|
+
// Either a toggle-style switch or a checkbox inside a `decoratedText` widget.
|
|
747
|
+
//
|
|
748
|
+
// [Google Workspace Add-ons and Chat
|
|
749
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
750
|
+
//
|
|
751
|
+
// Only supported in the `decoratedText` widget.
|
|
752
|
+
message SwitchControl {
|
|
753
|
+
// How the switch appears in the user interface.
|
|
754
|
+
//
|
|
755
|
+
// [Google Workspace Add-ons
|
|
756
|
+
// and Chat apps](https://developers.google.com/workspace/extend):
|
|
757
|
+
enum ControlType {
|
|
758
|
+
// A toggle-style switch.
|
|
759
|
+
SWITCH = 0;
|
|
760
|
+
|
|
761
|
+
// Deprecated in favor of `CHECK_BOX`.
|
|
762
|
+
CHECKBOX = 1;
|
|
763
|
+
|
|
764
|
+
// A checkbox.
|
|
765
|
+
CHECK_BOX = 2;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// The name by which the switch widget is identified in a form input event.
|
|
769
|
+
//
|
|
770
|
+
// For details about working with form inputs, see [Receive form
|
|
771
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
772
|
+
string name = 1;
|
|
773
|
+
|
|
774
|
+
// The value entered by a user, returned as part of a form input event.
|
|
775
|
+
//
|
|
776
|
+
// For details about working with form inputs, see [Receive form
|
|
777
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
778
|
+
string value = 2;
|
|
779
|
+
|
|
780
|
+
// When `true`, the switch is selected.
|
|
781
|
+
bool selected = 3;
|
|
782
|
+
|
|
783
|
+
// The action to perform when the switch state is changed, such as what
|
|
784
|
+
// function to run.
|
|
785
|
+
Action on_change_action = 4;
|
|
786
|
+
|
|
787
|
+
// How the switch appears in the user interface.
|
|
788
|
+
//
|
|
789
|
+
// [Google Workspace Add-ons
|
|
790
|
+
// and Chat apps](https://developers.google.com/workspace/extend):
|
|
791
|
+
ControlType control_type = 5;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
// Deprecated in favor of `startIcon`.
|
|
795
|
+
Icon icon = 1 [deprecated = true];
|
|
796
|
+
|
|
797
|
+
// The icon displayed in front of the text.
|
|
798
|
+
Icon start_icon = 12;
|
|
799
|
+
|
|
800
|
+
// The text that appears above `text`. Always truncates.
|
|
801
|
+
string top_label = 3;
|
|
802
|
+
|
|
803
|
+
// Required. The primary text.
|
|
804
|
+
//
|
|
805
|
+
// Supports simple formatting. For more information
|
|
806
|
+
// about formatting text, see
|
|
807
|
+
// [Formatting text in Google Chat
|
|
808
|
+
// apps](https://developers.google.com/chat/format-messages#card-formatting)
|
|
809
|
+
// and
|
|
810
|
+
// [Formatting
|
|
811
|
+
// text in Google Workspace
|
|
812
|
+
// Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
|
|
813
|
+
string text = 4;
|
|
814
|
+
|
|
815
|
+
// The wrap text setting. If `true`, the text wraps and displays on
|
|
816
|
+
// multiple lines. Otherwise, the text is truncated.
|
|
817
|
+
//
|
|
818
|
+
// Only applies to `text`, not `topLabel` and `bottomLabel`.
|
|
819
|
+
bool wrap_text = 5;
|
|
820
|
+
|
|
821
|
+
// The text that appears below `text`. Always wraps.
|
|
822
|
+
string bottom_label = 6;
|
|
823
|
+
|
|
824
|
+
// This action is triggered when users click `topLabel` or `bottomLabel`.
|
|
825
|
+
OnClick on_click = 7;
|
|
826
|
+
|
|
827
|
+
// A button, switch, checkbox, or image that appears to the right-hand side
|
|
828
|
+
// of text in the `decoratedText` widget.
|
|
829
|
+
oneof control {
|
|
830
|
+
// A button that a user can click to trigger an action.
|
|
831
|
+
Button button = 8;
|
|
832
|
+
|
|
833
|
+
// A switch widget that a user can click to change its state and trigger an
|
|
834
|
+
// action.
|
|
835
|
+
SwitchControl switch_control = 9;
|
|
836
|
+
|
|
837
|
+
// An icon displayed after the text.
|
|
838
|
+
//
|
|
839
|
+
// Supports
|
|
840
|
+
// [built-in](https://developers.google.com/chat/format-messages#builtinicons)
|
|
841
|
+
// and
|
|
842
|
+
// [custom](https://developers.google.com/chat/format-messages#customicons)
|
|
843
|
+
// icons.
|
|
844
|
+
Icon end_icon = 11;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// A field in which users can enter text. Supports suggestions and on-change
|
|
849
|
+
// actions. For an example in Google Chat apps, see [Text
|
|
850
|
+
// input](https://developers.google.com/chat/ui/widgets/text-input).
|
|
851
|
+
//
|
|
852
|
+
// Chat apps receive and can process the value of entered text during form input
|
|
853
|
+
// events. For details about working with form inputs, see [Receive form
|
|
854
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
855
|
+
//
|
|
856
|
+
// When you need to collect undefined or abstract data from users,
|
|
857
|
+
// use a text input. To collect defined or enumerated data from users, use the
|
|
858
|
+
// [SelectionInput][google.apps.card.v1.SelectionInput] widget.
|
|
859
|
+
//
|
|
860
|
+
// [Google Workspace Add-ons and Chat
|
|
861
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
862
|
+
message TextInput {
|
|
863
|
+
// How a text input field appears in the user interface. For example,
|
|
864
|
+
// whether it's a single line input field, or a multi-line input. If
|
|
865
|
+
// `initialSuggestions` is specified, `type` is always `SINGLE_LINE`,
|
|
866
|
+
// even if it's set to `MULTIPLE_LINE`.
|
|
867
|
+
//
|
|
868
|
+
// [Google Workspace Add-ons and Chat
|
|
869
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
870
|
+
enum Type {
|
|
871
|
+
// The text input field has a fixed height of one line.
|
|
872
|
+
SINGLE_LINE = 0;
|
|
873
|
+
|
|
874
|
+
// The text input field has a fixed height of multiple lines.
|
|
875
|
+
MULTIPLE_LINE = 1;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
// The name by which the text input is identified in a form input event.
|
|
879
|
+
//
|
|
880
|
+
// For details about working with form inputs, see [Receive form
|
|
881
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
882
|
+
string name = 1;
|
|
883
|
+
|
|
884
|
+
// The text that appears above the text input field in the user interface.
|
|
885
|
+
//
|
|
886
|
+
// Specify text that helps the user enter the information your app needs.
|
|
887
|
+
// For example, if you are asking someone's name, but specifically need their
|
|
888
|
+
// surname, write `surname` instead of `name`.
|
|
889
|
+
//
|
|
890
|
+
// Required if `hintText` is unspecified. Otherwise, optional.
|
|
891
|
+
string label = 2;
|
|
892
|
+
|
|
893
|
+
// Text that appears below the text input field meant to assist users by
|
|
894
|
+
// prompting them to enter a certain value. This text is always visible.
|
|
895
|
+
//
|
|
896
|
+
// Required if `label` is unspecified. Otherwise, optional.
|
|
897
|
+
string hint_text = 3;
|
|
898
|
+
|
|
899
|
+
// The value entered by a user, returned as part of a form input event.
|
|
900
|
+
//
|
|
901
|
+
// For details about working with form inputs, see [Receive form
|
|
902
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
903
|
+
string value = 4;
|
|
904
|
+
|
|
905
|
+
// How a text input field appears in the user interface.
|
|
906
|
+
// For example, whether the field is single or multi-line.
|
|
907
|
+
Type type = 5;
|
|
908
|
+
|
|
909
|
+
// What to do when a change occurs in the text input field. For example, a
|
|
910
|
+
// user adding to the field or deleting text.
|
|
911
|
+
//
|
|
912
|
+
// Examples of actions to take include running a custom function or opening
|
|
913
|
+
// a [dialog](https://developers.google.com/chat/how-tos/dialogs)
|
|
914
|
+
// in Google Chat.
|
|
915
|
+
Action on_change_action = 6;
|
|
916
|
+
|
|
917
|
+
// Suggested values that users can enter. These values appear when users click
|
|
918
|
+
// inside the text input field. As users type, the suggested values
|
|
919
|
+
// dynamically filter to match what the users have typed.
|
|
920
|
+
//
|
|
921
|
+
// For example, a text input field for programming language might suggest
|
|
922
|
+
// Java, JavaScript, Python, and C++. When users start typing `Jav`, the list
|
|
923
|
+
// of suggestions filters to show just `Java` and `JavaScript`.
|
|
924
|
+
//
|
|
925
|
+
// Suggested values help guide users to enter values that your app can make
|
|
926
|
+
// sense of. When referring to JavaScript, some users might enter `javascript`
|
|
927
|
+
// and others `java script`. Suggesting `JavaScript` can standardize how users
|
|
928
|
+
// interact with your app.
|
|
929
|
+
//
|
|
930
|
+
// When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set
|
|
931
|
+
// to `MULTIPLE_LINE`.
|
|
932
|
+
//
|
|
933
|
+
// [Google Workspace
|
|
934
|
+
// Add-ons and Chat apps](https://developers.google.com/workspace/extend):
|
|
935
|
+
Suggestions initial_suggestions = 7;
|
|
936
|
+
|
|
937
|
+
// Optional. Specify what action to take when the text input field provides
|
|
938
|
+
// suggestions to users who interact with it.
|
|
939
|
+
//
|
|
940
|
+
// If unspecified, the suggestions are set by `initialSuggestions` and
|
|
941
|
+
// are processed by the client.
|
|
942
|
+
//
|
|
943
|
+
// If specified, the app takes the action specified here, such as running
|
|
944
|
+
// a custom function.
|
|
945
|
+
//
|
|
946
|
+
// [Google Workspace
|
|
947
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
948
|
+
Action auto_complete_action = 8;
|
|
949
|
+
|
|
950
|
+
// Text that appears in the text input field when the field is empty.
|
|
951
|
+
// Use this text to prompt users to enter a value. For example, `Enter a
|
|
952
|
+
// number from 0 to 100`.
|
|
953
|
+
//
|
|
954
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
955
|
+
string placeholder_text = 12;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
// Suggested values that users can enter. These values appear when users click
|
|
959
|
+
// inside the text input field. As users type, the suggested values
|
|
960
|
+
// dynamically filter to match what the users have typed.
|
|
961
|
+
//
|
|
962
|
+
// For example, a text input field for programming language might suggest
|
|
963
|
+
// Java, JavaScript, Python, and C++. When users start typing `Jav`, the list
|
|
964
|
+
// of suggestions filters to show `Java` and `JavaScript`.
|
|
965
|
+
//
|
|
966
|
+
// Suggested values help guide users to enter values that your app can make
|
|
967
|
+
// sense of. When referring to JavaScript, some users might enter `javascript`
|
|
968
|
+
// and others `java script`. Suggesting `JavaScript` can standardize how users
|
|
969
|
+
// interact with your app.
|
|
970
|
+
//
|
|
971
|
+
// When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set
|
|
972
|
+
// to `MULTIPLE_LINE`.
|
|
973
|
+
//
|
|
974
|
+
// [Google Workspace
|
|
975
|
+
// Add-ons and Chat apps](https://developers.google.com/workspace/extend):
|
|
976
|
+
message Suggestions {
|
|
977
|
+
// One suggested value that users can enter in a text input field.
|
|
978
|
+
//
|
|
979
|
+
// [Google Workspace Add-ons and Chat
|
|
980
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
981
|
+
message SuggestionItem {
|
|
982
|
+
oneof content {
|
|
983
|
+
// The value of a suggested input to a text input field. This is
|
|
984
|
+
// equivalent to what users enter themselves.
|
|
985
|
+
string text = 1;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
// A list of suggestions used for autocomplete recommendations in text input
|
|
990
|
+
// fields.
|
|
991
|
+
repeated SuggestionItem items = 1;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
// A list of buttons layed out horizontally. For an example in
|
|
995
|
+
// Google Chat apps, see
|
|
996
|
+
// [Button list](https://developers.google.com/chat/ui/widgets/button-list).
|
|
997
|
+
//
|
|
998
|
+
// [Google Workspace Add-ons and Chat
|
|
999
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1000
|
+
message ButtonList {
|
|
1001
|
+
// An array of buttons.
|
|
1002
|
+
repeated Button buttons = 1;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
// A widget that creates one or more UI items that users can select.
|
|
1006
|
+
// For example, a dropdown menu or checkboxes. You can use this widget to
|
|
1007
|
+
// collect data that can be predicted or enumerated. For an example in Google
|
|
1008
|
+
// Chat apps, see [Selection
|
|
1009
|
+
// input](https://developers.google.com/chat/ui/widgets/selection-input).
|
|
1010
|
+
//
|
|
1011
|
+
// Chat apps can process the value of items that users select or input. For
|
|
1012
|
+
// details about working with form inputs, see [Receive form
|
|
1013
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
1014
|
+
//
|
|
1015
|
+
// To collect undefined or abstract data from users, use
|
|
1016
|
+
// the [TextInput][google.apps.card.v1.TextInput] widget.
|
|
1017
|
+
//
|
|
1018
|
+
// [Google Workspace Add-ons
|
|
1019
|
+
// and Chat apps](https://developers.google.com/workspace/extend):
|
|
1020
|
+
message SelectionInput {
|
|
1021
|
+
// The format for the items that users can select. Different options support
|
|
1022
|
+
// different types of interactions. For example, users can select multiple
|
|
1023
|
+
// checkboxes, but can only select one item from a dropdown menu.
|
|
1024
|
+
//
|
|
1025
|
+
// Each selection input supports one type of selection. Mixing checkboxes
|
|
1026
|
+
// and switches, for example, isn't supported.
|
|
1027
|
+
//
|
|
1028
|
+
// [Google Workspace Add-ons and Chat
|
|
1029
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1030
|
+
enum SelectionType {
|
|
1031
|
+
// A set of checkboxes. Users can select one or more checkboxes.
|
|
1032
|
+
CHECK_BOX = 0;
|
|
1033
|
+
|
|
1034
|
+
// A set of radio buttons. Users can select one radio button.
|
|
1035
|
+
RADIO_BUTTON = 1;
|
|
1036
|
+
|
|
1037
|
+
// A set of switches. Users can turn on one or more switches.
|
|
1038
|
+
SWITCH = 2;
|
|
1039
|
+
|
|
1040
|
+
// A dropdown menu. Users can select one item from the menu.
|
|
1041
|
+
DROPDOWN = 3;
|
|
1042
|
+
|
|
1043
|
+
// A multiselect menu for static or dynamic data. From the menu bar,
|
|
1044
|
+
// users select one or more items. Users can also input values to populate
|
|
1045
|
+
// dynamic data. For example, users can start typing the name of a Google
|
|
1046
|
+
// Chat space and the widget autosuggests the space.
|
|
1047
|
+
//
|
|
1048
|
+
// To populate items for a multiselect menu, you can use one of the
|
|
1049
|
+
// following types of data sources:
|
|
1050
|
+
//
|
|
1051
|
+
// * Static data: Items are specified as `SelectionItem` objects in the
|
|
1052
|
+
// widget. Up to 100 items.
|
|
1053
|
+
// * Google Workspace data: Items are populated using data from Google
|
|
1054
|
+
// Workspace, such as Google Workspace users or Google Chat spaces.
|
|
1055
|
+
// * External data: Items are populated from an external data
|
|
1056
|
+
// source outside of Google Workspace.
|
|
1057
|
+
//
|
|
1058
|
+
// For examples of how to implement multiselect menus, see the
|
|
1059
|
+
// [`SelectionInput` widget
|
|
1060
|
+
// page](https://developers.google.com/chat/ui/widgets/selection-input#multiselect-menu).
|
|
1061
|
+
//
|
|
1062
|
+
// [Google Workspace Add-ons and Chat
|
|
1063
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1064
|
+
// multiselect for Google Workspace Add-ons are in
|
|
1065
|
+
// [Developer Preview](https://developers.google.com/workspace/preview).
|
|
1066
|
+
MULTI_SELECT = 4;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
// An item that users can select in a selection input, such as a checkbox
|
|
1070
|
+
// or switch.
|
|
1071
|
+
//
|
|
1072
|
+
// [Google Workspace Add-ons and Chat
|
|
1073
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1074
|
+
message SelectionItem {
|
|
1075
|
+
// The text that identifies or describes the item to users.
|
|
1076
|
+
string text = 1;
|
|
1077
|
+
|
|
1078
|
+
// The value associated with this item. The client should use this as a form
|
|
1079
|
+
// input value.
|
|
1080
|
+
//
|
|
1081
|
+
// For details about working with form inputs, see [Receive form
|
|
1082
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
1083
|
+
string value = 2;
|
|
1084
|
+
|
|
1085
|
+
// Whether the item is selected by default. If the selection input only
|
|
1086
|
+
// accepts one value (such as for radio buttons or a dropdown menu), only
|
|
1087
|
+
// set this field for one item.
|
|
1088
|
+
bool selected = 3;
|
|
1089
|
+
|
|
1090
|
+
// For multiselect menus, the URL for the icon displayed next to
|
|
1091
|
+
// the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS`
|
|
1092
|
+
// URL. For example,
|
|
1093
|
+
// `https://developers.google.com/chat/images/quickstart-app-avatar.png`.
|
|
1094
|
+
string start_icon_uri = 4;
|
|
1095
|
+
|
|
1096
|
+
// For multiselect menus, a text description or label that's
|
|
1097
|
+
// displayed below the item's `text` field.
|
|
1098
|
+
string bottom_text = 5;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// For a
|
|
1102
|
+
// [`SelectionInput`][google.apps.card.v1.SelectionInput] widget that uses a
|
|
1103
|
+
// multiselect menu, a data source from Google Workspace. Used to populate
|
|
1104
|
+
// items in a multiselect menu.
|
|
1105
|
+
//
|
|
1106
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1107
|
+
message PlatformDataSource {
|
|
1108
|
+
// A data source shared by all [Google Workspace
|
|
1109
|
+
// applications]
|
|
1110
|
+
// (https://developers.google.com/chat/api/reference/rest/v1/HostApp).
|
|
1111
|
+
//
|
|
1112
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1113
|
+
enum CommonDataSource {
|
|
1114
|
+
// Default value. Don't use.
|
|
1115
|
+
UNKNOWN = 0;
|
|
1116
|
+
|
|
1117
|
+
// Google Workspace users. The user can only view and select users from
|
|
1118
|
+
// their Google Workspace organization.
|
|
1119
|
+
USER = 1;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
// The data source.
|
|
1123
|
+
oneof data_source {
|
|
1124
|
+
// A data source shared by all Google Workspace applications, such as
|
|
1125
|
+
// users in a Google Workspace organization.
|
|
1126
|
+
CommonDataSource common_data_source = 1;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
// The name that identifies the selection input in a form input event.
|
|
1131
|
+
//
|
|
1132
|
+
// For details about working with form inputs, see [Receive form
|
|
1133
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
1134
|
+
string name = 1;
|
|
1135
|
+
|
|
1136
|
+
// The text that appears above the selection input field in the user
|
|
1137
|
+
// interface.
|
|
1138
|
+
//
|
|
1139
|
+
// Specify text that helps the user enter the information your app needs.
|
|
1140
|
+
// For example, if users are selecting the urgency of a work ticket from a
|
|
1141
|
+
// drop-down menu, the label might be "Urgency" or "Select urgency".
|
|
1142
|
+
string label = 2;
|
|
1143
|
+
|
|
1144
|
+
// The type of items that are displayed to users in a `SelectionInput` widget.
|
|
1145
|
+
// Selection types support different types of interactions. For example, users
|
|
1146
|
+
// can select one or more checkboxes, but they can only select one value from
|
|
1147
|
+
// a dropdown menu.
|
|
1148
|
+
SelectionType type = 3;
|
|
1149
|
+
|
|
1150
|
+
// An array of selectable items. For example, an array of radio buttons or
|
|
1151
|
+
// checkboxes. Supports up to 100 items.
|
|
1152
|
+
repeated SelectionItem items = 4;
|
|
1153
|
+
|
|
1154
|
+
// If specified, the form is submitted when the selection changes. If not
|
|
1155
|
+
// specified, you must specify a separate button that submits the form.
|
|
1156
|
+
//
|
|
1157
|
+
// For details about working with form inputs, see [Receive form
|
|
1158
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
1159
|
+
Action on_change_action = 5;
|
|
1160
|
+
|
|
1161
|
+
// For multiselect menus, the maximum number of items that a user can select.
|
|
1162
|
+
// Minimum value is 1 item. If unspecified, defaults to 3 items.
|
|
1163
|
+
int32 multi_select_max_selected_items = 6;
|
|
1164
|
+
|
|
1165
|
+
// For multiselect menus, the number of text characters that a user inputs
|
|
1166
|
+
// before the Chat app queries autocomplete and displays suggested items
|
|
1167
|
+
// in the menu.
|
|
1168
|
+
//
|
|
1169
|
+
// If unspecified, defaults to 0 characters for static data sources and 3
|
|
1170
|
+
// characters for external data sources.
|
|
1171
|
+
int32 multi_select_min_query_length = 7;
|
|
1172
|
+
|
|
1173
|
+
// For a multiselect menu, the data source that populates
|
|
1174
|
+
// selection items.
|
|
1175
|
+
//
|
|
1176
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1177
|
+
oneof multi_select_data_source {
|
|
1178
|
+
// An external data source, such as a relational data base.
|
|
1179
|
+
Action external_data_source = 8;
|
|
1180
|
+
|
|
1181
|
+
// A data source from Google Workspace.
|
|
1182
|
+
PlatformDataSource platform_data_source = 9;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
// Lets users input a date, a time, or both a date and a time. For an example in
|
|
1187
|
+
// Google Chat apps, see [Date time
|
|
1188
|
+
// picker](https://developers.google.com/chat/ui/widgets/date-time-picker).
|
|
1189
|
+
//
|
|
1190
|
+
// Users can input text or use the picker to select dates and times. If users
|
|
1191
|
+
// input an invalid date or time, the picker shows an error that prompts users
|
|
1192
|
+
// to input the information correctly.
|
|
1193
|
+
//
|
|
1194
|
+
// [Google Workspace
|
|
1195
|
+
// Add-ons and Chat apps](https://developers.google.com/workspace/extend):
|
|
1196
|
+
message DateTimePicker {
|
|
1197
|
+
// The format for the date and time in the `DateTimePicker` widget.
|
|
1198
|
+
// Determines whether users can input a date, a time, or both a date and time.
|
|
1199
|
+
//
|
|
1200
|
+
// [Google Workspace Add-ons and Chat
|
|
1201
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1202
|
+
enum DateTimePickerType {
|
|
1203
|
+
// Users input a date and time.
|
|
1204
|
+
DATE_AND_TIME = 0;
|
|
1205
|
+
|
|
1206
|
+
// Users input a date.
|
|
1207
|
+
DATE_ONLY = 1;
|
|
1208
|
+
|
|
1209
|
+
// Users input a time.
|
|
1210
|
+
TIME_ONLY = 2;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
// The name by which the `DateTimePicker` is identified in a form input event.
|
|
1214
|
+
//
|
|
1215
|
+
// For details about working with form inputs, see [Receive form
|
|
1216
|
+
// data](https://developers.google.com/chat/ui/read-form-data).
|
|
1217
|
+
string name = 1;
|
|
1218
|
+
|
|
1219
|
+
// The text that prompts users to input a date, a time, or a date and time.
|
|
1220
|
+
// For example, if users are scheduling an appointment, use a label such as
|
|
1221
|
+
// `Appointment date` or `Appointment date and time`.
|
|
1222
|
+
string label = 2;
|
|
1223
|
+
|
|
1224
|
+
// Whether the widget supports inputting a date, a time, or the date and time.
|
|
1225
|
+
DateTimePickerType type = 3;
|
|
1226
|
+
|
|
1227
|
+
// The default value displayed in the widget, in milliseconds since [Unix
|
|
1228
|
+
// epoch time](https://en.wikipedia.org/wiki/Unix_time).
|
|
1229
|
+
//
|
|
1230
|
+
// Specify the value based on the type of picker (`DateTimePickerType`):
|
|
1231
|
+
//
|
|
1232
|
+
// * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to
|
|
1233
|
+
// represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`.
|
|
1234
|
+
// * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent
|
|
1235
|
+
// January 1, 2023, use `1672531200000`.
|
|
1236
|
+
// * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use
|
|
1237
|
+
// `43200000` (or `12 * 60 * 60 * 1000`).
|
|
1238
|
+
int64 value_ms_epoch = 4;
|
|
1239
|
+
|
|
1240
|
+
// The number representing the time zone offset from UTC, in minutes.
|
|
1241
|
+
// If set, the `value_ms_epoch` is displayed in the specified time zone.
|
|
1242
|
+
// If unset, the value defaults to the user's time zone setting.
|
|
1243
|
+
int32 timezone_offset_date = 5;
|
|
1244
|
+
|
|
1245
|
+
// Triggered when the user clicks **Save** or **Clear** from the
|
|
1246
|
+
// `DateTimePicker` interface.
|
|
1247
|
+
Action on_change_action = 6;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
// A text, icon, or text and icon button that users can click. For an example in
|
|
1251
|
+
// Google Chat apps, see
|
|
1252
|
+
// [Button list](https://developers.google.com/chat/ui/widgets/button-list).
|
|
1253
|
+
//
|
|
1254
|
+
// To make an image a clickable button, specify an
|
|
1255
|
+
// [`Image`][google.apps.card.v1.Image] (not an
|
|
1256
|
+
// [`ImageComponent`][google.apps.card.v1.ImageComponent]) and set an
|
|
1257
|
+
// `onClick` action.
|
|
1258
|
+
//
|
|
1259
|
+
// [Google Workspace
|
|
1260
|
+
// Add-ons and Chat apps](https://developers.google.com/workspace/extend):
|
|
1261
|
+
message Button {
|
|
1262
|
+
// The text displayed inside the button.
|
|
1263
|
+
string text = 1;
|
|
1264
|
+
|
|
1265
|
+
// The icon image. If both `icon` and `text` are set, then the icon appears
|
|
1266
|
+
// before the text.
|
|
1267
|
+
Icon icon = 2;
|
|
1268
|
+
|
|
1269
|
+
// If set, the button is filled with a solid background color and the font
|
|
1270
|
+
// color changes to maintain contrast with the background color. For example,
|
|
1271
|
+
// setting a blue background likely results in white text.
|
|
1272
|
+
//
|
|
1273
|
+
// If unset, the image background is white and the font color is blue.
|
|
1274
|
+
//
|
|
1275
|
+
// For red, green, and blue, the value of each field is a `float` number that
|
|
1276
|
+
// you can express in either of two ways: as a number between 0 and 255
|
|
1277
|
+
// divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
|
|
1278
|
+
// the absence of a color and 1 or 255/255 represent the full presence of that
|
|
1279
|
+
// color on the RGB scale.
|
|
1280
|
+
//
|
|
1281
|
+
// Optionally set `alpha`, which sets a level of transparency using this
|
|
1282
|
+
// equation:
|
|
1283
|
+
//
|
|
1284
|
+
// ```
|
|
1285
|
+
// pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
|
|
1286
|
+
// ```
|
|
1287
|
+
//
|
|
1288
|
+
// For `alpha`, a value of `1` corresponds with a solid color, and a value of
|
|
1289
|
+
// `0` corresponds with a completely transparent color.
|
|
1290
|
+
//
|
|
1291
|
+
// For example, the following color represents a half transparent red:
|
|
1292
|
+
//
|
|
1293
|
+
// ```
|
|
1294
|
+
// "color": {
|
|
1295
|
+
// "red": 1,
|
|
1296
|
+
// "green": 0,
|
|
1297
|
+
// "blue": 0,
|
|
1298
|
+
// "alpha": 0.5
|
|
1299
|
+
// }
|
|
1300
|
+
// ```
|
|
1301
|
+
google.type.Color color = 3;
|
|
1302
|
+
|
|
1303
|
+
// Required. The action to perform when a user clicks the button, such as
|
|
1304
|
+
// opening a hyperlink or running a custom function.
|
|
1305
|
+
OnClick on_click = 4;
|
|
1306
|
+
|
|
1307
|
+
// If `true`, the button is displayed in an inactive state and doesn't respond
|
|
1308
|
+
// to user actions.
|
|
1309
|
+
bool disabled = 5;
|
|
1310
|
+
|
|
1311
|
+
// The alternative text that's used for accessibility.
|
|
1312
|
+
//
|
|
1313
|
+
// Set descriptive text that lets users know what the button does. For
|
|
1314
|
+
// example, if a button opens a hyperlink, you might write: "Opens a new
|
|
1315
|
+
// browser tab and navigates to the Google Chat developer documentation at
|
|
1316
|
+
// https://developers.google.com/chat".
|
|
1317
|
+
string alt_text = 6;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
// An icon displayed in a widget on a card. For an example in Google Chat apps,
|
|
1321
|
+
// see [Icon](https://developers.google.com/chat/ui/widgets/icon).
|
|
1322
|
+
//
|
|
1323
|
+
// Supports
|
|
1324
|
+
// [built-in](https://developers.google.com/chat/format-messages#builtinicons)
|
|
1325
|
+
// and
|
|
1326
|
+
// [custom](https://developers.google.com/chat/format-messages#customicons)
|
|
1327
|
+
// icons.
|
|
1328
|
+
//
|
|
1329
|
+
// [Google Workspace Add-ons and Chat
|
|
1330
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1331
|
+
message Icon {
|
|
1332
|
+
// The icon displayed in the widget on the card.
|
|
1333
|
+
oneof icons {
|
|
1334
|
+
// Display one of the built-in icons provided by Google Workspace.
|
|
1335
|
+
//
|
|
1336
|
+
// For example, to display an airplane icon, specify `AIRPLANE`.
|
|
1337
|
+
// For a bus, specify `BUS`.
|
|
1338
|
+
//
|
|
1339
|
+
// For a full list of supported icons, see [built-in
|
|
1340
|
+
// icons](https://developers.google.com/chat/format-messages#builtinicons).
|
|
1341
|
+
string known_icon = 1;
|
|
1342
|
+
|
|
1343
|
+
// Display a custom icon hosted at an HTTPS URL.
|
|
1344
|
+
//
|
|
1345
|
+
// For example:
|
|
1346
|
+
//
|
|
1347
|
+
// ```
|
|
1348
|
+
// "iconUrl":
|
|
1349
|
+
// "https://developers.google.com/chat/images/quickstart-app-avatar.png"
|
|
1350
|
+
// ```
|
|
1351
|
+
//
|
|
1352
|
+
// Supported file types include `.png` and `.jpg`.
|
|
1353
|
+
string icon_url = 2;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
// Optional. A description of the icon used for accessibility.
|
|
1357
|
+
// If unspecified, the default value `Button` is provided. As a best practice,
|
|
1358
|
+
// you should set a helpful description for what the icon displays, and if
|
|
1359
|
+
// applicable, what it does. For example, `A user's account portrait`, or
|
|
1360
|
+
// `Opens a new browser tab and navigates to the Google Chat developer
|
|
1361
|
+
// documentation at https://developers.google.com/chat`.
|
|
1362
|
+
//
|
|
1363
|
+
// If the icon is set in a [`Button`][google.apps.card.v1.Button], the
|
|
1364
|
+
// `altText` appears as helper text when the user hovers over the button.
|
|
1365
|
+
// However, if the button also sets `text`, the icon's `altText` is ignored.
|
|
1366
|
+
string alt_text = 3;
|
|
1367
|
+
|
|
1368
|
+
// The crop style applied to the image. In some cases, applying a
|
|
1369
|
+
// `CIRCLE` crop causes the image to be drawn larger than a built-in
|
|
1370
|
+
// icon.
|
|
1371
|
+
Widget.ImageType image_type = 4;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
// Represents the crop style applied to an image.
|
|
1375
|
+
//
|
|
1376
|
+
// [Google Workspace Add-ons and
|
|
1377
|
+
// Chat apps](https://developers.google.com/workspace/extend):
|
|
1378
|
+
//
|
|
1379
|
+
// For example, here's how to apply a 16:9 aspect ratio:
|
|
1380
|
+
//
|
|
1381
|
+
// ```
|
|
1382
|
+
// cropStyle {
|
|
1383
|
+
// "type": "RECTANGLE_CUSTOM",
|
|
1384
|
+
// "aspectRatio": 16/9
|
|
1385
|
+
// }
|
|
1386
|
+
// ```
|
|
1387
|
+
message ImageCropStyle {
|
|
1388
|
+
// Represents the crop style applied to an image.
|
|
1389
|
+
//
|
|
1390
|
+
// [Google Workspace Add-ons
|
|
1391
|
+
// and Chat apps](https://developers.google.com/workspace/extend):
|
|
1392
|
+
enum ImageCropType {
|
|
1393
|
+
// Don't use. Unspecified.
|
|
1394
|
+
IMAGE_CROP_TYPE_UNSPECIFIED = 0;
|
|
1395
|
+
|
|
1396
|
+
// Default value. Applies a square crop.
|
|
1397
|
+
SQUARE = 1;
|
|
1398
|
+
|
|
1399
|
+
// Applies a circular crop.
|
|
1400
|
+
CIRCLE = 2;
|
|
1401
|
+
|
|
1402
|
+
// Applies a rectangular crop with a custom aspect ratio. Set the custom
|
|
1403
|
+
// aspect ratio with `aspectRatio`.
|
|
1404
|
+
RECTANGLE_CUSTOM = 3;
|
|
1405
|
+
|
|
1406
|
+
// Applies a rectangular crop with a 4:3 aspect ratio.
|
|
1407
|
+
RECTANGLE_4_3 = 4;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
// The crop type.
|
|
1411
|
+
ImageCropType type = 1;
|
|
1412
|
+
|
|
1413
|
+
// The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.
|
|
1414
|
+
//
|
|
1415
|
+
// For example, here's how to apply a 16:9 aspect ratio:
|
|
1416
|
+
//
|
|
1417
|
+
// ```
|
|
1418
|
+
// cropStyle {
|
|
1419
|
+
// "type": "RECTANGLE_CUSTOM",
|
|
1420
|
+
// "aspectRatio": 16/9
|
|
1421
|
+
// }
|
|
1422
|
+
// ```
|
|
1423
|
+
double aspect_ratio = 2;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
// The style options for the border of a card or widget, including the border
|
|
1427
|
+
// type and color.
|
|
1428
|
+
//
|
|
1429
|
+
// [Google Workspace Add-ons and Chat
|
|
1430
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1431
|
+
message BorderStyle {
|
|
1432
|
+
// Represents the border types applied to widgets.
|
|
1433
|
+
//
|
|
1434
|
+
// [Google Workspace Add-ons
|
|
1435
|
+
// and Chat apps](https://developers.google.com/workspace/extend):
|
|
1436
|
+
enum BorderType {
|
|
1437
|
+
// Don't use. Unspecified.
|
|
1438
|
+
BORDER_TYPE_UNSPECIFIED = 0;
|
|
1439
|
+
|
|
1440
|
+
// Default value. No border.
|
|
1441
|
+
NO_BORDER = 1;
|
|
1442
|
+
|
|
1443
|
+
// Outline.
|
|
1444
|
+
STROKE = 2;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
// The border type.
|
|
1448
|
+
BorderType type = 1;
|
|
1449
|
+
|
|
1450
|
+
// The colors to use when the type is `BORDER_TYPE_STROKE`.
|
|
1451
|
+
google.type.Color stroke_color = 2;
|
|
1452
|
+
|
|
1453
|
+
// The corner radius for the border.
|
|
1454
|
+
int32 corner_radius = 3;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
// Represents an image.
|
|
1458
|
+
//
|
|
1459
|
+
// [Google Workspace Add-ons and Chat
|
|
1460
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1461
|
+
message ImageComponent {
|
|
1462
|
+
// The image URL.
|
|
1463
|
+
string image_uri = 1;
|
|
1464
|
+
|
|
1465
|
+
// The accessibility label for the image.
|
|
1466
|
+
string alt_text = 2;
|
|
1467
|
+
|
|
1468
|
+
// The crop style to apply to the image.
|
|
1469
|
+
ImageCropStyle crop_style = 3;
|
|
1470
|
+
|
|
1471
|
+
// The border style to apply to the image.
|
|
1472
|
+
BorderStyle border_style = 4;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
// Displays a grid with a collection of items. Items can only include text or
|
|
1476
|
+
// images. For responsive columns, or to include more than text or images, use
|
|
1477
|
+
// [`Columns`][google.apps.card.v1.Columns]. For an example in Google Chat apps,
|
|
1478
|
+
// see [Grid](https://developers.google.com/chat/ui/widgets/grid).
|
|
1479
|
+
//
|
|
1480
|
+
// A grid supports any number of columns and items. The number of rows is
|
|
1481
|
+
// determined by items divided by columns. A grid with
|
|
1482
|
+
// 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns
|
|
1483
|
+
// has 6 rows.
|
|
1484
|
+
//
|
|
1485
|
+
// [Google Workspace Add-ons and Chat
|
|
1486
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1487
|
+
//
|
|
1488
|
+
// For example, the following JSON creates a 2 column grid with a single
|
|
1489
|
+
// item:
|
|
1490
|
+
//
|
|
1491
|
+
// ```
|
|
1492
|
+
// "grid": {
|
|
1493
|
+
// "title": "A fine collection of items",
|
|
1494
|
+
// "columnCount": 2,
|
|
1495
|
+
// "borderStyle": {
|
|
1496
|
+
// "type": "STROKE",
|
|
1497
|
+
// "cornerRadius": 4
|
|
1498
|
+
// },
|
|
1499
|
+
// "items": [
|
|
1500
|
+
// {
|
|
1501
|
+
// "image": {
|
|
1502
|
+
// "imageUri": "https://www.example.com/image.png",
|
|
1503
|
+
// "cropStyle": {
|
|
1504
|
+
// "type": "SQUARE"
|
|
1505
|
+
// },
|
|
1506
|
+
// "borderStyle": {
|
|
1507
|
+
// "type": "STROKE"
|
|
1508
|
+
// }
|
|
1509
|
+
// },
|
|
1510
|
+
// "title": "An item",
|
|
1511
|
+
// "textAlignment": "CENTER"
|
|
1512
|
+
// }
|
|
1513
|
+
// ],
|
|
1514
|
+
// "onClick": {
|
|
1515
|
+
// "openLink": {
|
|
1516
|
+
// "url": "https://www.example.com"
|
|
1517
|
+
// }
|
|
1518
|
+
// }
|
|
1519
|
+
// }
|
|
1520
|
+
// ```
|
|
1521
|
+
message Grid {
|
|
1522
|
+
// Represents an item in a grid layout. Items can contain text, an image, or
|
|
1523
|
+
// both text and an image.
|
|
1524
|
+
//
|
|
1525
|
+
// [Google Workspace Add-ons and Chat
|
|
1526
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1527
|
+
message GridItem {
|
|
1528
|
+
// Represents the various layout options available for a grid item.
|
|
1529
|
+
//
|
|
1530
|
+
// [Google Workspace Add-ons and Chat
|
|
1531
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1532
|
+
enum GridItemLayout {
|
|
1533
|
+
// Don't use. Unspecified.
|
|
1534
|
+
GRID_ITEM_LAYOUT_UNSPECIFIED = 0;
|
|
1535
|
+
|
|
1536
|
+
// The title and subtitle are shown below the grid item's image.
|
|
1537
|
+
TEXT_BELOW = 1;
|
|
1538
|
+
|
|
1539
|
+
// The title and subtitle are shown above the grid item's image.
|
|
1540
|
+
TEXT_ABOVE = 2;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
// A user-specified identifier for this grid item. This identifier is
|
|
1544
|
+
// returned in the parent grid's `onClick` callback parameters.
|
|
1545
|
+
string id = 1;
|
|
1546
|
+
|
|
1547
|
+
// The image that displays in the grid item.
|
|
1548
|
+
ImageComponent image = 2;
|
|
1549
|
+
|
|
1550
|
+
// The grid item's title.
|
|
1551
|
+
string title = 3;
|
|
1552
|
+
|
|
1553
|
+
// The grid item's subtitle.
|
|
1554
|
+
string subtitle = 4;
|
|
1555
|
+
|
|
1556
|
+
// The layout to use for the grid item.
|
|
1557
|
+
GridItemLayout layout = 9;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
// The text that displays in the grid header.
|
|
1561
|
+
string title = 1;
|
|
1562
|
+
|
|
1563
|
+
// The items to display in the grid.
|
|
1564
|
+
repeated GridItem items = 2;
|
|
1565
|
+
|
|
1566
|
+
// The border style to apply to each grid item.
|
|
1567
|
+
BorderStyle border_style = 3;
|
|
1568
|
+
|
|
1569
|
+
// The number of columns to display in the grid. A default value
|
|
1570
|
+
// is used if this field isn't specified, and that default value is
|
|
1571
|
+
// different depending on where the grid is shown (dialog versus companion).
|
|
1572
|
+
int32 column_count = 4;
|
|
1573
|
+
|
|
1574
|
+
// This callback is reused by each individual grid item, but with the
|
|
1575
|
+
// item's identifier and index in the items list added to the callback's
|
|
1576
|
+
// parameters.
|
|
1577
|
+
OnClick on_click = 5;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
// The `Columns` widget displays up to 2 columns in a card or dialog. You can
|
|
1581
|
+
// add widgets to each column; the widgets appear in the order that they are
|
|
1582
|
+
// specified. For an example in Google Chat apps, see
|
|
1583
|
+
// [Columns](https://developers.google.com/chat/ui/widgets/columns).
|
|
1584
|
+
//
|
|
1585
|
+
// The height of each column is determined by the taller column. For example, if
|
|
1586
|
+
// the first column is taller than the second column, both columns have the
|
|
1587
|
+
// height of the first column. Because each column can contain a different
|
|
1588
|
+
// number of widgets, you can't define rows or align widgets between the
|
|
1589
|
+
// columns.
|
|
1590
|
+
//
|
|
1591
|
+
// Columns are displayed side-by-side. You can customize the width of each
|
|
1592
|
+
// column using the `HorizontalSizeStyle` field. If the user's
|
|
1593
|
+
// screen width is too narrow, the second column wraps below the first:
|
|
1594
|
+
//
|
|
1595
|
+
// * On web, the second column wraps if the screen width is less than or equal
|
|
1596
|
+
// to 480 pixels.
|
|
1597
|
+
// * On iOS devices, the second column wraps if the screen width is
|
|
1598
|
+
// less than or equal to 300 pt.
|
|
1599
|
+
// * On Android devices, the second column wraps if the screen width is
|
|
1600
|
+
// less than or equal to 320 dp.
|
|
1601
|
+
//
|
|
1602
|
+
// To include more than 2 columns, or to use rows, use the
|
|
1603
|
+
// [`Grid`][google.apps.card.v1.Grid] widget.
|
|
1604
|
+
//
|
|
1605
|
+
// [Google Workspace Add-ons and Chat
|
|
1606
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1607
|
+
// Columns for Google Workspace Add-ons are in
|
|
1608
|
+
// [Developer Preview](https://developers.google.com/workspace/preview).
|
|
1609
|
+
message Columns {
|
|
1610
|
+
// A column.
|
|
1611
|
+
//
|
|
1612
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1613
|
+
message Column {
|
|
1614
|
+
// Specifies how a column fills the width of the card. The width of each
|
|
1615
|
+
// column depends on both the `HorizontalSizeStyle` and the width of the
|
|
1616
|
+
// widgets within the column.
|
|
1617
|
+
//
|
|
1618
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1619
|
+
enum HorizontalSizeStyle {
|
|
1620
|
+
// Don't use. Unspecified.
|
|
1621
|
+
HORIZONTAL_SIZE_STYLE_UNSPECIFIED = 0;
|
|
1622
|
+
|
|
1623
|
+
// Default value. Column fills the available space, up to 70% of the
|
|
1624
|
+
// card's width. If both columns are set to `FILL_AVAILABLE_SPACE`, each
|
|
1625
|
+
// column fills 50% of the space.
|
|
1626
|
+
FILL_AVAILABLE_SPACE = 1;
|
|
1627
|
+
|
|
1628
|
+
// Column fills the least amount of space possible and no more than 30% of
|
|
1629
|
+
// the card's width.
|
|
1630
|
+
FILL_MINIMUM_SPACE = 2;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
// Specifies whether widgets align to the top, bottom, or center of a
|
|
1634
|
+
// column.
|
|
1635
|
+
//
|
|
1636
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1637
|
+
enum VerticalAlignment {
|
|
1638
|
+
// Don't use. Unspecified.
|
|
1639
|
+
VERTICAL_ALIGNMENT_UNSPECIFIED = 0;
|
|
1640
|
+
|
|
1641
|
+
// Default value. Aligns widgets to the center of a column.
|
|
1642
|
+
CENTER = 1;
|
|
1643
|
+
|
|
1644
|
+
// Aligns widgets to the top of a column.
|
|
1645
|
+
TOP = 2;
|
|
1646
|
+
|
|
1647
|
+
// Aligns widgets to the bottom of a column.
|
|
1648
|
+
BOTTOM = 3;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
// The supported widgets that you can include in a column.
|
|
1652
|
+
//
|
|
1653
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1654
|
+
message Widgets {
|
|
1655
|
+
oneof data {
|
|
1656
|
+
// [TextParagraph][google.apps.card.v1.TextParagraph] widget.
|
|
1657
|
+
TextParagraph text_paragraph = 1;
|
|
1658
|
+
|
|
1659
|
+
// [Image][google.apps.card.v1.Image] widget.
|
|
1660
|
+
Image image = 2;
|
|
1661
|
+
|
|
1662
|
+
// [DecoratedText][google.apps.card.v1.DecoratedText] widget.
|
|
1663
|
+
DecoratedText decorated_text = 3;
|
|
1664
|
+
|
|
1665
|
+
// [ButtonList][google.apps.card.v1.ButtonList] widget.
|
|
1666
|
+
ButtonList button_list = 4;
|
|
1667
|
+
|
|
1668
|
+
// [TextInput][google.apps.card.v1.TextInput] widget.
|
|
1669
|
+
TextInput text_input = 5;
|
|
1670
|
+
|
|
1671
|
+
// [SelectionInput][google.apps.card.v1.SelectionInput] widget.
|
|
1672
|
+
SelectionInput selection_input = 6;
|
|
1673
|
+
|
|
1674
|
+
// [DateTimePicker][google.apps.card.v1.DateTimePicker] widget.
|
|
1675
|
+
DateTimePicker date_time_picker = 7;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
// Specifies how a column fills the width of the card.
|
|
1680
|
+
//
|
|
1681
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1682
|
+
HorizontalSizeStyle horizontal_size_style = 1;
|
|
1683
|
+
|
|
1684
|
+
// Specifies whether widgets align to the left, right, or center of a
|
|
1685
|
+
// column.
|
|
1686
|
+
Widget.HorizontalAlignment horizontal_alignment = 2;
|
|
1687
|
+
|
|
1688
|
+
// Specifies whether widgets align to the top, bottom, or center of a
|
|
1689
|
+
// column.
|
|
1690
|
+
//
|
|
1691
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1692
|
+
VerticalAlignment vertical_alignment = 3;
|
|
1693
|
+
|
|
1694
|
+
// An array of widgets included in a column. Widgets appear in the order
|
|
1695
|
+
// that they are specified.
|
|
1696
|
+
repeated Widgets widgets = 4;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
// An array of columns. You can include up to 2 columns in a card or dialog.
|
|
1700
|
+
repeated Column column_items = 2;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
// Represents how to respond when users click an interactive element on
|
|
1704
|
+
// a card, such as a button.
|
|
1705
|
+
//
|
|
1706
|
+
// [Google Workspace Add-ons and Chat
|
|
1707
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1708
|
+
message OnClick {
|
|
1709
|
+
oneof data {
|
|
1710
|
+
// If specified, an action is triggered by this `onClick`.
|
|
1711
|
+
Action action = 1;
|
|
1712
|
+
|
|
1713
|
+
// If specified, this `onClick` triggers an open link action.
|
|
1714
|
+
OpenLink open_link = 2;
|
|
1715
|
+
|
|
1716
|
+
// An add-on triggers this action when the action needs to open a
|
|
1717
|
+
// link. This differs from the `open_link` above in that this needs to talk
|
|
1718
|
+
// to server to get the link. Thus some preparation work is required for
|
|
1719
|
+
// web client to do before the open link action response comes back.
|
|
1720
|
+
//
|
|
1721
|
+
// [Google Workspace
|
|
1722
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
1723
|
+
Action open_dynamic_link_action = 3;
|
|
1724
|
+
|
|
1725
|
+
// A new card is pushed to the card stack after clicking if specified.
|
|
1726
|
+
//
|
|
1727
|
+
// [Google Workspace
|
|
1728
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
1729
|
+
Card card = 4;
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
// Represents an `onClick` event that opens a hyperlink.
|
|
1734
|
+
//
|
|
1735
|
+
// [Google Workspace Add-ons and Chat
|
|
1736
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1737
|
+
message OpenLink {
|
|
1738
|
+
// When an `OnClick` action opens a link, then the client can either open it
|
|
1739
|
+
// as a full-size window (if that's the frame used by the client), or an
|
|
1740
|
+
// overlay (such as a pop-up). The implementation depends on the client
|
|
1741
|
+
// platform capabilities, and the value selected might be ignored if the
|
|
1742
|
+
// client doesn't support it. `FULL_SIZE` is supported by all clients.
|
|
1743
|
+
//
|
|
1744
|
+
// [Google Workspace
|
|
1745
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
1746
|
+
enum OpenAs {
|
|
1747
|
+
// The link opens as a full-size window (if that's the frame used by the
|
|
1748
|
+
// client).
|
|
1749
|
+
FULL_SIZE = 0;
|
|
1750
|
+
|
|
1751
|
+
// The link opens as an overlay, such as a pop-up.
|
|
1752
|
+
OVERLAY = 1;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
// What the client does when a link opened by an `OnClick` action is closed.
|
|
1756
|
+
//
|
|
1757
|
+
// Implementation depends on client platform capabilities. For example, a web
|
|
1758
|
+
// browser might open a link in a pop-up window with an `OnClose` handler.
|
|
1759
|
+
//
|
|
1760
|
+
// If both `OnOpen` and `OnClose` handlers are set, and the client platform
|
|
1761
|
+
// can't support both values, `OnClose` takes precedence.
|
|
1762
|
+
//
|
|
1763
|
+
// [Google Workspace
|
|
1764
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
1765
|
+
enum OnClose {
|
|
1766
|
+
// Default value. The card doesn't reload; nothing happens.
|
|
1767
|
+
NOTHING = 0;
|
|
1768
|
+
|
|
1769
|
+
// Reloads the card after the child window closes.
|
|
1770
|
+
//
|
|
1771
|
+
// If used in conjunction with
|
|
1772
|
+
// [`OpenAs.OVERLAY`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#openas),
|
|
1773
|
+
// the child window acts as a modal dialog and the parent card is blocked
|
|
1774
|
+
// until the child window closes.
|
|
1775
|
+
RELOAD = 1;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
// The URL to open.
|
|
1779
|
+
string url = 1;
|
|
1780
|
+
|
|
1781
|
+
// How to open a link.
|
|
1782
|
+
//
|
|
1783
|
+
// [Google Workspace
|
|
1784
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
1785
|
+
OpenAs open_as = 2;
|
|
1786
|
+
|
|
1787
|
+
// Whether the client forgets about a link after opening it, or observes it
|
|
1788
|
+
// until the window closes.
|
|
1789
|
+
//
|
|
1790
|
+
// [Google Workspace
|
|
1791
|
+
// Add-ons](https://developers.google.com/workspace/add-ons):
|
|
1792
|
+
OnClose on_close = 3;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
// An action that describes the behavior when the form is submitted.
|
|
1796
|
+
// For example, you can invoke an Apps Script script to handle the form.
|
|
1797
|
+
// If the action is triggered, the form values are sent to the server.
|
|
1798
|
+
//
|
|
1799
|
+
// [Google Workspace Add-ons and Chat
|
|
1800
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1801
|
+
message Action {
|
|
1802
|
+
// List of string parameters to supply when the action method is invoked.
|
|
1803
|
+
// For example, consider three snooze buttons: snooze now, snooze one day,
|
|
1804
|
+
// or snooze next week. You might use `action method = snooze()`, passing the
|
|
1805
|
+
// snooze type and snooze time in the list of string parameters.
|
|
1806
|
+
//
|
|
1807
|
+
// To learn more, see
|
|
1808
|
+
// [`CommonEventObject`](https://developers.google.com/chat/api/reference/rest/v1/Event#commoneventobject).
|
|
1809
|
+
//
|
|
1810
|
+
// [Google Workspace Add-ons and Chat
|
|
1811
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1812
|
+
message ActionParameter {
|
|
1813
|
+
// The name of the parameter for the action script.
|
|
1814
|
+
string key = 1;
|
|
1815
|
+
|
|
1816
|
+
// The value of the parameter.
|
|
1817
|
+
string value = 2;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
// Specifies the loading indicator that the action displays while
|
|
1821
|
+
// making the call to the action.
|
|
1822
|
+
//
|
|
1823
|
+
// [Google Workspace Add-ons and Chat
|
|
1824
|
+
// apps](https://developers.google.com/workspace/extend):
|
|
1825
|
+
enum LoadIndicator {
|
|
1826
|
+
// Displays a spinner to indicate that content is loading.
|
|
1827
|
+
SPINNER = 0;
|
|
1828
|
+
|
|
1829
|
+
// Nothing is displayed.
|
|
1830
|
+
NONE = 1;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
// Optional. Required when opening a
|
|
1834
|
+
// [dialog](https://developers.google.com/chat/how-tos/dialogs).
|
|
1835
|
+
//
|
|
1836
|
+
// What to do in response to an interaction with a user, such as a user
|
|
1837
|
+
// clicking a button in a card message.
|
|
1838
|
+
//
|
|
1839
|
+
// If unspecified, the app responds by executing an `action`—like opening a
|
|
1840
|
+
// link or running a function—as normal.
|
|
1841
|
+
//
|
|
1842
|
+
// By specifying an `interaction`, the app can respond in special interactive
|
|
1843
|
+
// ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
|
|
1844
|
+
// open a [dialog](https://developers.google.com/chat/how-tos/dialogs).
|
|
1845
|
+
//
|
|
1846
|
+
// When specified, a loading indicator isn't shown. If specified for
|
|
1847
|
+
// an add-on, the entire card is stripped and nothing is shown in the client.
|
|
1848
|
+
//
|
|
1849
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1850
|
+
enum Interaction {
|
|
1851
|
+
// Default value. The `action` executes as normal.
|
|
1852
|
+
INTERACTION_UNSPECIFIED = 0;
|
|
1853
|
+
|
|
1854
|
+
// Opens a [dialog](https://developers.google.com/chat/how-tos/dialogs), a
|
|
1855
|
+
// windowed, card-based interface that Chat apps use to interact with users.
|
|
1856
|
+
//
|
|
1857
|
+
// Only supported by Chat apps in response to button-clicks on card
|
|
1858
|
+
// messages. If specified for
|
|
1859
|
+
// an add-on, the entire card is stripped and nothing is shown in the
|
|
1860
|
+
// client.
|
|
1861
|
+
//
|
|
1862
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1863
|
+
OPEN_DIALOG = 1;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
// A custom function to invoke when the containing element is
|
|
1867
|
+
// clicked or othrwise activated.
|
|
1868
|
+
//
|
|
1869
|
+
// For example usage, see [Create interactive
|
|
1870
|
+
// cards](https://developers.google.com/chat/how-tos/cards-onclick).
|
|
1871
|
+
string function = 1;
|
|
1872
|
+
|
|
1873
|
+
// List of action parameters.
|
|
1874
|
+
repeated ActionParameter parameters = 2;
|
|
1875
|
+
|
|
1876
|
+
// Specifies the loading indicator that the action displays while
|
|
1877
|
+
// making the call to the action.
|
|
1878
|
+
LoadIndicator load_indicator = 3;
|
|
1879
|
+
|
|
1880
|
+
// Indicates whether form values persist after the action. The default value
|
|
1881
|
+
// is `false`.
|
|
1882
|
+
//
|
|
1883
|
+
// If `true`, form values remain after the action is triggered. To let the
|
|
1884
|
+
// user make changes while the action is being processed, set
|
|
1885
|
+
// [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
|
|
1886
|
+
// to `NONE`. For [card
|
|
1887
|
+
// messages](https://developers.google.com/chat/api/guides/v1/messages/create#create)
|
|
1888
|
+
// in Chat apps, you must also set the action's
|
|
1889
|
+
// [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype)
|
|
1890
|
+
// to `UPDATE_MESSAGE` and use the same
|
|
1891
|
+
// [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId)
|
|
1892
|
+
// from the card that contained the action.
|
|
1893
|
+
//
|
|
1894
|
+
// If `false`, the form values are cleared when the action is triggered.
|
|
1895
|
+
// To prevent the user from making changes while the action is being
|
|
1896
|
+
// processed, set
|
|
1897
|
+
// [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
|
|
1898
|
+
// to `SPINNER`.
|
|
1899
|
+
bool persist_values = 4;
|
|
1900
|
+
|
|
1901
|
+
// Optional. Required when opening a
|
|
1902
|
+
// [dialog](https://developers.google.com/chat/how-tos/dialogs).
|
|
1903
|
+
//
|
|
1904
|
+
// What to do in response to an interaction with a user, such as a user
|
|
1905
|
+
// clicking a button in a card message.
|
|
1906
|
+
//
|
|
1907
|
+
// If unspecified, the app responds by executing an `action`—like opening a
|
|
1908
|
+
// link or running a function—as normal.
|
|
1909
|
+
//
|
|
1910
|
+
// By specifying an `interaction`, the app can respond in special interactive
|
|
1911
|
+
// ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
|
|
1912
|
+
// open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
|
|
1913
|
+
// specified, a loading indicator isn't shown. If specified for
|
|
1914
|
+
// an add-on, the entire card is stripped and nothing is shown in the client.
|
|
1915
|
+
//
|
|
1916
|
+
// [Google Chat apps](https://developers.google.com/chat):
|
|
1917
|
+
Interaction interaction = 5;
|
|
1918
|
+
}
|