@googleapis/sheets 9.8.0 → 11.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 +48 -0
- package/build/index.d.ts +1 -1
- package/build/index.js.map +1 -1
- package/build/v4.d.ts +1201 -36
- package/build/v4.js.map +1 -1
- package/index.ts +0 -1
- package/package.json +2 -2
- package/v4.ts +1257 -65
package/v4.ts
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
Compute,
|
|
24
24
|
UserRefreshClient,
|
|
25
25
|
BaseExternalAccountClient,
|
|
26
|
-
|
|
26
|
+
GaxiosResponseWithHTTP2,
|
|
27
27
|
GoogleConfigurable,
|
|
28
28
|
createAPIRequest,
|
|
29
29
|
MethodOptions,
|
|
@@ -312,6 +312,15 @@ export namespace sheets_v4 {
|
|
|
312
312
|
*/
|
|
313
313
|
table?: Schema$Table;
|
|
314
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* The result of adding a table.
|
|
317
|
+
*/
|
|
318
|
+
export interface Schema$AddTableResponse {
|
|
319
|
+
/**
|
|
320
|
+
* Output only. The table that was added.
|
|
321
|
+
*/
|
|
322
|
+
table?: Schema$Table;
|
|
323
|
+
}
|
|
315
324
|
/**
|
|
316
325
|
* Adds new cells after the last row with data in a sheet, inserting new rows into the sheet if necessary.
|
|
317
326
|
*/
|
|
@@ -402,9 +411,13 @@ export namespace sheets_v4 {
|
|
|
402
411
|
*/
|
|
403
412
|
export interface Schema$BandedRange {
|
|
404
413
|
/**
|
|
405
|
-
* The ID of the banded range.
|
|
414
|
+
* The ID of the banded range. If unset, refer to banded_range_reference.
|
|
406
415
|
*/
|
|
407
416
|
bandedRangeId?: number | null;
|
|
417
|
+
/**
|
|
418
|
+
* Output only. The reference of the banded range, used to identify the ID that is not supported by the banded_range_id.
|
|
419
|
+
*/
|
|
420
|
+
bandedRangeReference?: string | null;
|
|
408
421
|
/**
|
|
409
422
|
* Properties for column bands. These properties are applied on a column- by-column basis throughout all the columns in the range. At least one of row_properties or column_properties must be specified.
|
|
410
423
|
*/
|
|
@@ -1170,6 +1183,10 @@ export namespace sheets_v4 {
|
|
|
1170
1183
|
* Data about a specific cell.
|
|
1171
1184
|
*/
|
|
1172
1185
|
export interface Schema$CellData {
|
|
1186
|
+
/**
|
|
1187
|
+
* Optional. Runs of chips applied to subsections of the cell. Properties of a run start at a specific index in the text and continue until the next run. When reading, all chipped and non-chipped runs are included. Non-chipped runs will have an empty Chip. When writing, only runs with chips are included. Runs containing chips are of length 1 and are represented in the user-entered text by an “@” placeholder symbol. New runs will overwrite any prior runs. Writing a new user_entered_value will erase previous runs.
|
|
1188
|
+
*/
|
|
1189
|
+
chipRuns?: Schema$ChipRun[];
|
|
1173
1190
|
/**
|
|
1174
1191
|
* Output only. Information about a data source formula on the cell. The field is set if user_entered_value is a formula referencing some DATA_SOURCE sheet, e.g. `=SUM(DataSheet!Column)`.
|
|
1175
1192
|
*/
|
|
@@ -1472,6 +1489,32 @@ export namespace sheets_v4 {
|
|
|
1472
1489
|
*/
|
|
1473
1490
|
waterfallChart?: Schema$WaterfallChartSpec;
|
|
1474
1491
|
}
|
|
1492
|
+
/**
|
|
1493
|
+
* The Smart Chip.
|
|
1494
|
+
*/
|
|
1495
|
+
export interface Schema$Chip {
|
|
1496
|
+
/**
|
|
1497
|
+
* Properties of a linked person.
|
|
1498
|
+
*/
|
|
1499
|
+
personProperties?: Schema$PersonProperties;
|
|
1500
|
+
/**
|
|
1501
|
+
* Properties of a rich link.
|
|
1502
|
+
*/
|
|
1503
|
+
richLinkProperties?: Schema$RichLinkProperties;
|
|
1504
|
+
}
|
|
1505
|
+
/**
|
|
1506
|
+
* The run of a chip. The chip continues until the start index of the next run.
|
|
1507
|
+
*/
|
|
1508
|
+
export interface Schema$ChipRun {
|
|
1509
|
+
/**
|
|
1510
|
+
* Optional. The chip of this run.
|
|
1511
|
+
*/
|
|
1512
|
+
chip?: Schema$Chip;
|
|
1513
|
+
/**
|
|
1514
|
+
* Required. The zero-based character index where this run starts, in UTF-16 code units.
|
|
1515
|
+
*/
|
|
1516
|
+
startIndex?: number | null;
|
|
1517
|
+
}
|
|
1475
1518
|
/**
|
|
1476
1519
|
* Clears the basic filter, if any exists on the sheet.
|
|
1477
1520
|
*/
|
|
@@ -3146,6 +3189,19 @@ export namespace sheets_v4 {
|
|
|
3146
3189
|
*/
|
|
3147
3190
|
type?: string | null;
|
|
3148
3191
|
}
|
|
3192
|
+
/**
|
|
3193
|
+
* Properties specific to a linked person.
|
|
3194
|
+
*/
|
|
3195
|
+
export interface Schema$PersonProperties {
|
|
3196
|
+
/**
|
|
3197
|
+
* Optional. The display format of the person chip. If not set, the default display format is used.
|
|
3198
|
+
*/
|
|
3199
|
+
displayFormat?: string | null;
|
|
3200
|
+
/**
|
|
3201
|
+
* Required. The email address linked to this person. This field is always present.
|
|
3202
|
+
*/
|
|
3203
|
+
email?: string | null;
|
|
3204
|
+
}
|
|
3149
3205
|
/**
|
|
3150
3206
|
* A pie chart.
|
|
3151
3207
|
*/
|
|
@@ -3833,6 +3889,10 @@ export namespace sheets_v4 {
|
|
|
3833
3889
|
* A reply from adding a slicer.
|
|
3834
3890
|
*/
|
|
3835
3891
|
addSlicer?: Schema$AddSlicerResponse;
|
|
3892
|
+
/**
|
|
3893
|
+
* A reply from adding a table.
|
|
3894
|
+
*/
|
|
3895
|
+
addTable?: Schema$AddTableResponse;
|
|
3836
3896
|
/**
|
|
3837
3897
|
* A reply from cancelling data source object refreshes.
|
|
3838
3898
|
*/
|
|
@@ -3894,6 +3954,19 @@ export namespace sheets_v4 {
|
|
|
3894
3954
|
*/
|
|
3895
3955
|
updateEmbeddedObjectPosition?: Schema$UpdateEmbeddedObjectPositionResponse;
|
|
3896
3956
|
}
|
|
3957
|
+
/**
|
|
3958
|
+
* Properties of a link to a Google resource (such as a file in Drive, a YouTube video, a Maps address, or a Calendar event). Only Drive files can be written as chips. All other rich link types are read only. URIs cannot exceed 2000 bytes when writing. NOTE: Writing Drive file chips requires at least one of the `drive.file`, `drive.readonly`, or `drive` OAuth scopes.
|
|
3959
|
+
*/
|
|
3960
|
+
export interface Schema$RichLinkProperties {
|
|
3961
|
+
/**
|
|
3962
|
+
* Output only. The [MIME type](https://developers.google.com/drive/api/v3/mime-types) of the link, if there's one (for example, when it's a file in Drive).
|
|
3963
|
+
*/
|
|
3964
|
+
mimeType?: string | null;
|
|
3965
|
+
/**
|
|
3966
|
+
* Required. The URI to the link. This is always present.
|
|
3967
|
+
*/
|
|
3968
|
+
uri?: string | null;
|
|
3969
|
+
}
|
|
3897
3970
|
/**
|
|
3898
3971
|
* Data about each cell in a row.
|
|
3899
3972
|
*/
|
|
@@ -5173,6 +5246,69 @@ export namespace sheets_v4 {
|
|
|
5173
5246
|
|
|
5174
5247
|
/**
|
|
5175
5248
|
* Applies one or more updates to the spreadsheet. Each request is validated before being applied. If any request is not valid then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. The replies will mirror the requests. For example, if you applied 4 updates and the 3rd one had a reply, then the response will have 2 empty replies, the actual reply, and another empty reply, in that order. Due to the collaborative nature of spreadsheets, it is not guaranteed that the spreadsheet will reflect exactly your changes after this completes, however it is guaranteed that the updates in the request will be applied together atomically. Your changes may be altered with respect to collaborator changes. If there are no collaborators, the spreadsheet should reflect your changes.
|
|
5249
|
+
* @example
|
|
5250
|
+
* ```js
|
|
5251
|
+
* // Before running the sample:
|
|
5252
|
+
* // - Enable the API at:
|
|
5253
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5254
|
+
* // - Login into gcloud by running:
|
|
5255
|
+
* // ```sh
|
|
5256
|
+
* // $ gcloud auth application-default login
|
|
5257
|
+
* // ```
|
|
5258
|
+
* // - Install the npm module by running:
|
|
5259
|
+
* // ```sh
|
|
5260
|
+
* // $ npm install googleapis
|
|
5261
|
+
* // ```
|
|
5262
|
+
*
|
|
5263
|
+
* const {google} = require('googleapis');
|
|
5264
|
+
* const sheets = google.sheets('v4');
|
|
5265
|
+
*
|
|
5266
|
+
* async function main() {
|
|
5267
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5268
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5269
|
+
* scopes: [
|
|
5270
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5271
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5272
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5273
|
+
* ],
|
|
5274
|
+
* });
|
|
5275
|
+
*
|
|
5276
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5277
|
+
* const authClient = await auth.getClient();
|
|
5278
|
+
* google.options({auth: authClient});
|
|
5279
|
+
*
|
|
5280
|
+
* // Do the magic
|
|
5281
|
+
* const res = await sheets.spreadsheets.batchUpdate({
|
|
5282
|
+
* // The spreadsheet to apply the updates to.
|
|
5283
|
+
* spreadsheetId: 'placeholder-value',
|
|
5284
|
+
*
|
|
5285
|
+
* // Request body metadata
|
|
5286
|
+
* requestBody: {
|
|
5287
|
+
* // request body parameters
|
|
5288
|
+
* // {
|
|
5289
|
+
* // "includeSpreadsheetInResponse": false,
|
|
5290
|
+
* // "requests": [],
|
|
5291
|
+
* // "responseIncludeGridData": false,
|
|
5292
|
+
* // "responseRanges": []
|
|
5293
|
+
* // }
|
|
5294
|
+
* },
|
|
5295
|
+
* });
|
|
5296
|
+
* console.log(res.data);
|
|
5297
|
+
*
|
|
5298
|
+
* // Example response
|
|
5299
|
+
* // {
|
|
5300
|
+
* // "replies": [],
|
|
5301
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5302
|
+
* // "updatedSpreadsheet": {}
|
|
5303
|
+
* // }
|
|
5304
|
+
* }
|
|
5305
|
+
*
|
|
5306
|
+
* main().catch(e => {
|
|
5307
|
+
* console.error(e);
|
|
5308
|
+
* throw e;
|
|
5309
|
+
* });
|
|
5310
|
+
*
|
|
5311
|
+
* ```
|
|
5176
5312
|
*
|
|
5177
5313
|
* @param params - Parameters for request
|
|
5178
5314
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5182,11 +5318,11 @@ export namespace sheets_v4 {
|
|
|
5182
5318
|
batchUpdate(
|
|
5183
5319
|
params: Params$Resource$Spreadsheets$Batchupdate,
|
|
5184
5320
|
options: StreamMethodOptions
|
|
5185
|
-
):
|
|
5321
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5186
5322
|
batchUpdate(
|
|
5187
5323
|
params?: Params$Resource$Spreadsheets$Batchupdate,
|
|
5188
5324
|
options?: MethodOptions
|
|
5189
|
-
):
|
|
5325
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchUpdateSpreadsheetResponse>>;
|
|
5190
5326
|
batchUpdate(
|
|
5191
5327
|
params: Params$Resource$Spreadsheets$Batchupdate,
|
|
5192
5328
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5221,8 +5357,8 @@ export namespace sheets_v4 {
|
|
|
5221
5357
|
| BodyResponseCallback<Readable>
|
|
5222
5358
|
):
|
|
5223
5359
|
| void
|
|
5224
|
-
|
|
|
5225
|
-
|
|
|
5360
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchUpdateSpreadsheetResponse>>
|
|
5361
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5226
5362
|
let params = (paramsOrCallback ||
|
|
5227
5363
|
{}) as Params$Resource$Spreadsheets$Batchupdate;
|
|
5228
5364
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5269,6 +5405,75 @@ export namespace sheets_v4 {
|
|
|
5269
5405
|
|
|
5270
5406
|
/**
|
|
5271
5407
|
* Creates a spreadsheet, returning the newly created spreadsheet.
|
|
5408
|
+
* @example
|
|
5409
|
+
* ```js
|
|
5410
|
+
* // Before running the sample:
|
|
5411
|
+
* // - Enable the API at:
|
|
5412
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5413
|
+
* // - Login into gcloud by running:
|
|
5414
|
+
* // ```sh
|
|
5415
|
+
* // $ gcloud auth application-default login
|
|
5416
|
+
* // ```
|
|
5417
|
+
* // - Install the npm module by running:
|
|
5418
|
+
* // ```sh
|
|
5419
|
+
* // $ npm install googleapis
|
|
5420
|
+
* // ```
|
|
5421
|
+
*
|
|
5422
|
+
* const {google} = require('googleapis');
|
|
5423
|
+
* const sheets = google.sheets('v4');
|
|
5424
|
+
*
|
|
5425
|
+
* async function main() {
|
|
5426
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5427
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5428
|
+
* scopes: [
|
|
5429
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5430
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5431
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5432
|
+
* ],
|
|
5433
|
+
* });
|
|
5434
|
+
*
|
|
5435
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5436
|
+
* const authClient = await auth.getClient();
|
|
5437
|
+
* google.options({auth: authClient});
|
|
5438
|
+
*
|
|
5439
|
+
* // Do the magic
|
|
5440
|
+
* const res = await sheets.spreadsheets.create({
|
|
5441
|
+
* // Request body metadata
|
|
5442
|
+
* requestBody: {
|
|
5443
|
+
* // request body parameters
|
|
5444
|
+
* // {
|
|
5445
|
+
* // "dataSourceSchedules": [],
|
|
5446
|
+
* // "dataSources": [],
|
|
5447
|
+
* // "developerMetadata": [],
|
|
5448
|
+
* // "namedRanges": [],
|
|
5449
|
+
* // "properties": {},
|
|
5450
|
+
* // "sheets": [],
|
|
5451
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5452
|
+
* // "spreadsheetUrl": "my_spreadsheetUrl"
|
|
5453
|
+
* // }
|
|
5454
|
+
* },
|
|
5455
|
+
* });
|
|
5456
|
+
* console.log(res.data);
|
|
5457
|
+
*
|
|
5458
|
+
* // Example response
|
|
5459
|
+
* // {
|
|
5460
|
+
* // "dataSourceSchedules": [],
|
|
5461
|
+
* // "dataSources": [],
|
|
5462
|
+
* // "developerMetadata": [],
|
|
5463
|
+
* // "namedRanges": [],
|
|
5464
|
+
* // "properties": {},
|
|
5465
|
+
* // "sheets": [],
|
|
5466
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5467
|
+
* // "spreadsheetUrl": "my_spreadsheetUrl"
|
|
5468
|
+
* // }
|
|
5469
|
+
* }
|
|
5470
|
+
*
|
|
5471
|
+
* main().catch(e => {
|
|
5472
|
+
* console.error(e);
|
|
5473
|
+
* throw e;
|
|
5474
|
+
* });
|
|
5475
|
+
*
|
|
5476
|
+
* ```
|
|
5272
5477
|
*
|
|
5273
5478
|
* @param params - Parameters for request
|
|
5274
5479
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5278,11 +5483,11 @@ export namespace sheets_v4 {
|
|
|
5278
5483
|
create(
|
|
5279
5484
|
params: Params$Resource$Spreadsheets$Create,
|
|
5280
5485
|
options: StreamMethodOptions
|
|
5281
|
-
):
|
|
5486
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5282
5487
|
create(
|
|
5283
5488
|
params?: Params$Resource$Spreadsheets$Create,
|
|
5284
5489
|
options?: MethodOptions
|
|
5285
|
-
):
|
|
5490
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Spreadsheet>>;
|
|
5286
5491
|
create(
|
|
5287
5492
|
params: Params$Resource$Spreadsheets$Create,
|
|
5288
5493
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5311,7 +5516,10 @@ export namespace sheets_v4 {
|
|
|
5311
5516
|
callback?:
|
|
5312
5517
|
| BodyResponseCallback<Schema$Spreadsheet>
|
|
5313
5518
|
| BodyResponseCallback<Readable>
|
|
5314
|
-
):
|
|
5519
|
+
):
|
|
5520
|
+
| void
|
|
5521
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Spreadsheet>>
|
|
5522
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5315
5523
|
let params = (paramsOrCallback ||
|
|
5316
5524
|
{}) as Params$Resource$Spreadsheets$Create;
|
|
5317
5525
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5354,6 +5562,71 @@ export namespace sheets_v4 {
|
|
|
5354
5562
|
|
|
5355
5563
|
/**
|
|
5356
5564
|
* Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. By default, data within grids is not returned. You can include grid data in one of 2 ways: * Specify a [field mask](https://developers.google.com/workspace/sheets/api/guides/field-masks) listing your desired fields using the `fields` URL parameter in HTTP * Set the includeGridData URL parameter to true. If a field mask is set, the `includeGridData` parameter is ignored For large spreadsheets, as a best practice, retrieve only the specific spreadsheet fields that you want. To retrieve only subsets of spreadsheet data, use the ranges URL parameter. Ranges are specified using [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell). You can define a single cell (for example, `A1`) or multiple cells (for example, `A1:D5`). You can also get cells from other sheets within the same spreadsheet (for example, `Sheet2!A1:C4`) or retrieve multiple ranges at once (for example, `?ranges=A1:D5&ranges=Sheet2!A1:C4`). Limiting the range returns only the portions of the spreadsheet that intersect the requested ranges.
|
|
5565
|
+
* @example
|
|
5566
|
+
* ```js
|
|
5567
|
+
* // Before running the sample:
|
|
5568
|
+
* // - Enable the API at:
|
|
5569
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5570
|
+
* // - Login into gcloud by running:
|
|
5571
|
+
* // ```sh
|
|
5572
|
+
* // $ gcloud auth application-default login
|
|
5573
|
+
* // ```
|
|
5574
|
+
* // - Install the npm module by running:
|
|
5575
|
+
* // ```sh
|
|
5576
|
+
* // $ npm install googleapis
|
|
5577
|
+
* // ```
|
|
5578
|
+
*
|
|
5579
|
+
* const {google} = require('googleapis');
|
|
5580
|
+
* const sheets = google.sheets('v4');
|
|
5581
|
+
*
|
|
5582
|
+
* async function main() {
|
|
5583
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5584
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5585
|
+
* scopes: [
|
|
5586
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5587
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5588
|
+
* 'https://www.googleapis.com/auth/drive.readonly',
|
|
5589
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5590
|
+
* 'https://www.googleapis.com/auth/spreadsheets.readonly',
|
|
5591
|
+
* ],
|
|
5592
|
+
* });
|
|
5593
|
+
*
|
|
5594
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5595
|
+
* const authClient = await auth.getClient();
|
|
5596
|
+
* google.options({auth: authClient});
|
|
5597
|
+
*
|
|
5598
|
+
* // Do the magic
|
|
5599
|
+
* const res = await sheets.spreadsheets.get({
|
|
5600
|
+
* // True if tables should be excluded in the banded ranges. False if not set.
|
|
5601
|
+
* excludeTablesInBandedRanges: 'placeholder-value',
|
|
5602
|
+
* // True if grid data should be returned. This parameter is ignored if a field mask was set in the request.
|
|
5603
|
+
* includeGridData: 'placeholder-value',
|
|
5604
|
+
* // The ranges to retrieve from the spreadsheet.
|
|
5605
|
+
* ranges: 'placeholder-value',
|
|
5606
|
+
* // The spreadsheet to request.
|
|
5607
|
+
* spreadsheetId: 'placeholder-value',
|
|
5608
|
+
* });
|
|
5609
|
+
* console.log(res.data);
|
|
5610
|
+
*
|
|
5611
|
+
* // Example response
|
|
5612
|
+
* // {
|
|
5613
|
+
* // "dataSourceSchedules": [],
|
|
5614
|
+
* // "dataSources": [],
|
|
5615
|
+
* // "developerMetadata": [],
|
|
5616
|
+
* // "namedRanges": [],
|
|
5617
|
+
* // "properties": {},
|
|
5618
|
+
* // "sheets": [],
|
|
5619
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5620
|
+
* // "spreadsheetUrl": "my_spreadsheetUrl"
|
|
5621
|
+
* // }
|
|
5622
|
+
* }
|
|
5623
|
+
*
|
|
5624
|
+
* main().catch(e => {
|
|
5625
|
+
* console.error(e);
|
|
5626
|
+
* throw e;
|
|
5627
|
+
* });
|
|
5628
|
+
*
|
|
5629
|
+
* ```
|
|
5357
5630
|
*
|
|
5358
5631
|
* @param params - Parameters for request
|
|
5359
5632
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5363,11 +5636,11 @@ export namespace sheets_v4 {
|
|
|
5363
5636
|
get(
|
|
5364
5637
|
params: Params$Resource$Spreadsheets$Get,
|
|
5365
5638
|
options: StreamMethodOptions
|
|
5366
|
-
):
|
|
5639
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5367
5640
|
get(
|
|
5368
5641
|
params?: Params$Resource$Spreadsheets$Get,
|
|
5369
5642
|
options?: MethodOptions
|
|
5370
|
-
):
|
|
5643
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Spreadsheet>>;
|
|
5371
5644
|
get(
|
|
5372
5645
|
params: Params$Resource$Spreadsheets$Get,
|
|
5373
5646
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5396,7 +5669,10 @@ export namespace sheets_v4 {
|
|
|
5396
5669
|
callback?:
|
|
5397
5670
|
| BodyResponseCallback<Schema$Spreadsheet>
|
|
5398
5671
|
| BodyResponseCallback<Readable>
|
|
5399
|
-
):
|
|
5672
|
+
):
|
|
5673
|
+
| void
|
|
5674
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Spreadsheet>>
|
|
5675
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5400
5676
|
let params = (paramsOrCallback || {}) as Params$Resource$Spreadsheets$Get;
|
|
5401
5677
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
5402
5678
|
|
|
@@ -5441,6 +5717,73 @@ export namespace sheets_v4 {
|
|
|
5441
5717
|
|
|
5442
5718
|
/**
|
|
5443
5719
|
* Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. This method differs from GetSpreadsheet in that it allows selecting which subsets of spreadsheet data to return by specifying a dataFilters parameter. Multiple DataFilters can be specified. Specifying one or more data filters returns the portions of the spreadsheet that intersect ranges matched by any of the filters. By default, data within grids is not returned. You can include grid data one of 2 ways: * Specify a [field mask](https://developers.google.com/workspace/sheets/api/guides/field-masks) listing your desired fields using the `fields` URL parameter in HTTP * Set the includeGridData parameter to true. If a field mask is set, the `includeGridData` parameter is ignored For large spreadsheets, as a best practice, retrieve only the specific spreadsheet fields that you want.
|
|
5720
|
+
* @example
|
|
5721
|
+
* ```js
|
|
5722
|
+
* // Before running the sample:
|
|
5723
|
+
* // - Enable the API at:
|
|
5724
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5725
|
+
* // - Login into gcloud by running:
|
|
5726
|
+
* // ```sh
|
|
5727
|
+
* // $ gcloud auth application-default login
|
|
5728
|
+
* // ```
|
|
5729
|
+
* // - Install the npm module by running:
|
|
5730
|
+
* // ```sh
|
|
5731
|
+
* // $ npm install googleapis
|
|
5732
|
+
* // ```
|
|
5733
|
+
*
|
|
5734
|
+
* const {google} = require('googleapis');
|
|
5735
|
+
* const sheets = google.sheets('v4');
|
|
5736
|
+
*
|
|
5737
|
+
* async function main() {
|
|
5738
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5739
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5740
|
+
* scopes: [
|
|
5741
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5742
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5743
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5744
|
+
* ],
|
|
5745
|
+
* });
|
|
5746
|
+
*
|
|
5747
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5748
|
+
* const authClient = await auth.getClient();
|
|
5749
|
+
* google.options({auth: authClient});
|
|
5750
|
+
*
|
|
5751
|
+
* // Do the magic
|
|
5752
|
+
* const res = await sheets.spreadsheets.getByDataFilter({
|
|
5753
|
+
* // The spreadsheet to request.
|
|
5754
|
+
* spreadsheetId: 'placeholder-value',
|
|
5755
|
+
*
|
|
5756
|
+
* // Request body metadata
|
|
5757
|
+
* requestBody: {
|
|
5758
|
+
* // request body parameters
|
|
5759
|
+
* // {
|
|
5760
|
+
* // "dataFilters": [],
|
|
5761
|
+
* // "excludeTablesInBandedRanges": false,
|
|
5762
|
+
* // "includeGridData": false
|
|
5763
|
+
* // }
|
|
5764
|
+
* },
|
|
5765
|
+
* });
|
|
5766
|
+
* console.log(res.data);
|
|
5767
|
+
*
|
|
5768
|
+
* // Example response
|
|
5769
|
+
* // {
|
|
5770
|
+
* // "dataSourceSchedules": [],
|
|
5771
|
+
* // "dataSources": [],
|
|
5772
|
+
* // "developerMetadata": [],
|
|
5773
|
+
* // "namedRanges": [],
|
|
5774
|
+
* // "properties": {},
|
|
5775
|
+
* // "sheets": [],
|
|
5776
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5777
|
+
* // "spreadsheetUrl": "my_spreadsheetUrl"
|
|
5778
|
+
* // }
|
|
5779
|
+
* }
|
|
5780
|
+
*
|
|
5781
|
+
* main().catch(e => {
|
|
5782
|
+
* console.error(e);
|
|
5783
|
+
* throw e;
|
|
5784
|
+
* });
|
|
5785
|
+
*
|
|
5786
|
+
* ```
|
|
5444
5787
|
*
|
|
5445
5788
|
* @param params - Parameters for request
|
|
5446
5789
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5450,11 +5793,11 @@ export namespace sheets_v4 {
|
|
|
5450
5793
|
getByDataFilter(
|
|
5451
5794
|
params: Params$Resource$Spreadsheets$Getbydatafilter,
|
|
5452
5795
|
options: StreamMethodOptions
|
|
5453
|
-
):
|
|
5796
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5454
5797
|
getByDataFilter(
|
|
5455
5798
|
params?: Params$Resource$Spreadsheets$Getbydatafilter,
|
|
5456
5799
|
options?: MethodOptions
|
|
5457
|
-
):
|
|
5800
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Spreadsheet>>;
|
|
5458
5801
|
getByDataFilter(
|
|
5459
5802
|
params: Params$Resource$Spreadsheets$Getbydatafilter,
|
|
5460
5803
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5483,7 +5826,10 @@ export namespace sheets_v4 {
|
|
|
5483
5826
|
callback?:
|
|
5484
5827
|
| BodyResponseCallback<Schema$Spreadsheet>
|
|
5485
5828
|
| BodyResponseCallback<Readable>
|
|
5486
|
-
):
|
|
5829
|
+
):
|
|
5830
|
+
| void
|
|
5831
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Spreadsheet>>
|
|
5832
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5487
5833
|
let params = (paramsOrCallback ||
|
|
5488
5834
|
{}) as Params$Resource$Spreadsheets$Getbydatafilter;
|
|
5489
5835
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5585,6 +5931,62 @@ export namespace sheets_v4 {
|
|
|
5585
5931
|
|
|
5586
5932
|
/**
|
|
5587
5933
|
* Returns the developer metadata with the specified ID. The caller must specify the spreadsheet ID and the developer metadata's unique metadataId.
|
|
5934
|
+
* @example
|
|
5935
|
+
* ```js
|
|
5936
|
+
* // Before running the sample:
|
|
5937
|
+
* // - Enable the API at:
|
|
5938
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5939
|
+
* // - Login into gcloud by running:
|
|
5940
|
+
* // ```sh
|
|
5941
|
+
* // $ gcloud auth application-default login
|
|
5942
|
+
* // ```
|
|
5943
|
+
* // - Install the npm module by running:
|
|
5944
|
+
* // ```sh
|
|
5945
|
+
* // $ npm install googleapis
|
|
5946
|
+
* // ```
|
|
5947
|
+
*
|
|
5948
|
+
* const {google} = require('googleapis');
|
|
5949
|
+
* const sheets = google.sheets('v4');
|
|
5950
|
+
*
|
|
5951
|
+
* async function main() {
|
|
5952
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5953
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5954
|
+
* scopes: [
|
|
5955
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5956
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5957
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5958
|
+
* ],
|
|
5959
|
+
* });
|
|
5960
|
+
*
|
|
5961
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5962
|
+
* const authClient = await auth.getClient();
|
|
5963
|
+
* google.options({auth: authClient});
|
|
5964
|
+
*
|
|
5965
|
+
* // Do the magic
|
|
5966
|
+
* const res = await sheets.spreadsheets.developerMetadata.get({
|
|
5967
|
+
* // The ID of the developer metadata to retrieve.
|
|
5968
|
+
* metadataId: 'placeholder-value',
|
|
5969
|
+
* // The ID of the spreadsheet to retrieve metadata from.
|
|
5970
|
+
* spreadsheetId: 'placeholder-value',
|
|
5971
|
+
* });
|
|
5972
|
+
* console.log(res.data);
|
|
5973
|
+
*
|
|
5974
|
+
* // Example response
|
|
5975
|
+
* // {
|
|
5976
|
+
* // "location": {},
|
|
5977
|
+
* // "metadataId": 0,
|
|
5978
|
+
* // "metadataKey": "my_metadataKey",
|
|
5979
|
+
* // "metadataValue": "my_metadataValue",
|
|
5980
|
+
* // "visibility": "my_visibility"
|
|
5981
|
+
* // }
|
|
5982
|
+
* }
|
|
5983
|
+
*
|
|
5984
|
+
* main().catch(e => {
|
|
5985
|
+
* console.error(e);
|
|
5986
|
+
* throw e;
|
|
5987
|
+
* });
|
|
5988
|
+
*
|
|
5989
|
+
* ```
|
|
5588
5990
|
*
|
|
5589
5991
|
* @param params - Parameters for request
|
|
5590
5992
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5594,11 +5996,11 @@ export namespace sheets_v4 {
|
|
|
5594
5996
|
get(
|
|
5595
5997
|
params: Params$Resource$Spreadsheets$Developermetadata$Get,
|
|
5596
5998
|
options: StreamMethodOptions
|
|
5597
|
-
):
|
|
5999
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5598
6000
|
get(
|
|
5599
6001
|
params?: Params$Resource$Spreadsheets$Developermetadata$Get,
|
|
5600
6002
|
options?: MethodOptions
|
|
5601
|
-
):
|
|
6003
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$DeveloperMetadata>>;
|
|
5602
6004
|
get(
|
|
5603
6005
|
params: Params$Resource$Spreadsheets$Developermetadata$Get,
|
|
5604
6006
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5629,8 +6031,8 @@ export namespace sheets_v4 {
|
|
|
5629
6031
|
| BodyResponseCallback<Readable>
|
|
5630
6032
|
):
|
|
5631
6033
|
| void
|
|
5632
|
-
|
|
|
5633
|
-
|
|
|
6034
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$DeveloperMetadata>>
|
|
6035
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5634
6036
|
let params = (paramsOrCallback ||
|
|
5635
6037
|
{}) as Params$Resource$Spreadsheets$Developermetadata$Get;
|
|
5636
6038
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5676,6 +6078,64 @@ export namespace sheets_v4 {
|
|
|
5676
6078
|
|
|
5677
6079
|
/**
|
|
5678
6080
|
* Returns all developer metadata matching the specified DataFilter. If the provided DataFilter represents a DeveloperMetadataLookup object, this will return all DeveloperMetadata entries selected by it. If the DataFilter represents a location in a spreadsheet, this will return all developer metadata associated with locations intersecting that region.
|
|
6081
|
+
* @example
|
|
6082
|
+
* ```js
|
|
6083
|
+
* // Before running the sample:
|
|
6084
|
+
* // - Enable the API at:
|
|
6085
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6086
|
+
* // - Login into gcloud by running:
|
|
6087
|
+
* // ```sh
|
|
6088
|
+
* // $ gcloud auth application-default login
|
|
6089
|
+
* // ```
|
|
6090
|
+
* // - Install the npm module by running:
|
|
6091
|
+
* // ```sh
|
|
6092
|
+
* // $ npm install googleapis
|
|
6093
|
+
* // ```
|
|
6094
|
+
*
|
|
6095
|
+
* const {google} = require('googleapis');
|
|
6096
|
+
* const sheets = google.sheets('v4');
|
|
6097
|
+
*
|
|
6098
|
+
* async function main() {
|
|
6099
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6100
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6101
|
+
* scopes: [
|
|
6102
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6103
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6104
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6105
|
+
* ],
|
|
6106
|
+
* });
|
|
6107
|
+
*
|
|
6108
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6109
|
+
* const authClient = await auth.getClient();
|
|
6110
|
+
* google.options({auth: authClient});
|
|
6111
|
+
*
|
|
6112
|
+
* // Do the magic
|
|
6113
|
+
* const res = await sheets.spreadsheets.developerMetadata.search({
|
|
6114
|
+
* // The ID of the spreadsheet to retrieve metadata from.
|
|
6115
|
+
* spreadsheetId: 'placeholder-value',
|
|
6116
|
+
*
|
|
6117
|
+
* // Request body metadata
|
|
6118
|
+
* requestBody: {
|
|
6119
|
+
* // request body parameters
|
|
6120
|
+
* // {
|
|
6121
|
+
* // "dataFilters": []
|
|
6122
|
+
* // }
|
|
6123
|
+
* },
|
|
6124
|
+
* });
|
|
6125
|
+
* console.log(res.data);
|
|
6126
|
+
*
|
|
6127
|
+
* // Example response
|
|
6128
|
+
* // {
|
|
6129
|
+
* // "matchedDeveloperMetadata": []
|
|
6130
|
+
* // }
|
|
6131
|
+
* }
|
|
6132
|
+
*
|
|
6133
|
+
* main().catch(e => {
|
|
6134
|
+
* console.error(e);
|
|
6135
|
+
* throw e;
|
|
6136
|
+
* });
|
|
6137
|
+
*
|
|
6138
|
+
* ```
|
|
5679
6139
|
*
|
|
5680
6140
|
* @param params - Parameters for request
|
|
5681
6141
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5685,11 +6145,11 @@ export namespace sheets_v4 {
|
|
|
5685
6145
|
search(
|
|
5686
6146
|
params: Params$Resource$Spreadsheets$Developermetadata$Search,
|
|
5687
6147
|
options: StreamMethodOptions
|
|
5688
|
-
):
|
|
6148
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5689
6149
|
search(
|
|
5690
6150
|
params?: Params$Resource$Spreadsheets$Developermetadata$Search,
|
|
5691
6151
|
options?: MethodOptions
|
|
5692
|
-
):
|
|
6152
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$SearchDeveloperMetadataResponse>>;
|
|
5693
6153
|
search(
|
|
5694
6154
|
params: Params$Resource$Spreadsheets$Developermetadata$Search,
|
|
5695
6155
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5724,8 +6184,8 @@ export namespace sheets_v4 {
|
|
|
5724
6184
|
| BodyResponseCallback<Readable>
|
|
5725
6185
|
):
|
|
5726
6186
|
| void
|
|
5727
|
-
|
|
|
5728
|
-
|
|
|
6187
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$SearchDeveloperMetadataResponse>>
|
|
6188
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5729
6189
|
let params = (paramsOrCallback ||
|
|
5730
6190
|
{}) as Params$Resource$Spreadsheets$Developermetadata$Search;
|
|
5731
6191
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5804,6 +6264,75 @@ export namespace sheets_v4 {
|
|
|
5804
6264
|
|
|
5805
6265
|
/**
|
|
5806
6266
|
* Copies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.
|
|
6267
|
+
* @example
|
|
6268
|
+
* ```js
|
|
6269
|
+
* // Before running the sample:
|
|
6270
|
+
* // - Enable the API at:
|
|
6271
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6272
|
+
* // - Login into gcloud by running:
|
|
6273
|
+
* // ```sh
|
|
6274
|
+
* // $ gcloud auth application-default login
|
|
6275
|
+
* // ```
|
|
6276
|
+
* // - Install the npm module by running:
|
|
6277
|
+
* // ```sh
|
|
6278
|
+
* // $ npm install googleapis
|
|
6279
|
+
* // ```
|
|
6280
|
+
*
|
|
6281
|
+
* const {google} = require('googleapis');
|
|
6282
|
+
* const sheets = google.sheets('v4');
|
|
6283
|
+
*
|
|
6284
|
+
* async function main() {
|
|
6285
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6286
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6287
|
+
* scopes: [
|
|
6288
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6289
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6290
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6291
|
+
* ],
|
|
6292
|
+
* });
|
|
6293
|
+
*
|
|
6294
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6295
|
+
* const authClient = await auth.getClient();
|
|
6296
|
+
* google.options({auth: authClient});
|
|
6297
|
+
*
|
|
6298
|
+
* // Do the magic
|
|
6299
|
+
* const res = await sheets.spreadsheets.sheets.copyTo({
|
|
6300
|
+
* // The ID of the sheet to copy.
|
|
6301
|
+
* sheetId: 'placeholder-value',
|
|
6302
|
+
* // The ID of the spreadsheet containing the sheet to copy.
|
|
6303
|
+
* spreadsheetId: 'placeholder-value',
|
|
6304
|
+
*
|
|
6305
|
+
* // Request body metadata
|
|
6306
|
+
* requestBody: {
|
|
6307
|
+
* // request body parameters
|
|
6308
|
+
* // {
|
|
6309
|
+
* // "destinationSpreadsheetId": "my_destinationSpreadsheetId"
|
|
6310
|
+
* // }
|
|
6311
|
+
* },
|
|
6312
|
+
* });
|
|
6313
|
+
* console.log(res.data);
|
|
6314
|
+
*
|
|
6315
|
+
* // Example response
|
|
6316
|
+
* // {
|
|
6317
|
+
* // "dataSourceSheetProperties": {},
|
|
6318
|
+
* // "gridProperties": {},
|
|
6319
|
+
* // "hidden": false,
|
|
6320
|
+
* // "index": 0,
|
|
6321
|
+
* // "rightToLeft": false,
|
|
6322
|
+
* // "sheetId": 0,
|
|
6323
|
+
* // "sheetType": "my_sheetType",
|
|
6324
|
+
* // "tabColor": {},
|
|
6325
|
+
* // "tabColorStyle": {},
|
|
6326
|
+
* // "title": "my_title"
|
|
6327
|
+
* // }
|
|
6328
|
+
* }
|
|
6329
|
+
*
|
|
6330
|
+
* main().catch(e => {
|
|
6331
|
+
* console.error(e);
|
|
6332
|
+
* throw e;
|
|
6333
|
+
* });
|
|
6334
|
+
*
|
|
6335
|
+
* ```
|
|
5807
6336
|
*
|
|
5808
6337
|
* @param params - Parameters for request
|
|
5809
6338
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5813,11 +6342,11 @@ export namespace sheets_v4 {
|
|
|
5813
6342
|
copyTo(
|
|
5814
6343
|
params: Params$Resource$Spreadsheets$Sheets$Copyto,
|
|
5815
6344
|
options: StreamMethodOptions
|
|
5816
|
-
):
|
|
6345
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5817
6346
|
copyTo(
|
|
5818
6347
|
params?: Params$Resource$Spreadsheets$Sheets$Copyto,
|
|
5819
6348
|
options?: MethodOptions
|
|
5820
|
-
):
|
|
6349
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$SheetProperties>>;
|
|
5821
6350
|
copyTo(
|
|
5822
6351
|
params: Params$Resource$Spreadsheets$Sheets$Copyto,
|
|
5823
6352
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5846,7 +6375,10 @@ export namespace sheets_v4 {
|
|
|
5846
6375
|
callback?:
|
|
5847
6376
|
| BodyResponseCallback<Schema$SheetProperties>
|
|
5848
6377
|
| BodyResponseCallback<Readable>
|
|
5849
|
-
):
|
|
6378
|
+
):
|
|
6379
|
+
| void
|
|
6380
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$SheetProperties>>
|
|
6381
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5850
6382
|
let params = (paramsOrCallback ||
|
|
5851
6383
|
{}) as Params$Resource$Spreadsheets$Sheets$Copyto;
|
|
5852
6384
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5916,6 +6448,80 @@ export namespace sheets_v4 {
|
|
|
5916
6448
|
|
|
5917
6449
|
/**
|
|
5918
6450
|
* Appends values to a spreadsheet. The input range is used to search for existing data and find a "table" within that range. Values will be appended to the next row of the table, starting with the first column of the table. See the [guide](https://developers.google.com/workspace/sheets/api/guides/values#appending_values) and [sample code](https://developers.google.com/workspace/sheets/api/samples/writing#append_values) for specific details of how tables are detected and data is appended. The caller must specify the spreadsheet ID, range, and a valueInputOption. The `valueInputOption` only controls how the input data will be added to the sheet (column-wise or row-wise), it does not influence what cell the data starts being written to.
|
|
6451
|
+
* @example
|
|
6452
|
+
* ```js
|
|
6453
|
+
* // Before running the sample:
|
|
6454
|
+
* // - Enable the API at:
|
|
6455
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6456
|
+
* // - Login into gcloud by running:
|
|
6457
|
+
* // ```sh
|
|
6458
|
+
* // $ gcloud auth application-default login
|
|
6459
|
+
* // ```
|
|
6460
|
+
* // - Install the npm module by running:
|
|
6461
|
+
* // ```sh
|
|
6462
|
+
* // $ npm install googleapis
|
|
6463
|
+
* // ```
|
|
6464
|
+
*
|
|
6465
|
+
* const {google} = require('googleapis');
|
|
6466
|
+
* const sheets = google.sheets('v4');
|
|
6467
|
+
*
|
|
6468
|
+
* async function main() {
|
|
6469
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6470
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6471
|
+
* scopes: [
|
|
6472
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6473
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6474
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6475
|
+
* ],
|
|
6476
|
+
* });
|
|
6477
|
+
*
|
|
6478
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6479
|
+
* const authClient = await auth.getClient();
|
|
6480
|
+
* google.options({auth: authClient});
|
|
6481
|
+
*
|
|
6482
|
+
* // Do the magic
|
|
6483
|
+
* const res = await sheets.spreadsheets.values.append({
|
|
6484
|
+
* // Determines if the update response should include the values of the cells that were appended. By default, responses do not include the updated values.
|
|
6485
|
+
* includeValuesInResponse: 'placeholder-value',
|
|
6486
|
+
* // How the input data should be inserted.
|
|
6487
|
+
* insertDataOption: 'placeholder-value',
|
|
6488
|
+
* // The [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of a range to search for a logical table of data. Values are appended after the last row of the table.
|
|
6489
|
+
* range: 'placeholder-value',
|
|
6490
|
+
* // Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
|
|
6491
|
+
* responseDateTimeRenderOption: 'placeholder-value',
|
|
6492
|
+
* // Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
|
|
6493
|
+
* responseValueRenderOption: 'placeholder-value',
|
|
6494
|
+
* // The ID of the spreadsheet to update.
|
|
6495
|
+
* spreadsheetId: 'placeholder-value',
|
|
6496
|
+
* // How the input data should be interpreted.
|
|
6497
|
+
* valueInputOption: 'placeholder-value',
|
|
6498
|
+
*
|
|
6499
|
+
* // Request body metadata
|
|
6500
|
+
* requestBody: {
|
|
6501
|
+
* // request body parameters
|
|
6502
|
+
* // {
|
|
6503
|
+
* // "majorDimension": "my_majorDimension",
|
|
6504
|
+
* // "range": "my_range",
|
|
6505
|
+
* // "values": []
|
|
6506
|
+
* // }
|
|
6507
|
+
* },
|
|
6508
|
+
* });
|
|
6509
|
+
* console.log(res.data);
|
|
6510
|
+
*
|
|
6511
|
+
* // Example response
|
|
6512
|
+
* // {
|
|
6513
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
6514
|
+
* // "tableRange": "my_tableRange",
|
|
6515
|
+
* // "updates": {}
|
|
6516
|
+
* // }
|
|
6517
|
+
* }
|
|
6518
|
+
*
|
|
6519
|
+
* main().catch(e => {
|
|
6520
|
+
* console.error(e);
|
|
6521
|
+
* throw e;
|
|
6522
|
+
* });
|
|
6523
|
+
*
|
|
6524
|
+
* ```
|
|
5919
6525
|
*
|
|
5920
6526
|
* @param params - Parameters for request
|
|
5921
6527
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5925,11 +6531,11 @@ export namespace sheets_v4 {
|
|
|
5925
6531
|
append(
|
|
5926
6532
|
params: Params$Resource$Spreadsheets$Values$Append,
|
|
5927
6533
|
options: StreamMethodOptions
|
|
5928
|
-
):
|
|
6534
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5929
6535
|
append(
|
|
5930
6536
|
params?: Params$Resource$Spreadsheets$Values$Append,
|
|
5931
6537
|
options?: MethodOptions
|
|
5932
|
-
):
|
|
6538
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$AppendValuesResponse>>;
|
|
5933
6539
|
append(
|
|
5934
6540
|
params: Params$Resource$Spreadsheets$Values$Append,
|
|
5935
6541
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5962,8 +6568,8 @@ export namespace sheets_v4 {
|
|
|
5962
6568
|
| BodyResponseCallback<Readable>
|
|
5963
6569
|
):
|
|
5964
6570
|
| void
|
|
5965
|
-
|
|
|
5966
|
-
|
|
|
6571
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$AppendValuesResponse>>
|
|
6572
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5967
6573
|
let params = (paramsOrCallback ||
|
|
5968
6574
|
{}) as Params$Resource$Spreadsheets$Values$Append;
|
|
5969
6575
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6008,6 +6614,65 @@ export namespace sheets_v4 {
|
|
|
6008
6614
|
|
|
6009
6615
|
/**
|
|
6010
6616
|
* Clears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges. Only values are cleared -- all other properties of the cell (such as formatting and data validation) are kept.
|
|
6617
|
+
* @example
|
|
6618
|
+
* ```js
|
|
6619
|
+
* // Before running the sample:
|
|
6620
|
+
* // - Enable the API at:
|
|
6621
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6622
|
+
* // - Login into gcloud by running:
|
|
6623
|
+
* // ```sh
|
|
6624
|
+
* // $ gcloud auth application-default login
|
|
6625
|
+
* // ```
|
|
6626
|
+
* // - Install the npm module by running:
|
|
6627
|
+
* // ```sh
|
|
6628
|
+
* // $ npm install googleapis
|
|
6629
|
+
* // ```
|
|
6630
|
+
*
|
|
6631
|
+
* const {google} = require('googleapis');
|
|
6632
|
+
* const sheets = google.sheets('v4');
|
|
6633
|
+
*
|
|
6634
|
+
* async function main() {
|
|
6635
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6636
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6637
|
+
* scopes: [
|
|
6638
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6639
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6640
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6641
|
+
* ],
|
|
6642
|
+
* });
|
|
6643
|
+
*
|
|
6644
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6645
|
+
* const authClient = await auth.getClient();
|
|
6646
|
+
* google.options({auth: authClient});
|
|
6647
|
+
*
|
|
6648
|
+
* // Do the magic
|
|
6649
|
+
* const res = await sheets.spreadsheets.values.batchClear({
|
|
6650
|
+
* // The ID of the spreadsheet to update.
|
|
6651
|
+
* spreadsheetId: 'placeholder-value',
|
|
6652
|
+
*
|
|
6653
|
+
* // Request body metadata
|
|
6654
|
+
* requestBody: {
|
|
6655
|
+
* // request body parameters
|
|
6656
|
+
* // {
|
|
6657
|
+
* // "ranges": []
|
|
6658
|
+
* // }
|
|
6659
|
+
* },
|
|
6660
|
+
* });
|
|
6661
|
+
* console.log(res.data);
|
|
6662
|
+
*
|
|
6663
|
+
* // Example response
|
|
6664
|
+
* // {
|
|
6665
|
+
* // "clearedRanges": [],
|
|
6666
|
+
* // "spreadsheetId": "my_spreadsheetId"
|
|
6667
|
+
* // }
|
|
6668
|
+
* }
|
|
6669
|
+
*
|
|
6670
|
+
* main().catch(e => {
|
|
6671
|
+
* console.error(e);
|
|
6672
|
+
* throw e;
|
|
6673
|
+
* });
|
|
6674
|
+
*
|
|
6675
|
+
* ```
|
|
6011
6676
|
*
|
|
6012
6677
|
* @param params - Parameters for request
|
|
6013
6678
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6017,11 +6682,11 @@ export namespace sheets_v4 {
|
|
|
6017
6682
|
batchClear(
|
|
6018
6683
|
params: Params$Resource$Spreadsheets$Values$Batchclear,
|
|
6019
6684
|
options: StreamMethodOptions
|
|
6020
|
-
):
|
|
6685
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6021
6686
|
batchClear(
|
|
6022
6687
|
params?: Params$Resource$Spreadsheets$Values$Batchclear,
|
|
6023
6688
|
options?: MethodOptions
|
|
6024
|
-
):
|
|
6689
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchClearValuesResponse>>;
|
|
6025
6690
|
batchClear(
|
|
6026
6691
|
params: Params$Resource$Spreadsheets$Values$Batchclear,
|
|
6027
6692
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6056,8 +6721,8 @@ export namespace sheets_v4 {
|
|
|
6056
6721
|
| BodyResponseCallback<Readable>
|
|
6057
6722
|
):
|
|
6058
6723
|
| void
|
|
6059
|
-
|
|
|
6060
|
-
|
|
|
6724
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchClearValuesResponse>>
|
|
6725
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6061
6726
|
let params = (paramsOrCallback ||
|
|
6062
6727
|
{}) as Params$Resource$Spreadsheets$Values$Batchclear;
|
|
6063
6728
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6102,6 +6767,65 @@ export namespace sheets_v4 {
|
|
|
6102
6767
|
|
|
6103
6768
|
/**
|
|
6104
6769
|
* Clears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges matching any of the specified data filters will be cleared. Only values are cleared -- all other properties of the cell (such as formatting, data validation, etc..) are kept.
|
|
6770
|
+
* @example
|
|
6771
|
+
* ```js
|
|
6772
|
+
* // Before running the sample:
|
|
6773
|
+
* // - Enable the API at:
|
|
6774
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6775
|
+
* // - Login into gcloud by running:
|
|
6776
|
+
* // ```sh
|
|
6777
|
+
* // $ gcloud auth application-default login
|
|
6778
|
+
* // ```
|
|
6779
|
+
* // - Install the npm module by running:
|
|
6780
|
+
* // ```sh
|
|
6781
|
+
* // $ npm install googleapis
|
|
6782
|
+
* // ```
|
|
6783
|
+
*
|
|
6784
|
+
* const {google} = require('googleapis');
|
|
6785
|
+
* const sheets = google.sheets('v4');
|
|
6786
|
+
*
|
|
6787
|
+
* async function main() {
|
|
6788
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6789
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6790
|
+
* scopes: [
|
|
6791
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6792
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6793
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6794
|
+
* ],
|
|
6795
|
+
* });
|
|
6796
|
+
*
|
|
6797
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6798
|
+
* const authClient = await auth.getClient();
|
|
6799
|
+
* google.options({auth: authClient});
|
|
6800
|
+
*
|
|
6801
|
+
* // Do the magic
|
|
6802
|
+
* const res = await sheets.spreadsheets.values.batchClearByDataFilter({
|
|
6803
|
+
* // The ID of the spreadsheet to update.
|
|
6804
|
+
* spreadsheetId: 'placeholder-value',
|
|
6805
|
+
*
|
|
6806
|
+
* // Request body metadata
|
|
6807
|
+
* requestBody: {
|
|
6808
|
+
* // request body parameters
|
|
6809
|
+
* // {
|
|
6810
|
+
* // "dataFilters": []
|
|
6811
|
+
* // }
|
|
6812
|
+
* },
|
|
6813
|
+
* });
|
|
6814
|
+
* console.log(res.data);
|
|
6815
|
+
*
|
|
6816
|
+
* // Example response
|
|
6817
|
+
* // {
|
|
6818
|
+
* // "clearedRanges": [],
|
|
6819
|
+
* // "spreadsheetId": "my_spreadsheetId"
|
|
6820
|
+
* // }
|
|
6821
|
+
* }
|
|
6822
|
+
*
|
|
6823
|
+
* main().catch(e => {
|
|
6824
|
+
* console.error(e);
|
|
6825
|
+
* throw e;
|
|
6826
|
+
* });
|
|
6827
|
+
*
|
|
6828
|
+
* ```
|
|
6105
6829
|
*
|
|
6106
6830
|
* @param params - Parameters for request
|
|
6107
6831
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6111,11 +6835,13 @@ export namespace sheets_v4 {
|
|
|
6111
6835
|
batchClearByDataFilter(
|
|
6112
6836
|
params: Params$Resource$Spreadsheets$Values$Batchclearbydatafilter,
|
|
6113
6837
|
options: StreamMethodOptions
|
|
6114
|
-
):
|
|
6838
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6115
6839
|
batchClearByDataFilter(
|
|
6116
6840
|
params?: Params$Resource$Spreadsheets$Values$Batchclearbydatafilter,
|
|
6117
6841
|
options?: MethodOptions
|
|
6118
|
-
):
|
|
6842
|
+
): Promise<
|
|
6843
|
+
GaxiosResponseWithHTTP2<Schema$BatchClearValuesByDataFilterResponse>
|
|
6844
|
+
>;
|
|
6119
6845
|
batchClearByDataFilter(
|
|
6120
6846
|
params: Params$Resource$Spreadsheets$Values$Batchclearbydatafilter,
|
|
6121
6847
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6150,8 +6876,10 @@ export namespace sheets_v4 {
|
|
|
6150
6876
|
| BodyResponseCallback<Readable>
|
|
6151
6877
|
):
|
|
6152
6878
|
| void
|
|
6153
|
-
|
|
|
6154
|
-
|
|
6879
|
+
| Promise<
|
|
6880
|
+
GaxiosResponseWithHTTP2<Schema$BatchClearValuesByDataFilterResponse>
|
|
6881
|
+
>
|
|
6882
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6155
6883
|
let params = (paramsOrCallback ||
|
|
6156
6884
|
{}) as Params$Resource$Spreadsheets$Values$Batchclearbydatafilter;
|
|
6157
6885
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6200,6 +6928,67 @@ export namespace sheets_v4 {
|
|
|
6200
6928
|
|
|
6201
6929
|
/**
|
|
6202
6930
|
* Returns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges.
|
|
6931
|
+
* @example
|
|
6932
|
+
* ```js
|
|
6933
|
+
* // Before running the sample:
|
|
6934
|
+
* // - Enable the API at:
|
|
6935
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6936
|
+
* // - Login into gcloud by running:
|
|
6937
|
+
* // ```sh
|
|
6938
|
+
* // $ gcloud auth application-default login
|
|
6939
|
+
* // ```
|
|
6940
|
+
* // - Install the npm module by running:
|
|
6941
|
+
* // ```sh
|
|
6942
|
+
* // $ npm install googleapis
|
|
6943
|
+
* // ```
|
|
6944
|
+
*
|
|
6945
|
+
* const {google} = require('googleapis');
|
|
6946
|
+
* const sheets = google.sheets('v4');
|
|
6947
|
+
*
|
|
6948
|
+
* async function main() {
|
|
6949
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6950
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6951
|
+
* scopes: [
|
|
6952
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6953
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6954
|
+
* 'https://www.googleapis.com/auth/drive.readonly',
|
|
6955
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6956
|
+
* 'https://www.googleapis.com/auth/spreadsheets.readonly',
|
|
6957
|
+
* ],
|
|
6958
|
+
* });
|
|
6959
|
+
*
|
|
6960
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6961
|
+
* const authClient = await auth.getClient();
|
|
6962
|
+
* google.options({auth: authClient});
|
|
6963
|
+
*
|
|
6964
|
+
* // Do the magic
|
|
6965
|
+
* const res = await sheets.spreadsheets.values.batchGet({
|
|
6966
|
+
* // How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
|
|
6967
|
+
* dateTimeRenderOption: 'placeholder-value',
|
|
6968
|
+
* // The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `ranges=["A1:B2"],majorDimension=ROWS` returns `[[1,2],[3,4]]`, whereas requesting `ranges=["A1:B2"],majorDimension=COLUMNS` returns `[[1,3],[2,4]]`.
|
|
6969
|
+
* majorDimension: 'placeholder-value',
|
|
6970
|
+
* // The [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the range to retrieve values from.
|
|
6971
|
+
* ranges: 'placeholder-value',
|
|
6972
|
+
* // The ID of the spreadsheet to retrieve data from.
|
|
6973
|
+
* spreadsheetId: 'placeholder-value',
|
|
6974
|
+
* // How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE.
|
|
6975
|
+
* valueRenderOption: 'placeholder-value',
|
|
6976
|
+
* });
|
|
6977
|
+
* console.log(res.data);
|
|
6978
|
+
*
|
|
6979
|
+
* // Example response
|
|
6980
|
+
* // {
|
|
6981
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
6982
|
+
* // "valueRanges": []
|
|
6983
|
+
* // }
|
|
6984
|
+
* }
|
|
6985
|
+
*
|
|
6986
|
+
* main().catch(e => {
|
|
6987
|
+
* console.error(e);
|
|
6988
|
+
* throw e;
|
|
6989
|
+
* });
|
|
6990
|
+
*
|
|
6991
|
+
* ```
|
|
6203
6992
|
*
|
|
6204
6993
|
* @param params - Parameters for request
|
|
6205
6994
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6209,11 +6998,11 @@ export namespace sheets_v4 {
|
|
|
6209
6998
|
batchGet(
|
|
6210
6999
|
params: Params$Resource$Spreadsheets$Values$Batchget,
|
|
6211
7000
|
options: StreamMethodOptions
|
|
6212
|
-
):
|
|
7001
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6213
7002
|
batchGet(
|
|
6214
7003
|
params?: Params$Resource$Spreadsheets$Values$Batchget,
|
|
6215
7004
|
options?: MethodOptions
|
|
6216
|
-
):
|
|
7005
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchGetValuesResponse>>;
|
|
6217
7006
|
batchGet(
|
|
6218
7007
|
params: Params$Resource$Spreadsheets$Values$Batchget,
|
|
6219
7008
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6248,8 +7037,8 @@ export namespace sheets_v4 {
|
|
|
6248
7037
|
| BodyResponseCallback<Readable>
|
|
6249
7038
|
):
|
|
6250
7039
|
| void
|
|
6251
|
-
|
|
|
6252
|
-
|
|
|
7040
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchGetValuesResponse>>
|
|
7041
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6253
7042
|
let params = (paramsOrCallback ||
|
|
6254
7043
|
{}) as Params$Resource$Spreadsheets$Values$Batchget;
|
|
6255
7044
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6294,6 +7083,68 @@ export namespace sheets_v4 {
|
|
|
6294
7083
|
|
|
6295
7084
|
/**
|
|
6296
7085
|
* Returns one or more ranges of values that match the specified data filters. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges that match any of the data filters in the request will be returned.
|
|
7086
|
+
* @example
|
|
7087
|
+
* ```js
|
|
7088
|
+
* // Before running the sample:
|
|
7089
|
+
* // - Enable the API at:
|
|
7090
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
7091
|
+
* // - Login into gcloud by running:
|
|
7092
|
+
* // ```sh
|
|
7093
|
+
* // $ gcloud auth application-default login
|
|
7094
|
+
* // ```
|
|
7095
|
+
* // - Install the npm module by running:
|
|
7096
|
+
* // ```sh
|
|
7097
|
+
* // $ npm install googleapis
|
|
7098
|
+
* // ```
|
|
7099
|
+
*
|
|
7100
|
+
* const {google} = require('googleapis');
|
|
7101
|
+
* const sheets = google.sheets('v4');
|
|
7102
|
+
*
|
|
7103
|
+
* async function main() {
|
|
7104
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7105
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7106
|
+
* scopes: [
|
|
7107
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
7108
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
7109
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
7110
|
+
* ],
|
|
7111
|
+
* });
|
|
7112
|
+
*
|
|
7113
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7114
|
+
* const authClient = await auth.getClient();
|
|
7115
|
+
* google.options({auth: authClient});
|
|
7116
|
+
*
|
|
7117
|
+
* // Do the magic
|
|
7118
|
+
* const res = await sheets.spreadsheets.values.batchGetByDataFilter({
|
|
7119
|
+
* // The ID of the spreadsheet to retrieve data from.
|
|
7120
|
+
* spreadsheetId: 'placeholder-value',
|
|
7121
|
+
*
|
|
7122
|
+
* // Request body metadata
|
|
7123
|
+
* requestBody: {
|
|
7124
|
+
* // request body parameters
|
|
7125
|
+
* // {
|
|
7126
|
+
* // "dataFilters": [],
|
|
7127
|
+
* // "dateTimeRenderOption": "my_dateTimeRenderOption",
|
|
7128
|
+
* // "majorDimension": "my_majorDimension",
|
|
7129
|
+
* // "valueRenderOption": "my_valueRenderOption"
|
|
7130
|
+
* // }
|
|
7131
|
+
* },
|
|
7132
|
+
* });
|
|
7133
|
+
* console.log(res.data);
|
|
7134
|
+
*
|
|
7135
|
+
* // Example response
|
|
7136
|
+
* // {
|
|
7137
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
7138
|
+
* // "valueRanges": []
|
|
7139
|
+
* // }
|
|
7140
|
+
* }
|
|
7141
|
+
*
|
|
7142
|
+
* main().catch(e => {
|
|
7143
|
+
* console.error(e);
|
|
7144
|
+
* throw e;
|
|
7145
|
+
* });
|
|
7146
|
+
*
|
|
7147
|
+
* ```
|
|
6297
7148
|
*
|
|
6298
7149
|
* @param params - Parameters for request
|
|
6299
7150
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6303,11 +7154,13 @@ export namespace sheets_v4 {
|
|
|
6303
7154
|
batchGetByDataFilter(
|
|
6304
7155
|
params: Params$Resource$Spreadsheets$Values$Batchgetbydatafilter,
|
|
6305
7156
|
options: StreamMethodOptions
|
|
6306
|
-
):
|
|
7157
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6307
7158
|
batchGetByDataFilter(
|
|
6308
7159
|
params?: Params$Resource$Spreadsheets$Values$Batchgetbydatafilter,
|
|
6309
7160
|
options?: MethodOptions
|
|
6310
|
-
):
|
|
7161
|
+
): Promise<
|
|
7162
|
+
GaxiosResponseWithHTTP2<Schema$BatchGetValuesByDataFilterResponse>
|
|
7163
|
+
>;
|
|
6311
7164
|
batchGetByDataFilter(
|
|
6312
7165
|
params: Params$Resource$Spreadsheets$Values$Batchgetbydatafilter,
|
|
6313
7166
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6342,8 +7195,10 @@ export namespace sheets_v4 {
|
|
|
6342
7195
|
| BodyResponseCallback<Readable>
|
|
6343
7196
|
):
|
|
6344
7197
|
| void
|
|
6345
|
-
|
|
|
6346
|
-
|
|
7198
|
+
| Promise<
|
|
7199
|
+
GaxiosResponseWithHTTP2<Schema$BatchGetValuesByDataFilterResponse>
|
|
7200
|
+
>
|
|
7201
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6347
7202
|
let params = (paramsOrCallback ||
|
|
6348
7203
|
{}) as Params$Resource$Spreadsheets$Values$Batchgetbydatafilter;
|
|
6349
7204
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6391,6 +7246,73 @@ export namespace sheets_v4 {
|
|
|
6391
7246
|
|
|
6392
7247
|
/**
|
|
6393
7248
|
* Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.
|
|
7249
|
+
* @example
|
|
7250
|
+
* ```js
|
|
7251
|
+
* // Before running the sample:
|
|
7252
|
+
* // - Enable the API at:
|
|
7253
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
7254
|
+
* // - Login into gcloud by running:
|
|
7255
|
+
* // ```sh
|
|
7256
|
+
* // $ gcloud auth application-default login
|
|
7257
|
+
* // ```
|
|
7258
|
+
* // - Install the npm module by running:
|
|
7259
|
+
* // ```sh
|
|
7260
|
+
* // $ npm install googleapis
|
|
7261
|
+
* // ```
|
|
7262
|
+
*
|
|
7263
|
+
* const {google} = require('googleapis');
|
|
7264
|
+
* const sheets = google.sheets('v4');
|
|
7265
|
+
*
|
|
7266
|
+
* async function main() {
|
|
7267
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7268
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7269
|
+
* scopes: [
|
|
7270
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
7271
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
7272
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
7273
|
+
* ],
|
|
7274
|
+
* });
|
|
7275
|
+
*
|
|
7276
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7277
|
+
* const authClient = await auth.getClient();
|
|
7278
|
+
* google.options({auth: authClient});
|
|
7279
|
+
*
|
|
7280
|
+
* // Do the magic
|
|
7281
|
+
* const res = await sheets.spreadsheets.values.batchUpdate({
|
|
7282
|
+
* // The ID of the spreadsheet to update.
|
|
7283
|
+
* spreadsheetId: 'placeholder-value',
|
|
7284
|
+
*
|
|
7285
|
+
* // Request body metadata
|
|
7286
|
+
* requestBody: {
|
|
7287
|
+
* // request body parameters
|
|
7288
|
+
* // {
|
|
7289
|
+
* // "data": [],
|
|
7290
|
+
* // "includeValuesInResponse": false,
|
|
7291
|
+
* // "responseDateTimeRenderOption": "my_responseDateTimeRenderOption",
|
|
7292
|
+
* // "responseValueRenderOption": "my_responseValueRenderOption",
|
|
7293
|
+
* // "valueInputOption": "my_valueInputOption"
|
|
7294
|
+
* // }
|
|
7295
|
+
* },
|
|
7296
|
+
* });
|
|
7297
|
+
* console.log(res.data);
|
|
7298
|
+
*
|
|
7299
|
+
* // Example response
|
|
7300
|
+
* // {
|
|
7301
|
+
* // "responses": [],
|
|
7302
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
7303
|
+
* // "totalUpdatedCells": 0,
|
|
7304
|
+
* // "totalUpdatedColumns": 0,
|
|
7305
|
+
* // "totalUpdatedRows": 0,
|
|
7306
|
+
* // "totalUpdatedSheets": 0
|
|
7307
|
+
* // }
|
|
7308
|
+
* }
|
|
7309
|
+
*
|
|
7310
|
+
* main().catch(e => {
|
|
7311
|
+
* console.error(e);
|
|
7312
|
+
* throw e;
|
|
7313
|
+
* });
|
|
7314
|
+
*
|
|
7315
|
+
* ```
|
|
6394
7316
|
*
|
|
6395
7317
|
* @param params - Parameters for request
|
|
6396
7318
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6400,11 +7322,11 @@ export namespace sheets_v4 {
|
|
|
6400
7322
|
batchUpdate(
|
|
6401
7323
|
params: Params$Resource$Spreadsheets$Values$Batchupdate,
|
|
6402
7324
|
options: StreamMethodOptions
|
|
6403
|
-
):
|
|
7325
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6404
7326
|
batchUpdate(
|
|
6405
7327
|
params?: Params$Resource$Spreadsheets$Values$Batchupdate,
|
|
6406
7328
|
options?: MethodOptions
|
|
6407
|
-
):
|
|
7329
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchUpdateValuesResponse>>;
|
|
6408
7330
|
batchUpdate(
|
|
6409
7331
|
params: Params$Resource$Spreadsheets$Values$Batchupdate,
|
|
6410
7332
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6439,8 +7361,8 @@ export namespace sheets_v4 {
|
|
|
6439
7361
|
| BodyResponseCallback<Readable>
|
|
6440
7362
|
):
|
|
6441
7363
|
| void
|
|
6442
|
-
|
|
|
6443
|
-
|
|
|
7364
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchUpdateValuesResponse>>
|
|
7365
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6444
7366
|
let params = (paramsOrCallback ||
|
|
6445
7367
|
{}) as Params$Resource$Spreadsheets$Values$Batchupdate;
|
|
6446
7368
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6485,6 +7407,73 @@ export namespace sheets_v4 {
|
|
|
6485
7407
|
|
|
6486
7408
|
/**
|
|
6487
7409
|
* Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more DataFilterValueRanges.
|
|
7410
|
+
* @example
|
|
7411
|
+
* ```js
|
|
7412
|
+
* // Before running the sample:
|
|
7413
|
+
* // - Enable the API at:
|
|
7414
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
7415
|
+
* // - Login into gcloud by running:
|
|
7416
|
+
* // ```sh
|
|
7417
|
+
* // $ gcloud auth application-default login
|
|
7418
|
+
* // ```
|
|
7419
|
+
* // - Install the npm module by running:
|
|
7420
|
+
* // ```sh
|
|
7421
|
+
* // $ npm install googleapis
|
|
7422
|
+
* // ```
|
|
7423
|
+
*
|
|
7424
|
+
* const {google} = require('googleapis');
|
|
7425
|
+
* const sheets = google.sheets('v4');
|
|
7426
|
+
*
|
|
7427
|
+
* async function main() {
|
|
7428
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7429
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7430
|
+
* scopes: [
|
|
7431
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
7432
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
7433
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
7434
|
+
* ],
|
|
7435
|
+
* });
|
|
7436
|
+
*
|
|
7437
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7438
|
+
* const authClient = await auth.getClient();
|
|
7439
|
+
* google.options({auth: authClient});
|
|
7440
|
+
*
|
|
7441
|
+
* // Do the magic
|
|
7442
|
+
* const res = await sheets.spreadsheets.values.batchUpdateByDataFilter({
|
|
7443
|
+
* // The ID of the spreadsheet to update.
|
|
7444
|
+
* spreadsheetId: 'placeholder-value',
|
|
7445
|
+
*
|
|
7446
|
+
* // Request body metadata
|
|
7447
|
+
* requestBody: {
|
|
7448
|
+
* // request body parameters
|
|
7449
|
+
* // {
|
|
7450
|
+
* // "data": [],
|
|
7451
|
+
* // "includeValuesInResponse": false,
|
|
7452
|
+
* // "responseDateTimeRenderOption": "my_responseDateTimeRenderOption",
|
|
7453
|
+
* // "responseValueRenderOption": "my_responseValueRenderOption",
|
|
7454
|
+
* // "valueInputOption": "my_valueInputOption"
|
|
7455
|
+
* // }
|
|
7456
|
+
* },
|
|
7457
|
+
* });
|
|
7458
|
+
* console.log(res.data);
|
|
7459
|
+
*
|
|
7460
|
+
* // Example response
|
|
7461
|
+
* // {
|
|
7462
|
+
* // "responses": [],
|
|
7463
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
7464
|
+
* // "totalUpdatedCells": 0,
|
|
7465
|
+
* // "totalUpdatedColumns": 0,
|
|
7466
|
+
* // "totalUpdatedRows": 0,
|
|
7467
|
+
* // "totalUpdatedSheets": 0
|
|
7468
|
+
* // }
|
|
7469
|
+
* }
|
|
7470
|
+
*
|
|
7471
|
+
* main().catch(e => {
|
|
7472
|
+
* console.error(e);
|
|
7473
|
+
* throw e;
|
|
7474
|
+
* });
|
|
7475
|
+
*
|
|
7476
|
+
* ```
|
|
6488
7477
|
*
|
|
6489
7478
|
* @param params - Parameters for request
|
|
6490
7479
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6494,11 +7483,13 @@ export namespace sheets_v4 {
|
|
|
6494
7483
|
batchUpdateByDataFilter(
|
|
6495
7484
|
params: Params$Resource$Spreadsheets$Values$Batchupdatebydatafilter,
|
|
6496
7485
|
options: StreamMethodOptions
|
|
6497
|
-
):
|
|
7486
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6498
7487
|
batchUpdateByDataFilter(
|
|
6499
7488
|
params?: Params$Resource$Spreadsheets$Values$Batchupdatebydatafilter,
|
|
6500
7489
|
options?: MethodOptions
|
|
6501
|
-
):
|
|
7490
|
+
): Promise<
|
|
7491
|
+
GaxiosResponseWithHTTP2<Schema$BatchUpdateValuesByDataFilterResponse>
|
|
7492
|
+
>;
|
|
6502
7493
|
batchUpdateByDataFilter(
|
|
6503
7494
|
params: Params$Resource$Spreadsheets$Values$Batchupdatebydatafilter,
|
|
6504
7495
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6533,8 +7524,10 @@ export namespace sheets_v4 {
|
|
|
6533
7524
|
| BodyResponseCallback<Readable>
|
|
6534
7525
|
):
|
|
6535
7526
|
| void
|
|
6536
|
-
|
|
|
6537
|
-
|
|
7527
|
+
| Promise<
|
|
7528
|
+
GaxiosResponseWithHTTP2<Schema$BatchUpdateValuesByDataFilterResponse>
|
|
7529
|
+
>
|
|
7530
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6538
7531
|
let params = (paramsOrCallback ||
|
|
6539
7532
|
{}) as Params$Resource$Spreadsheets$Values$Batchupdatebydatafilter;
|
|
6540
7533
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6583,6 +7576,65 @@ export namespace sheets_v4 {
|
|
|
6583
7576
|
|
|
6584
7577
|
/**
|
|
6585
7578
|
* Clears values from a spreadsheet. The caller must specify the spreadsheet ID and range. Only values are cleared -- all other properties of the cell (such as formatting, data validation, etc..) are kept.
|
|
7579
|
+
* @example
|
|
7580
|
+
* ```js
|
|
7581
|
+
* // Before running the sample:
|
|
7582
|
+
* // - Enable the API at:
|
|
7583
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
7584
|
+
* // - Login into gcloud by running:
|
|
7585
|
+
* // ```sh
|
|
7586
|
+
* // $ gcloud auth application-default login
|
|
7587
|
+
* // ```
|
|
7588
|
+
* // - Install the npm module by running:
|
|
7589
|
+
* // ```sh
|
|
7590
|
+
* // $ npm install googleapis
|
|
7591
|
+
* // ```
|
|
7592
|
+
*
|
|
7593
|
+
* const {google} = require('googleapis');
|
|
7594
|
+
* const sheets = google.sheets('v4');
|
|
7595
|
+
*
|
|
7596
|
+
* async function main() {
|
|
7597
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7598
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7599
|
+
* scopes: [
|
|
7600
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
7601
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
7602
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
7603
|
+
* ],
|
|
7604
|
+
* });
|
|
7605
|
+
*
|
|
7606
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7607
|
+
* const authClient = await auth.getClient();
|
|
7608
|
+
* google.options({auth: authClient});
|
|
7609
|
+
*
|
|
7610
|
+
* // Do the magic
|
|
7611
|
+
* const res = await sheets.spreadsheets.values.clear({
|
|
7612
|
+
* // The [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to clear.
|
|
7613
|
+
* range: 'placeholder-value',
|
|
7614
|
+
* // The ID of the spreadsheet to update.
|
|
7615
|
+
* spreadsheetId: 'placeholder-value',
|
|
7616
|
+
*
|
|
7617
|
+
* // Request body metadata
|
|
7618
|
+
* requestBody: {
|
|
7619
|
+
* // request body parameters
|
|
7620
|
+
* // {}
|
|
7621
|
+
* },
|
|
7622
|
+
* });
|
|
7623
|
+
* console.log(res.data);
|
|
7624
|
+
*
|
|
7625
|
+
* // Example response
|
|
7626
|
+
* // {
|
|
7627
|
+
* // "clearedRange": "my_clearedRange",
|
|
7628
|
+
* // "spreadsheetId": "my_spreadsheetId"
|
|
7629
|
+
* // }
|
|
7630
|
+
* }
|
|
7631
|
+
*
|
|
7632
|
+
* main().catch(e => {
|
|
7633
|
+
* console.error(e);
|
|
7634
|
+
* throw e;
|
|
7635
|
+
* });
|
|
7636
|
+
*
|
|
7637
|
+
* ```
|
|
6586
7638
|
*
|
|
6587
7639
|
* @param params - Parameters for request
|
|
6588
7640
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6592,11 +7644,11 @@ export namespace sheets_v4 {
|
|
|
6592
7644
|
clear(
|
|
6593
7645
|
params: Params$Resource$Spreadsheets$Values$Clear,
|
|
6594
7646
|
options: StreamMethodOptions
|
|
6595
|
-
):
|
|
7647
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6596
7648
|
clear(
|
|
6597
7649
|
params?: Params$Resource$Spreadsheets$Values$Clear,
|
|
6598
7650
|
options?: MethodOptions
|
|
6599
|
-
):
|
|
7651
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ClearValuesResponse>>;
|
|
6600
7652
|
clear(
|
|
6601
7653
|
params: Params$Resource$Spreadsheets$Values$Clear,
|
|
6602
7654
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6627,8 +7679,8 @@ export namespace sheets_v4 {
|
|
|
6627
7679
|
| BodyResponseCallback<Readable>
|
|
6628
7680
|
):
|
|
6629
7681
|
| void
|
|
6630
|
-
|
|
|
6631
|
-
|
|
|
7682
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ClearValuesResponse>>
|
|
7683
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6632
7684
|
let params = (paramsOrCallback ||
|
|
6633
7685
|
{}) as Params$Resource$Spreadsheets$Values$Clear;
|
|
6634
7686
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6673,6 +7725,68 @@ export namespace sheets_v4 {
|
|
|
6673
7725
|
|
|
6674
7726
|
/**
|
|
6675
7727
|
* Returns a range of values from a spreadsheet. The caller must specify the spreadsheet ID and a range.
|
|
7728
|
+
* @example
|
|
7729
|
+
* ```js
|
|
7730
|
+
* // Before running the sample:
|
|
7731
|
+
* // - Enable the API at:
|
|
7732
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
7733
|
+
* // - Login into gcloud by running:
|
|
7734
|
+
* // ```sh
|
|
7735
|
+
* // $ gcloud auth application-default login
|
|
7736
|
+
* // ```
|
|
7737
|
+
* // - Install the npm module by running:
|
|
7738
|
+
* // ```sh
|
|
7739
|
+
* // $ npm install googleapis
|
|
7740
|
+
* // ```
|
|
7741
|
+
*
|
|
7742
|
+
* const {google} = require('googleapis');
|
|
7743
|
+
* const sheets = google.sheets('v4');
|
|
7744
|
+
*
|
|
7745
|
+
* async function main() {
|
|
7746
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7747
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7748
|
+
* scopes: [
|
|
7749
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
7750
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
7751
|
+
* 'https://www.googleapis.com/auth/drive.readonly',
|
|
7752
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
7753
|
+
* 'https://www.googleapis.com/auth/spreadsheets.readonly',
|
|
7754
|
+
* ],
|
|
7755
|
+
* });
|
|
7756
|
+
*
|
|
7757
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7758
|
+
* const authClient = await auth.getClient();
|
|
7759
|
+
* google.options({auth: authClient});
|
|
7760
|
+
*
|
|
7761
|
+
* // Do the magic
|
|
7762
|
+
* const res = await sheets.spreadsheets.values.get({
|
|
7763
|
+
* // How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
|
|
7764
|
+
* dateTimeRenderOption: 'placeholder-value',
|
|
7765
|
+
* // The major dimension that results should use. For example, if the spreadsheet data in Sheet1 is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=Sheet1!A1:B2?majorDimension=ROWS` returns `[[1,2],[3,4]]`, whereas requesting `range=Sheet1!A1:B2?majorDimension=COLUMNS` returns `[[1,3],[2,4]]`.
|
|
7766
|
+
* majorDimension: 'placeholder-value',
|
|
7767
|
+
* // The [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the range to retrieve values from.
|
|
7768
|
+
* range: 'placeholder-value',
|
|
7769
|
+
* // The ID of the spreadsheet to retrieve data from.
|
|
7770
|
+
* spreadsheetId: 'placeholder-value',
|
|
7771
|
+
* // How values should be represented in the output. The default render option is FORMATTED_VALUE.
|
|
7772
|
+
* valueRenderOption: 'placeholder-value',
|
|
7773
|
+
* });
|
|
7774
|
+
* console.log(res.data);
|
|
7775
|
+
*
|
|
7776
|
+
* // Example response
|
|
7777
|
+
* // {
|
|
7778
|
+
* // "majorDimension": "my_majorDimension",
|
|
7779
|
+
* // "range": "my_range",
|
|
7780
|
+
* // "values": []
|
|
7781
|
+
* // }
|
|
7782
|
+
* }
|
|
7783
|
+
*
|
|
7784
|
+
* main().catch(e => {
|
|
7785
|
+
* console.error(e);
|
|
7786
|
+
* throw e;
|
|
7787
|
+
* });
|
|
7788
|
+
*
|
|
7789
|
+
* ```
|
|
6676
7790
|
*
|
|
6677
7791
|
* @param params - Parameters for request
|
|
6678
7792
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6682,11 +7796,11 @@ export namespace sheets_v4 {
|
|
|
6682
7796
|
get(
|
|
6683
7797
|
params: Params$Resource$Spreadsheets$Values$Get,
|
|
6684
7798
|
options: StreamMethodOptions
|
|
6685
|
-
):
|
|
7799
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6686
7800
|
get(
|
|
6687
7801
|
params?: Params$Resource$Spreadsheets$Values$Get,
|
|
6688
7802
|
options?: MethodOptions
|
|
6689
|
-
):
|
|
7803
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ValueRange>>;
|
|
6690
7804
|
get(
|
|
6691
7805
|
params: Params$Resource$Spreadsheets$Values$Get,
|
|
6692
7806
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6715,7 +7829,10 @@ export namespace sheets_v4 {
|
|
|
6715
7829
|
callback?:
|
|
6716
7830
|
| BodyResponseCallback<Schema$ValueRange>
|
|
6717
7831
|
| BodyResponseCallback<Readable>
|
|
6718
|
-
):
|
|
7832
|
+
):
|
|
7833
|
+
| void
|
|
7834
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ValueRange>>
|
|
7835
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6719
7836
|
let params = (paramsOrCallback ||
|
|
6720
7837
|
{}) as Params$Resource$Spreadsheets$Values$Get;
|
|
6721
7838
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6760,6 +7877,81 @@ export namespace sheets_v4 {
|
|
|
6760
7877
|
|
|
6761
7878
|
/**
|
|
6762
7879
|
* Sets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a valueInputOption.
|
|
7880
|
+
* @example
|
|
7881
|
+
* ```js
|
|
7882
|
+
* // Before running the sample:
|
|
7883
|
+
* // - Enable the API at:
|
|
7884
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
7885
|
+
* // - Login into gcloud by running:
|
|
7886
|
+
* // ```sh
|
|
7887
|
+
* // $ gcloud auth application-default login
|
|
7888
|
+
* // ```
|
|
7889
|
+
* // - Install the npm module by running:
|
|
7890
|
+
* // ```sh
|
|
7891
|
+
* // $ npm install googleapis
|
|
7892
|
+
* // ```
|
|
7893
|
+
*
|
|
7894
|
+
* const {google} = require('googleapis');
|
|
7895
|
+
* const sheets = google.sheets('v4');
|
|
7896
|
+
*
|
|
7897
|
+
* async function main() {
|
|
7898
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7899
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7900
|
+
* scopes: [
|
|
7901
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
7902
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
7903
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
7904
|
+
* ],
|
|
7905
|
+
* });
|
|
7906
|
+
*
|
|
7907
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7908
|
+
* const authClient = await auth.getClient();
|
|
7909
|
+
* google.options({auth: authClient});
|
|
7910
|
+
*
|
|
7911
|
+
* // Do the magic
|
|
7912
|
+
* const res = await sheets.spreadsheets.values.update({
|
|
7913
|
+
* // Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. If the range to write was larger than the range actually written, the response includes all values in the requested range (excluding trailing empty rows and columns).
|
|
7914
|
+
* includeValuesInResponse: 'placeholder-value',
|
|
7915
|
+
* // The [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to update.
|
|
7916
|
+
* range: 'placeholder-value',
|
|
7917
|
+
* // Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
|
|
7918
|
+
* responseDateTimeRenderOption: 'placeholder-value',
|
|
7919
|
+
* // Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
|
|
7920
|
+
* responseValueRenderOption: 'placeholder-value',
|
|
7921
|
+
* // The ID of the spreadsheet to update.
|
|
7922
|
+
* spreadsheetId: 'placeholder-value',
|
|
7923
|
+
* // How the input data should be interpreted.
|
|
7924
|
+
* valueInputOption: 'placeholder-value',
|
|
7925
|
+
*
|
|
7926
|
+
* // Request body metadata
|
|
7927
|
+
* requestBody: {
|
|
7928
|
+
* // request body parameters
|
|
7929
|
+
* // {
|
|
7930
|
+
* // "majorDimension": "my_majorDimension",
|
|
7931
|
+
* // "range": "my_range",
|
|
7932
|
+
* // "values": []
|
|
7933
|
+
* // }
|
|
7934
|
+
* },
|
|
7935
|
+
* });
|
|
7936
|
+
* console.log(res.data);
|
|
7937
|
+
*
|
|
7938
|
+
* // Example response
|
|
7939
|
+
* // {
|
|
7940
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
7941
|
+
* // "updatedCells": 0,
|
|
7942
|
+
* // "updatedColumns": 0,
|
|
7943
|
+
* // "updatedData": {},
|
|
7944
|
+
* // "updatedRange": "my_updatedRange",
|
|
7945
|
+
* // "updatedRows": 0
|
|
7946
|
+
* // }
|
|
7947
|
+
* }
|
|
7948
|
+
*
|
|
7949
|
+
* main().catch(e => {
|
|
7950
|
+
* console.error(e);
|
|
7951
|
+
* throw e;
|
|
7952
|
+
* });
|
|
7953
|
+
*
|
|
7954
|
+
* ```
|
|
6763
7955
|
*
|
|
6764
7956
|
* @param params - Parameters for request
|
|
6765
7957
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6769,11 +7961,11 @@ export namespace sheets_v4 {
|
|
|
6769
7961
|
update(
|
|
6770
7962
|
params: Params$Resource$Spreadsheets$Values$Update,
|
|
6771
7963
|
options: StreamMethodOptions
|
|
6772
|
-
):
|
|
7964
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6773
7965
|
update(
|
|
6774
7966
|
params?: Params$Resource$Spreadsheets$Values$Update,
|
|
6775
7967
|
options?: MethodOptions
|
|
6776
|
-
):
|
|
7968
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$UpdateValuesResponse>>;
|
|
6777
7969
|
update(
|
|
6778
7970
|
params: Params$Resource$Spreadsheets$Values$Update,
|
|
6779
7971
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6806,8 +7998,8 @@ export namespace sheets_v4 {
|
|
|
6806
7998
|
| BodyResponseCallback<Readable>
|
|
6807
7999
|
):
|
|
6808
8000
|
| void
|
|
6809
|
-
|
|
|
6810
|
-
|
|
|
8001
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$UpdateValuesResponse>>
|
|
8002
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6811
8003
|
let params = (paramsOrCallback ||
|
|
6812
8004
|
{}) as Params$Resource$Spreadsheets$Values$Update;
|
|
6813
8005
|
let options = (optionsOrCallback || {}) as MethodOptions;
|