-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommonEvent.schema.json
executable file
·211 lines (210 loc) · 9.81 KB
/
CommonEvent.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
{
"$id": "https://tandosid.dev/event-objects/main.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"definitions": {
"eventObject": {
"$id": "/properties/eventObject",
"type": "object",
"description": "Event objects are JSON structures that are automatically constructed and passed as parameters to trigger or callback functions when a user interacts with an add-on (https://developers.google.com/workspace/add-ons/concepts/event-objects)",
"properties": {
"commonEventObject": {
"$ref": "#/definitions/commonEventObject"
},
"authorizationEventObject": {
"$ref": "#/definitions/authorizationEventObject",
"description": "Set for requests to HTTP endpoints"
},
"gmail": {
"$ref": "GmailEvent.schema.json#/definitions/gmailEventObject",
"description": "An object containing Gmail information."
},
"drive": {
"$ref": "DriveEvent.schema.json#/definitions/driveEventObject",
"description": "An object containing Drive information."
},
"docs": {
"$ref": "DocsEvent.schema.json#/definitions/docsEventObject",
"description": "An object containing Docs information."
},
"sheets": {
"$ref": "GoogleSheetsEvent.schema.json#/definitions/sheetsEventObject",
"description": "An object containing Sheets information."
},
"slides": {
"$ref": "GoogleSlidesEvent.schema.json#/definitions/slidesEventObject",
"description": "An object containing Slides information."
},
"calendar": {
"$ref": "CalendarEvent.schema.json#/definitions/calendarEventObject",
"description": "An object containing calendar and event information."
}
}
},
"commonEventObject": {
"$id": "/properties/commonEventObject",
"type": "object",
"description": "An object containing information common to all event objects, regardless of the host application.",
"properties": {
"userLocale": {
"type": "string",
"description": "The user's language and country/region identifier in the format of ISO 639 language code-ISO 3166 country/region code. For example, en-US."
},
"hostApp": {
"type": "string",
"description": "Indicates the host app the add-on is active in when the event object is generated. Possible values include the following:\nDOCS\nSHEETS\nGMAIL\nCALENDAR\nDRIVE",
"enum": [
"SLIDES",
"DOCS",
"SHEETS",
"GMAIL",
"DRIVE",
"CALENDAR"
]
},
"platform": {
"type": "string",
"description": "Indicates where the event originates (`WEB`, `IOS`, or `ANDROID`)",
"enum": [
"WEB",
"ANDRIOD",
"IOS"
]
},
"timeZone": {
"type": "object",
"$ref": "#/definitions/timeZone",
"description": "The timezone ID and offset. To enable this field, you must set `addOns.common.useLocaleFromApp` to `true` in your add-on's manifest. Your add-on's scope list must also include `https://www.googleapis.com/auth/script.locale`\n See https://developers.google.com/workspace/add-ons/how-tos/access-user-locale for more details"
},
"formInputs": {
"type": "object",
"description": "A map containing the current values of the widgets in the displayed card. The map keys are the string IDs assigned with each widget, and each value is another wrapper object with a single \"\" key.",
"additionalProperties": {
"type": "object",
"properties": {
"stringInputs": {
"$ref": "#/definitions/stringInputs"
},
"dateTimeInput": {
"$ref": "#/definitions/dateTimeInput"
},
"dateInput": {
"$ref": "#/definitions/dateInput"
},
"timeInput": {
"$ref": "#/definitions/timeInput"
}
}
}
},
"parameters": {
"type": "object",
"description": "Any additional parameters.",
"additionalProperties": {
"type": "string"
}
}
}
},
"authorizationEventObject": {
"type": "object",
"properties": {
"userOAuthToken": {
"description": "The end user OAuth access token, authorized with the requested scopes",
"type": "string"
},
"userIdToken": {
"type": "string",
"description": "An end-user ID token, if appropriate ID scopes are requested"
},
"systemIdToken": {
"type": "string",
"description": "An ID token for the Google Workspace Add-ons service account for this deployment"
}
}
},
"timeZone": {
"$id": "/properties/timeZone",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The timezone identifier of the user's timezone. Examples include: America/New_York, Europe/Vienna, and Asia/Seoul. To enable this field, you must set `addOns.common.useLocaleFromApp` to `true` in your add-on's manifest. Your add-on's scope list must also include `https://www.googleapis.com/auth/script.locale`. See https://developers.google.com/workspace/add-ons/how-tos/access-user-locale for more details"
},
"offset": {
"type": "integer",
"description": "The time offset from Coordinated Universal Time (UTC) of the user's timezone, measured in milliseconds. See https://developers.google.com/workspace/add-ons/how-tos/access-user-locale for more details",
"minimum": -2147483648,
"maximum": 2147483647
}
}
},
"stringInputs": {
"$id": "/properties/stringInputs",
"type": "object",
"description": "Input parameter for regular widgets.\nFor single-valued widgets, it will be a single value list; for\nmulti-valued widgets, such as checkbox, all the values are presented.",
"properties": {
"value": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"dateTimeInput": {
"$id": "/properties/dateTimeInput",
"type": "object",
"description": "Input Parameter for Date and Time Picker widget.",
"properties": {
"msSinceEpoch": {
"type": "integer",
"description": "The time selected by the user, in milliseconds since epoch (00:00:00 UTC on 1 January 1970).",
"minimum": -9223372036854775808,
"maximum": 9223372036854775807
},
"hasDate": {
"type": "boolean",
"description": "true if the input date time includes a date; if false only a time is included."
},
"hasTime": {
"type": "boolean",
"description": "true if the input date time includes a time; if false only a date is included."
}
}
},
"dateInput": {
"$id": "/properties/dateInput",
"type": "object",
"description": "Input Parameter for Date Picker widget.",
"properties": {
"msSinceEpoch": {
"type": "integer",
"description": "The time selected by the user, in milliseconds since epoch (00:00:00 UTC on 1 January 1970).",
"minimum": -9223372036854775808,
"maximum": 9223372036854775807
}
}
},
"timeInput": {
"description": "Input Parameter for Time Picker widget.",
"$id": "/properties/timeInput",
"type": "object",
"properties": {
"hours": {
"type": "integer",
"description": "The hour number selected by the user.",
"minimum": 0,
"maximum": 23
},
"minutes": {
"type": "integer",
"description": "The minute number selected by the user.",
"minimum": 0,
"maximum": 59
}
}
}
},
"$ref": "#/definitions/eventObject"
}