@maxim_mazurok/gapi.client.script-v1 0.0.20220806

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts ADDED
@@ -0,0 +1,1031 @@
1
+ /* Type definitions for non-npm package Apps Script API v1 0.0 */
2
+ // Project: https://developers.google.com/apps-script/api/
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+ // TypeScript Version: 2.8
8
+
9
+ // IMPORTANT
10
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
11
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
12
+ // Generated from: https://script.googleapis.com/$discovery/rest?version=v1
13
+ // Revision: 20220806
14
+
15
+ /// <reference types="gapi.client" />
16
+
17
+ declare namespace gapi.client {
18
+ /** Load Apps Script API v1 */
19
+ function load(urlOrObject: "https://script.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
20
+ /** @deprecated Please load APIs with discovery documents. */
21
+ function load(name: "script", version: "v1"): Promise<void>;
22
+ /** @deprecated Please load APIs with discovery documents. */
23
+ function load(name: "script", version: "v1", callback: () => any): void;
24
+
25
+ namespace script {
26
+ interface Content {
27
+ /**
28
+ * The list of script project files. One of the files is a script manifest; it must be named "appsscript", must have type of JSON, and include the manifest configurations for the
29
+ * project.
30
+ */
31
+ files?: File[];
32
+ /** The script project's Drive ID. */
33
+ scriptId?: string;
34
+ }
35
+ interface CreateProjectRequest {
36
+ /**
37
+ * The Drive ID of a parent file that the created script project is bound to. This is usually the ID of a Google Doc, Google Sheet, Google Form, or Google Slides file. If not set, a
38
+ * standalone script project is created.
39
+ */
40
+ parentId?: string;
41
+ /** The title for the project. */
42
+ title?: string;
43
+ }
44
+ interface Deployment {
45
+ /** The deployment configuration. */
46
+ deploymentConfig?: DeploymentConfig;
47
+ /** The deployment ID for this deployment. */
48
+ deploymentId?: string;
49
+ /** The deployment's entry points. */
50
+ entryPoints?: EntryPoint[];
51
+ /** Last modified date time stamp. */
52
+ updateTime?: string;
53
+ }
54
+ interface DeploymentConfig {
55
+ /** The description for this deployment. */
56
+ description?: string;
57
+ /** The manifest file name for this deployment. */
58
+ manifestFileName?: string;
59
+ /** The script project's Drive ID. */
60
+ scriptId?: string;
61
+ /** The version number on which this deployment is based. */
62
+ versionNumber?: number;
63
+ }
64
+ // tslint:disable-next-line:no-empty-interface
65
+ interface Empty {
66
+ }
67
+ interface EntryPoint {
68
+ /** Add-on properties. */
69
+ addOn?: GoogleAppsScriptTypeAddOnEntryPoint;
70
+ /** The type of the entry point. */
71
+ entryPointType?: string;
72
+ /** An entry point specification for Apps Script API execution calls. */
73
+ executionApi?: GoogleAppsScriptTypeExecutionApiEntryPoint;
74
+ /** An entry point specification for web apps. */
75
+ webApp?: GoogleAppsScriptTypeWebAppEntryPoint;
76
+ }
77
+ interface ExecuteStreamResponse {
78
+ /** The result of the execution. */
79
+ result?: ScriptExecutionResult;
80
+ }
81
+ interface ExecutionError {
82
+ /** The error message thrown by Apps Script, usually localized into the user's language. */
83
+ errorMessage?: string;
84
+ /** The error type, for example `TypeError` or `ReferenceError`. If the error type is unavailable, this field is not included. */
85
+ errorType?: string;
86
+ /** An array of objects that provide a stack trace through the script to show where the execution failed, with the deepest call first. */
87
+ scriptStackTraceElements?: ScriptStackTraceElement[];
88
+ }
89
+ interface ExecutionRequest {
90
+ /**
91
+ * If `true` and the user is an owner of the script, the script runs at the most recently saved version rather than the version deployed for use with the Apps Script API. Optional;
92
+ * default is `false`.
93
+ */
94
+ devMode?: boolean;
95
+ /**
96
+ * The name of the function to execute in the given script. The name does not include parentheses or parameters. It can reference a function in an included library such as
97
+ * `Library.libFunction1`.
98
+ */
99
+ function?: string;
100
+ /**
101
+ * The parameters to be passed to the function being executed. The object type for each parameter should match the expected type in Apps Script. Parameters cannot be Apps
102
+ * Script-specific object types (such as a `Document` or a `Calendar`); they can only be primitive types such as `string`, `number`, `array`, `object`, or `boolean`. Optional.
103
+ */
104
+ parameters?: any[];
105
+ /**
106
+ * *Deprecated*. For use with Android add-ons only. An ID that represents the user's current session in the Android app for Google Docs or Sheets, included as extra data in the
107
+ * [Intent](https://developer.android.com/guide/components/intents-filters.html) that launches the add-on. When an Android add-on is run with a session state, it gains the privileges
108
+ * of a [bound](https://developers.google.com/apps-script/guides/bound) script—that is, it can access information like the user's current cursor position (in Docs) or selected cell (in
109
+ * Sheets). To retrieve the state, call `Intent.getStringExtra("com.google.android.apps.docs.addons.SessionState")`. Optional.
110
+ */
111
+ sessionState?: string;
112
+ }
113
+ interface ExecutionResponse {
114
+ /**
115
+ * The return value of the script function. The type matches the object type returned in Apps Script. Functions called using the Apps Script API cannot return Apps Script-specific
116
+ * objects (such as a `Document` or a `Calendar`); they can only return primitive types such as a `string`, `number`, `array`, `object`, or `boolean`.
117
+ */
118
+ result?: any;
119
+ }
120
+ interface File {
121
+ /** Creation date timestamp. This read-only field is only visible to users who have WRITER permission for the script project. */
122
+ createTime?: string;
123
+ /** The defined set of functions in the script file, if any. */
124
+ functionSet?: GoogleAppsScriptTypeFunctionSet;
125
+ /** The user who modified the file most recently. This read-only field is only visible to users who have WRITER permission for the script project. */
126
+ lastModifyUser?: GoogleAppsScriptTypeUser;
127
+ /** The name of the file. The file extension is not part of the file name, which can be identified from the type field. */
128
+ name?: string;
129
+ /** The file content. */
130
+ source?: string;
131
+ /** The type of the file. */
132
+ type?: string;
133
+ /** Last modified date timestamp. This read-only field is only visible to users who have WRITER permission for the script project. */
134
+ updateTime?: string;
135
+ }
136
+ interface GoogleAppsScriptTypeAddOnEntryPoint {
137
+ /** The add-on's required list of supported container types. */
138
+ addOnType?: string;
139
+ /** The add-on's optional description. */
140
+ description?: string;
141
+ /** The add-on's optional help URL. */
142
+ helpUrl?: string;
143
+ /** The add-on's required post install tip URL. */
144
+ postInstallTipUrl?: string;
145
+ /** The add-on's optional report issue URL. */
146
+ reportIssueUrl?: string;
147
+ /** The add-on's required title. */
148
+ title?: string;
149
+ }
150
+ interface GoogleAppsScriptTypeExecutionApiConfig {
151
+ /** Who has permission to run the API executable. */
152
+ access?: string;
153
+ }
154
+ interface GoogleAppsScriptTypeExecutionApiEntryPoint {
155
+ /** The entry point's configuration. */
156
+ entryPointConfig?: GoogleAppsScriptTypeExecutionApiConfig;
157
+ }
158
+ interface GoogleAppsScriptTypeFunction {
159
+ /** The function name in the script project. */
160
+ name?: string;
161
+ /** The ordered list of parameter names of the function in the script project. */
162
+ parameters?: string[];
163
+ }
164
+ interface GoogleAppsScriptTypeFunctionSet {
165
+ /** A list of functions composing the set. */
166
+ values?: GoogleAppsScriptTypeFunction[];
167
+ }
168
+ interface GoogleAppsScriptTypeProcess {
169
+ /** Duration the execution spent executing. */
170
+ duration?: string;
171
+ /** Name of the function the started the execution. */
172
+ functionName?: string;
173
+ /** The executions status. */
174
+ processStatus?: string;
175
+ /** The executions type. */
176
+ processType?: string;
177
+ /** Name of the script being executed. */
178
+ projectName?: string;
179
+ /** Time the execution started. */
180
+ startTime?: string;
181
+ /** The executing users access level to the script. */
182
+ userAccessLevel?: string;
183
+ }
184
+ interface GoogleAppsScriptTypeUser {
185
+ /** The user's domain. */
186
+ domain?: string;
187
+ /** The user's identifying email address. */
188
+ email?: string;
189
+ /** The user's display name. */
190
+ name?: string;
191
+ /** The user's photo. */
192
+ photoUrl?: string;
193
+ }
194
+ interface GoogleAppsScriptTypeWebAppConfig {
195
+ /** Who has permission to run the web app. */
196
+ access?: string;
197
+ /** Who to execute the web app as. */
198
+ executeAs?: string;
199
+ }
200
+ interface GoogleAppsScriptTypeWebAppEntryPoint {
201
+ /** The entry point's configuration. */
202
+ entryPointConfig?: GoogleAppsScriptTypeWebAppConfig;
203
+ /** The URL for the web application. */
204
+ url?: string;
205
+ }
206
+ interface ListDeploymentsResponse {
207
+ /** The list of deployments. */
208
+ deployments?: Deployment[];
209
+ /** The token that can be used in the next call to get the next page of results. */
210
+ nextPageToken?: string;
211
+ }
212
+ interface ListScriptProcessesResponse {
213
+ /** Token for the next page of results. If empty, there are no more pages remaining. */
214
+ nextPageToken?: string;
215
+ /** List of processes matching request parameters. */
216
+ processes?: GoogleAppsScriptTypeProcess[];
217
+ }
218
+ interface ListUserProcessesResponse {
219
+ /** Token for the next page of results. If empty, there are no more pages remaining. */
220
+ nextPageToken?: string;
221
+ /** List of processes matching request parameters. */
222
+ processes?: GoogleAppsScriptTypeProcess[];
223
+ }
224
+ interface ListValue {
225
+ /** Repeated field of dynamically typed values. */
226
+ values?: Value[];
227
+ }
228
+ interface ListVersionsResponse {
229
+ /** The token use to fetch the next page of records. if not exist in the response, that means no more versions to list. */
230
+ nextPageToken?: string;
231
+ /** The list of versions. */
232
+ versions?: Version[];
233
+ }
234
+ interface Metrics {
235
+ /** Number of active users. */
236
+ activeUsers?: MetricsValue[];
237
+ /** Number of failed executions. */
238
+ failedExecutions?: MetricsValue[];
239
+ /** Number of total executions. */
240
+ totalExecutions?: MetricsValue[];
241
+ }
242
+ interface MetricsValue {
243
+ /** Required field indicating the end time of the interval. */
244
+ endTime?: string;
245
+ /** Required field indicating the start time of the interval. */
246
+ startTime?: string;
247
+ /** Indicates the number of executions counted. */
248
+ value?: string;
249
+ }
250
+ interface Operation {
251
+ /**
252
+ * This field indicates whether the script execution has completed. A completed execution has a populated `response` field containing the ExecutionResponse from function that was
253
+ * executed.
254
+ */
255
+ done?: boolean;
256
+ /**
257
+ * If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, this field contains a Status object. The `Status` object's `details` field contains an
258
+ * array with a single ExecutionError object that provides information about the nature of the error.
259
+ */
260
+ error?: Status;
261
+ /** If the script function returns successfully, this field contains an ExecutionResponse object with the function's return value. */
262
+ response?: { [P in string]: any };
263
+ }
264
+ interface Project {
265
+ /** When the script was created. */
266
+ createTime?: string;
267
+ /** User who originally created the script. */
268
+ creator?: GoogleAppsScriptTypeUser;
269
+ /** User who last modified the script. */
270
+ lastModifyUser?: GoogleAppsScriptTypeUser;
271
+ /**
272
+ * The parent's Drive ID that the script will be attached to. This is usually the ID of a Google Document or Google Sheet. This filed is optional, and if not set, a stand-alone script
273
+ * will be created.
274
+ */
275
+ parentId?: string;
276
+ /** The script project's Drive ID. */
277
+ scriptId?: string;
278
+ /** The title for the project. */
279
+ title?: string;
280
+ /** When the script was last updated. */
281
+ updateTime?: string;
282
+ }
283
+ interface ScriptExecutionResult {
284
+ /** The returned value of the execution. */
285
+ returnValue?: Value;
286
+ }
287
+ interface ScriptStackTraceElement {
288
+ /** The name of the function that failed. */
289
+ function?: string;
290
+ /** The line number where the script failed. */
291
+ lineNumber?: number;
292
+ }
293
+ interface Status {
294
+ /** The status code. For this API, this value either: - 10, indicating a `SCRIPT_TIMEOUT` error, - 3, indicating an `INVALID_ARGUMENT` error, or - 1, indicating a `CANCELLED` execution. */
295
+ code?: number;
296
+ /** An array that contains a single ExecutionError object that provides information about the nature of the error. */
297
+ details?: Array<{ [P in string]: any }>;
298
+ /** A developer-facing error message, which is in English. Any user-facing error message is localized and sent in the details field, or localized by the client. */
299
+ message?: string;
300
+ }
301
+ interface Struct {
302
+ /** Unordered map of dynamically typed values. */
303
+ fields?: { [P in string]: Value };
304
+ }
305
+ interface UpdateDeploymentRequest {
306
+ /** The deployment configuration. */
307
+ deploymentConfig?: DeploymentConfig;
308
+ }
309
+ interface Value {
310
+ /** Represents a boolean value. */
311
+ boolValue?: boolean;
312
+ /** Represents raw byte values. */
313
+ bytesValue?: string;
314
+ /** Represents a date in ms since the epoch. */
315
+ dateValue?: string;
316
+ /** Represents a repeated `Value`. */
317
+ listValue?: ListValue;
318
+ /** Represents a null value. */
319
+ nullValue?: string;
320
+ /** Represents a double value. */
321
+ numberValue?: number;
322
+ /** Represents a structured proto value. */
323
+ protoValue?: { [P in string]: any };
324
+ /** Represents a string value. */
325
+ stringValue?: string;
326
+ /** Represents a structured value. */
327
+ structValue?: Struct;
328
+ }
329
+ interface Version {
330
+ /** When the version was created. */
331
+ createTime?: string;
332
+ /** The description for this version. */
333
+ description?: string;
334
+ /** The script project's Drive ID. */
335
+ scriptId?: string;
336
+ /** The incremental ID that is created by Apps Script when a version is created. This is system assigned number and is immutable once created. */
337
+ versionNumber?: number;
338
+ }
339
+ interface ProcessesResource {
340
+ /** List information about processes made by or on behalf of a user, such as process type and current status. */
341
+ list(request?: {
342
+ /** V1 error format. */
343
+ "$.xgafv"?: string;
344
+ /** OAuth access token. */
345
+ access_token?: string;
346
+ /** Data format for response. */
347
+ alt?: string;
348
+ /** JSONP */
349
+ callback?: string;
350
+ /** Selector specifying which fields to include in a partial response. */
351
+ fields?: string;
352
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
353
+ key?: string;
354
+ /** OAuth 2.0 token for the current user. */
355
+ oauth_token?: string;
356
+ /** The maximum number of returned processes per page of results. Defaults to 50. */
357
+ pageSize?: number;
358
+ /** The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. */
359
+ pageToken?: string;
360
+ /** Returns response with indentations and line breaks. */
361
+ prettyPrint?: boolean;
362
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
363
+ quotaUser?: string;
364
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
365
+ upload_protocol?: string;
366
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
367
+ uploadType?: string;
368
+ /** Optional field used to limit returned processes to those originating from projects with a specific deployment ID. */
369
+ "userProcessFilter.deploymentId"?: string;
370
+ /** Optional field used to limit returned processes to those that completed on or before the given timestamp. */
371
+ "userProcessFilter.endTime"?: string;
372
+ /** Optional field used to limit returned processes to those originating from a script function with the given function name. */
373
+ "userProcessFilter.functionName"?: string;
374
+ /** Optional field used to limit returned processes to those originating from projects with project names containing a specific string. */
375
+ "userProcessFilter.projectName"?: string;
376
+ /** Optional field used to limit returned processes to those originating from projects with a specific script ID. */
377
+ "userProcessFilter.scriptId"?: string;
378
+ /** Optional field used to limit returned processes to those that were started on or after the given timestamp. */
379
+ "userProcessFilter.startTime"?: string;
380
+ /** Optional field used to limit returned processes to those having one of the specified process statuses. */
381
+ "userProcessFilter.statuses"?: string | string[];
382
+ /** Optional field used to limit returned processes to those having one of the specified process types. */
383
+ "userProcessFilter.types"?: string | string[];
384
+ /** Optional field used to limit returned processes to those having one of the specified user access levels. */
385
+ "userProcessFilter.userAccessLevels"?: string | string[];
386
+ }): Request<ListUserProcessesResponse>;
387
+ /** List information about a script's executed processes, such as process type and current status. */
388
+ listScriptProcesses(request?: {
389
+ /** V1 error format. */
390
+ "$.xgafv"?: string;
391
+ /** OAuth access token. */
392
+ access_token?: string;
393
+ /** Data format for response. */
394
+ alt?: string;
395
+ /** JSONP */
396
+ callback?: string;
397
+ /** Selector specifying which fields to include in a partial response. */
398
+ fields?: string;
399
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
400
+ key?: string;
401
+ /** OAuth 2.0 token for the current user. */
402
+ oauth_token?: string;
403
+ /** The maximum number of returned processes per page of results. Defaults to 50. */
404
+ pageSize?: number;
405
+ /** The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. */
406
+ pageToken?: string;
407
+ /** Returns response with indentations and line breaks. */
408
+ prettyPrint?: boolean;
409
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
410
+ quotaUser?: string;
411
+ /** The script ID of the project whose processes are listed. */
412
+ scriptId?: string;
413
+ /** Optional field used to limit returned processes to those originating from projects with a specific deployment ID. */
414
+ "scriptProcessFilter.deploymentId"?: string;
415
+ /** Optional field used to limit returned processes to those that completed on or before the given timestamp. */
416
+ "scriptProcessFilter.endTime"?: string;
417
+ /** Optional field used to limit returned processes to those originating from a script function with the given function name. */
418
+ "scriptProcessFilter.functionName"?: string;
419
+ /** Optional field used to limit returned processes to those that were started on or after the given timestamp. */
420
+ "scriptProcessFilter.startTime"?: string;
421
+ /** Optional field used to limit returned processes to those having one of the specified process statuses. */
422
+ "scriptProcessFilter.statuses"?: string | string[];
423
+ /** Optional field used to limit returned processes to those having one of the specified process types. */
424
+ "scriptProcessFilter.types"?: string | string[];
425
+ /** Optional field used to limit returned processes to those having one of the specified user access levels. */
426
+ "scriptProcessFilter.userAccessLevels"?: string | string[];
427
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
428
+ upload_protocol?: string;
429
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
430
+ uploadType?: string;
431
+ }): Request<ListScriptProcessesResponse>;
432
+ }
433
+ interface DeploymentsResource {
434
+ /** Creates a deployment of an Apps Script project. */
435
+ create(request: {
436
+ /** V1 error format. */
437
+ "$.xgafv"?: string;
438
+ /** OAuth access token. */
439
+ access_token?: string;
440
+ /** Data format for response. */
441
+ alt?: string;
442
+ /** JSONP */
443
+ callback?: string;
444
+ /** Selector specifying which fields to include in a partial response. */
445
+ fields?: string;
446
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
447
+ key?: string;
448
+ /** OAuth 2.0 token for the current user. */
449
+ oauth_token?: string;
450
+ /** Returns response with indentations and line breaks. */
451
+ prettyPrint?: boolean;
452
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
453
+ quotaUser?: string;
454
+ /** The script project's Drive ID. */
455
+ scriptId: string;
456
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
457
+ upload_protocol?: string;
458
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
459
+ uploadType?: string;
460
+ /** Request body */
461
+ resource: DeploymentConfig;
462
+ }): Request<Deployment>;
463
+ create(request: {
464
+ /** V1 error format. */
465
+ "$.xgafv"?: string;
466
+ /** OAuth access token. */
467
+ access_token?: string;
468
+ /** Data format for response. */
469
+ alt?: string;
470
+ /** JSONP */
471
+ callback?: string;
472
+ /** Selector specifying which fields to include in a partial response. */
473
+ fields?: string;
474
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
475
+ key?: string;
476
+ /** OAuth 2.0 token for the current user. */
477
+ oauth_token?: string;
478
+ /** Returns response with indentations and line breaks. */
479
+ prettyPrint?: boolean;
480
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
481
+ quotaUser?: string;
482
+ /** The script project's Drive ID. */
483
+ scriptId: string;
484
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
485
+ upload_protocol?: string;
486
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
487
+ uploadType?: string;
488
+ },
489
+ body: DeploymentConfig): Request<Deployment>;
490
+ /** Deletes a deployment of an Apps Script project. */
491
+ delete(request?: {
492
+ /** V1 error format. */
493
+ "$.xgafv"?: string;
494
+ /** OAuth access token. */
495
+ access_token?: string;
496
+ /** Data format for response. */
497
+ alt?: string;
498
+ /** JSONP */
499
+ callback?: string;
500
+ /** The deployment ID to be undeployed. */
501
+ deploymentId: string;
502
+ /** Selector specifying which fields to include in a partial response. */
503
+ fields?: string;
504
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
505
+ key?: string;
506
+ /** OAuth 2.0 token for the current user. */
507
+ oauth_token?: string;
508
+ /** Returns response with indentations and line breaks. */
509
+ prettyPrint?: boolean;
510
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
511
+ quotaUser?: string;
512
+ /** The script project's Drive ID. */
513
+ scriptId: string;
514
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
515
+ upload_protocol?: string;
516
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
517
+ uploadType?: string;
518
+ }): Request<{}>;
519
+ /** Gets a deployment of an Apps Script project. */
520
+ get(request?: {
521
+ /** V1 error format. */
522
+ "$.xgafv"?: string;
523
+ /** OAuth access token. */
524
+ access_token?: string;
525
+ /** Data format for response. */
526
+ alt?: string;
527
+ /** JSONP */
528
+ callback?: string;
529
+ /** The deployment ID. */
530
+ deploymentId: string;
531
+ /** Selector specifying which fields to include in a partial response. */
532
+ fields?: string;
533
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
534
+ key?: string;
535
+ /** OAuth 2.0 token for the current user. */
536
+ oauth_token?: string;
537
+ /** Returns response with indentations and line breaks. */
538
+ prettyPrint?: boolean;
539
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
540
+ quotaUser?: string;
541
+ /** The script project's Drive ID. */
542
+ scriptId: string;
543
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
544
+ upload_protocol?: string;
545
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
546
+ uploadType?: string;
547
+ }): Request<Deployment>;
548
+ /** Lists the deployments of an Apps Script project. */
549
+ list(request?: {
550
+ /** V1 error format. */
551
+ "$.xgafv"?: string;
552
+ /** OAuth access token. */
553
+ access_token?: string;
554
+ /** Data format for response. */
555
+ alt?: string;
556
+ /** JSONP */
557
+ callback?: string;
558
+ /** Selector specifying which fields to include in a partial response. */
559
+ fields?: string;
560
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
561
+ key?: string;
562
+ /** OAuth 2.0 token for the current user. */
563
+ oauth_token?: string;
564
+ /** The maximum number of deployments on each returned page. Defaults to 50. */
565
+ pageSize?: number;
566
+ /** The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. */
567
+ pageToken?: string;
568
+ /** Returns response with indentations and line breaks. */
569
+ prettyPrint?: boolean;
570
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
571
+ quotaUser?: string;
572
+ /** The script project's Drive ID. */
573
+ scriptId: string;
574
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
575
+ upload_protocol?: string;
576
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
577
+ uploadType?: string;
578
+ }): Request<ListDeploymentsResponse>;
579
+ /** Updates a deployment of an Apps Script project. */
580
+ update(request: {
581
+ /** V1 error format. */
582
+ "$.xgafv"?: string;
583
+ /** OAuth access token. */
584
+ access_token?: string;
585
+ /** Data format for response. */
586
+ alt?: string;
587
+ /** JSONP */
588
+ callback?: string;
589
+ /** The deployment ID for this deployment. */
590
+ deploymentId: string;
591
+ /** Selector specifying which fields to include in a partial response. */
592
+ fields?: string;
593
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
594
+ key?: string;
595
+ /** OAuth 2.0 token for the current user. */
596
+ oauth_token?: string;
597
+ /** Returns response with indentations and line breaks. */
598
+ prettyPrint?: boolean;
599
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
600
+ quotaUser?: string;
601
+ /** The script project's Drive ID. */
602
+ scriptId: string;
603
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
604
+ upload_protocol?: string;
605
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
606
+ uploadType?: string;
607
+ /** Request body */
608
+ resource: UpdateDeploymentRequest;
609
+ }): Request<Deployment>;
610
+ update(request: {
611
+ /** V1 error format. */
612
+ "$.xgafv"?: string;
613
+ /** OAuth access token. */
614
+ access_token?: string;
615
+ /** Data format for response. */
616
+ alt?: string;
617
+ /** JSONP */
618
+ callback?: string;
619
+ /** The deployment ID for this deployment. */
620
+ deploymentId: string;
621
+ /** Selector specifying which fields to include in a partial response. */
622
+ fields?: string;
623
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
624
+ key?: string;
625
+ /** OAuth 2.0 token for the current user. */
626
+ oauth_token?: string;
627
+ /** Returns response with indentations and line breaks. */
628
+ prettyPrint?: boolean;
629
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
630
+ quotaUser?: string;
631
+ /** The script project's Drive ID. */
632
+ scriptId: string;
633
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
634
+ upload_protocol?: string;
635
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
636
+ uploadType?: string;
637
+ },
638
+ body: UpdateDeploymentRequest): Request<Deployment>;
639
+ }
640
+ interface VersionsResource {
641
+ /** Creates a new immutable version using the current code, with a unique version number. */
642
+ create(request: {
643
+ /** V1 error format. */
644
+ "$.xgafv"?: string;
645
+ /** OAuth access token. */
646
+ access_token?: string;
647
+ /** Data format for response. */
648
+ alt?: string;
649
+ /** JSONP */
650
+ callback?: string;
651
+ /** Selector specifying which fields to include in a partial response. */
652
+ fields?: string;
653
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
654
+ key?: string;
655
+ /** OAuth 2.0 token for the current user. */
656
+ oauth_token?: string;
657
+ /** Returns response with indentations and line breaks. */
658
+ prettyPrint?: boolean;
659
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
660
+ quotaUser?: string;
661
+ /** The script project's Drive ID. */
662
+ scriptId: string;
663
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
664
+ upload_protocol?: string;
665
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
666
+ uploadType?: string;
667
+ /** Request body */
668
+ resource: Version;
669
+ }): Request<Version>;
670
+ create(request: {
671
+ /** V1 error format. */
672
+ "$.xgafv"?: string;
673
+ /** OAuth access token. */
674
+ access_token?: string;
675
+ /** Data format for response. */
676
+ alt?: string;
677
+ /** JSONP */
678
+ callback?: string;
679
+ /** Selector specifying which fields to include in a partial response. */
680
+ fields?: string;
681
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
682
+ key?: string;
683
+ /** OAuth 2.0 token for the current user. */
684
+ oauth_token?: string;
685
+ /** Returns response with indentations and line breaks. */
686
+ prettyPrint?: boolean;
687
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
688
+ quotaUser?: string;
689
+ /** The script project's Drive ID. */
690
+ scriptId: string;
691
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
692
+ upload_protocol?: string;
693
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
694
+ uploadType?: string;
695
+ },
696
+ body: Version): Request<Version>;
697
+ /** Gets a version of a script project. */
698
+ get(request?: {
699
+ /** V1 error format. */
700
+ "$.xgafv"?: string;
701
+ /** OAuth access token. */
702
+ access_token?: string;
703
+ /** Data format for response. */
704
+ alt?: string;
705
+ /** JSONP */
706
+ callback?: string;
707
+ /** Selector specifying which fields to include in a partial response. */
708
+ fields?: string;
709
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
710
+ key?: string;
711
+ /** OAuth 2.0 token for the current user. */
712
+ oauth_token?: string;
713
+ /** Returns response with indentations and line breaks. */
714
+ prettyPrint?: boolean;
715
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
716
+ quotaUser?: string;
717
+ /** The script project's Drive ID. */
718
+ scriptId: string;
719
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
720
+ upload_protocol?: string;
721
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
722
+ uploadType?: string;
723
+ /** The version number. */
724
+ versionNumber: number;
725
+ }): Request<Version>;
726
+ /** List the versions of a script project. */
727
+ list(request?: {
728
+ /** V1 error format. */
729
+ "$.xgafv"?: string;
730
+ /** OAuth access token. */
731
+ access_token?: string;
732
+ /** Data format for response. */
733
+ alt?: string;
734
+ /** JSONP */
735
+ callback?: string;
736
+ /** Selector specifying which fields to include in a partial response. */
737
+ fields?: string;
738
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
739
+ key?: string;
740
+ /** OAuth 2.0 token for the current user. */
741
+ oauth_token?: string;
742
+ /** The maximum number of versions on each returned page. Defaults to 50. */
743
+ pageSize?: number;
744
+ /** The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. */
745
+ pageToken?: string;
746
+ /** Returns response with indentations and line breaks. */
747
+ prettyPrint?: boolean;
748
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
749
+ quotaUser?: string;
750
+ /** The script project's Drive ID. */
751
+ scriptId: string;
752
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
753
+ upload_protocol?: string;
754
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
755
+ uploadType?: string;
756
+ }): Request<ListVersionsResponse>;
757
+ }
758
+ interface ProjectsResource {
759
+ /** Creates a new, empty script project with no script files and a base manifest file. */
760
+ create(request: {
761
+ /** V1 error format. */
762
+ "$.xgafv"?: string;
763
+ /** OAuth access token. */
764
+ access_token?: string;
765
+ /** Data format for response. */
766
+ alt?: string;
767
+ /** JSONP */
768
+ callback?: string;
769
+ /** Selector specifying which fields to include in a partial response. */
770
+ fields?: string;
771
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
772
+ key?: string;
773
+ /** OAuth 2.0 token for the current user. */
774
+ oauth_token?: string;
775
+ /** Returns response with indentations and line breaks. */
776
+ prettyPrint?: boolean;
777
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
778
+ quotaUser?: string;
779
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
780
+ upload_protocol?: string;
781
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
782
+ uploadType?: string;
783
+ /** Request body */
784
+ resource: CreateProjectRequest;
785
+ }): Request<Project>;
786
+ create(request: {
787
+ /** V1 error format. */
788
+ "$.xgafv"?: string;
789
+ /** OAuth access token. */
790
+ access_token?: string;
791
+ /** Data format for response. */
792
+ alt?: string;
793
+ /** JSONP */
794
+ callback?: string;
795
+ /** Selector specifying which fields to include in a partial response. */
796
+ fields?: string;
797
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
798
+ key?: string;
799
+ /** OAuth 2.0 token for the current user. */
800
+ oauth_token?: string;
801
+ /** Returns response with indentations and line breaks. */
802
+ prettyPrint?: boolean;
803
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
804
+ quotaUser?: string;
805
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
806
+ upload_protocol?: string;
807
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
808
+ uploadType?: string;
809
+ },
810
+ body: CreateProjectRequest): Request<Project>;
811
+ /** Gets a script project's metadata. */
812
+ get(request?: {
813
+ /** V1 error format. */
814
+ "$.xgafv"?: string;
815
+ /** OAuth access token. */
816
+ access_token?: string;
817
+ /** Data format for response. */
818
+ alt?: string;
819
+ /** JSONP */
820
+ callback?: string;
821
+ /** Selector specifying which fields to include in a partial response. */
822
+ fields?: string;
823
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
824
+ key?: string;
825
+ /** OAuth 2.0 token for the current user. */
826
+ oauth_token?: string;
827
+ /** Returns response with indentations and line breaks. */
828
+ prettyPrint?: boolean;
829
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
830
+ quotaUser?: string;
831
+ /** The script project's Drive ID. */
832
+ scriptId: string;
833
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
834
+ upload_protocol?: string;
835
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
836
+ uploadType?: string;
837
+ }): Request<Project>;
838
+ /** Gets the content of the script project, including the code source and metadata for each script file. */
839
+ getContent(request?: {
840
+ /** V1 error format. */
841
+ "$.xgafv"?: string;
842
+ /** OAuth access token. */
843
+ access_token?: string;
844
+ /** Data format for response. */
845
+ alt?: string;
846
+ /** JSONP */
847
+ callback?: string;
848
+ /** Selector specifying which fields to include in a partial response. */
849
+ fields?: string;
850
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
851
+ key?: string;
852
+ /** OAuth 2.0 token for the current user. */
853
+ oauth_token?: string;
854
+ /** Returns response with indentations and line breaks. */
855
+ prettyPrint?: boolean;
856
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
857
+ quotaUser?: string;
858
+ /** The script project's Drive ID. */
859
+ scriptId: string;
860
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
861
+ upload_protocol?: string;
862
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
863
+ uploadType?: string;
864
+ /** The version number of the project to retrieve. If not provided, the project's HEAD version is returned. */
865
+ versionNumber?: number;
866
+ }): Request<Content>;
867
+ /** Get metrics data for scripts, such as number of executions and active users. */
868
+ getMetrics(request?: {
869
+ /** V1 error format. */
870
+ "$.xgafv"?: string;
871
+ /** OAuth access token. */
872
+ access_token?: string;
873
+ /** Data format for response. */
874
+ alt?: string;
875
+ /** JSONP */
876
+ callback?: string;
877
+ /** Selector specifying which fields to include in a partial response. */
878
+ fields?: string;
879
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
880
+ key?: string;
881
+ /** Optional field indicating a specific deployment to retrieve metrics from. */
882
+ "metricsFilter.deploymentId"?: string;
883
+ /** Required field indicating what granularity of metrics are returned. */
884
+ metricsGranularity?: string;
885
+ /** OAuth 2.0 token for the current user. */
886
+ oauth_token?: string;
887
+ /** Returns response with indentations and line breaks. */
888
+ prettyPrint?: boolean;
889
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
890
+ quotaUser?: string;
891
+ /** Required field indicating the script to get metrics for. */
892
+ scriptId: string;
893
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
894
+ upload_protocol?: string;
895
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
896
+ uploadType?: string;
897
+ }): Request<Metrics>;
898
+ /**
899
+ * Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in
900
+ * add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.
901
+ */
902
+ updateContent(request: {
903
+ /** V1 error format. */
904
+ "$.xgafv"?: string;
905
+ /** OAuth access token. */
906
+ access_token?: string;
907
+ /** Data format for response. */
908
+ alt?: string;
909
+ /** JSONP */
910
+ callback?: string;
911
+ /** Selector specifying which fields to include in a partial response. */
912
+ fields?: string;
913
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
914
+ key?: string;
915
+ /** OAuth 2.0 token for the current user. */
916
+ oauth_token?: string;
917
+ /** Returns response with indentations and line breaks. */
918
+ prettyPrint?: boolean;
919
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
920
+ quotaUser?: string;
921
+ /** The script project's Drive ID. */
922
+ scriptId: string;
923
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
924
+ upload_protocol?: string;
925
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
926
+ uploadType?: string;
927
+ /** Request body */
928
+ resource: Content;
929
+ }): Request<Content>;
930
+ updateContent(request: {
931
+ /** V1 error format. */
932
+ "$.xgafv"?: string;
933
+ /** OAuth access token. */
934
+ access_token?: string;
935
+ /** Data format for response. */
936
+ alt?: string;
937
+ /** JSONP */
938
+ callback?: string;
939
+ /** Selector specifying which fields to include in a partial response. */
940
+ fields?: string;
941
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
942
+ key?: string;
943
+ /** OAuth 2.0 token for the current user. */
944
+ oauth_token?: string;
945
+ /** Returns response with indentations and line breaks. */
946
+ prettyPrint?: boolean;
947
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
948
+ quotaUser?: string;
949
+ /** The script project's Drive ID. */
950
+ scriptId: string;
951
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
952
+ upload_protocol?: string;
953
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
954
+ uploadType?: string;
955
+ },
956
+ body: Content): Request<Content>;
957
+ deployments: DeploymentsResource;
958
+ versions: VersionsResource;
959
+ }
960
+ interface ScriptsResource {
961
+ /**
962
+ * Runs a function in an Apps Script project. The script project must be deployed for use with the Apps Script API and the calling application must share the same Cloud Platform
963
+ * project. This method requires authorization with an OAuth 2.0 token that includes at least one of the scopes listed in the [Authorization](#authorization-scopes) section; script
964
+ * projects that do not require authorization cannot be executed through this API. To find the correct scopes to include in the authentication token, open the script project
965
+ * **Overview** page and scroll down to "Project OAuth Scopes." The error `403, PERMISSION_DENIED: The caller does not have permission` indicates that the Cloud Platform project used
966
+ * to authorize the request is not the same as the one used by the script.
967
+ */
968
+ run(request: {
969
+ /** V1 error format. */
970
+ "$.xgafv"?: string;
971
+ /** OAuth access token. */
972
+ access_token?: string;
973
+ /** Data format for response. */
974
+ alt?: string;
975
+ /** JSONP */
976
+ callback?: string;
977
+ /** Selector specifying which fields to include in a partial response. */
978
+ fields?: string;
979
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
980
+ key?: string;
981
+ /** OAuth 2.0 token for the current user. */
982
+ oauth_token?: string;
983
+ /** Returns response with indentations and line breaks. */
984
+ prettyPrint?: boolean;
985
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
986
+ quotaUser?: string;
987
+ /** The script ID of the script to be executed. Find the script ID on the **Project settings** page under "IDs." */
988
+ scriptId: string;
989
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
990
+ upload_protocol?: string;
991
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
992
+ uploadType?: string;
993
+ /** Request body */
994
+ resource: ExecutionRequest;
995
+ }): Request<Operation>;
996
+ run(request: {
997
+ /** V1 error format. */
998
+ "$.xgafv"?: string;
999
+ /** OAuth access token. */
1000
+ access_token?: string;
1001
+ /** Data format for response. */
1002
+ alt?: string;
1003
+ /** JSONP */
1004
+ callback?: string;
1005
+ /** Selector specifying which fields to include in a partial response. */
1006
+ fields?: string;
1007
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1008
+ key?: string;
1009
+ /** OAuth 2.0 token for the current user. */
1010
+ oauth_token?: string;
1011
+ /** Returns response with indentations and line breaks. */
1012
+ prettyPrint?: boolean;
1013
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1014
+ quotaUser?: string;
1015
+ /** The script ID of the script to be executed. Find the script ID on the **Project settings** page under "IDs." */
1016
+ scriptId: string;
1017
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1018
+ upload_protocol?: string;
1019
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1020
+ uploadType?: string;
1021
+ },
1022
+ body: ExecutionRequest): Request<Operation>;
1023
+ }
1024
+
1025
+ const processes: ProcessesResource;
1026
+
1027
+ const projects: ProjectsResource;
1028
+
1029
+ const scripts: ScriptsResource;
1030
+ }
1031
+ }