@googleapis/sheets 10.0.1 → 12.0.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 +49 -0
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/v4.d.ts +1166 -2
- package/build/v4.js +10 -1
- package/build/v4.js.map +1 -1
- package/package.json +4 -4
- package/v4.ts +1166 -1
package/build/v4.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
|
|
3
2
|
import { Readable } from 'stream';
|
|
4
3
|
export declare namespace sheets_v4 {
|
|
@@ -259,6 +258,15 @@ export declare namespace sheets_v4 {
|
|
|
259
258
|
*/
|
|
260
259
|
table?: Schema$Table;
|
|
261
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* The result of adding a table.
|
|
263
|
+
*/
|
|
264
|
+
export interface Schema$AddTableResponse {
|
|
265
|
+
/**
|
|
266
|
+
* Output only. The table that was added.
|
|
267
|
+
*/
|
|
268
|
+
table?: Schema$Table;
|
|
269
|
+
}
|
|
262
270
|
/**
|
|
263
271
|
* Adds new cells after the last row with data in a sheet, inserting new rows into the sheet if necessary.
|
|
264
272
|
*/
|
|
@@ -349,9 +357,13 @@ export declare namespace sheets_v4 {
|
|
|
349
357
|
*/
|
|
350
358
|
export interface Schema$BandedRange {
|
|
351
359
|
/**
|
|
352
|
-
* The ID of the banded range.
|
|
360
|
+
* The ID of the banded range. If unset, refer to banded_range_reference.
|
|
353
361
|
*/
|
|
354
362
|
bandedRangeId?: number | null;
|
|
363
|
+
/**
|
|
364
|
+
* Output only. The reference of the banded range, used to identify the ID that is not supported by the banded_range_id.
|
|
365
|
+
*/
|
|
366
|
+
bandedRangeReference?: string | null;
|
|
355
367
|
/**
|
|
356
368
|
* 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.
|
|
357
369
|
*/
|
|
@@ -1119,6 +1131,10 @@ export declare namespace sheets_v4 {
|
|
|
1119
1131
|
* Data about a specific cell.
|
|
1120
1132
|
*/
|
|
1121
1133
|
export interface Schema$CellData {
|
|
1134
|
+
/**
|
|
1135
|
+
* 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.
|
|
1136
|
+
*/
|
|
1137
|
+
chipRuns?: Schema$ChipRun[];
|
|
1122
1138
|
/**
|
|
1123
1139
|
* 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)`.
|
|
1124
1140
|
*/
|
|
@@ -1421,6 +1437,32 @@ export declare namespace sheets_v4 {
|
|
|
1421
1437
|
*/
|
|
1422
1438
|
waterfallChart?: Schema$WaterfallChartSpec;
|
|
1423
1439
|
}
|
|
1440
|
+
/**
|
|
1441
|
+
* The Smart Chip.
|
|
1442
|
+
*/
|
|
1443
|
+
export interface Schema$Chip {
|
|
1444
|
+
/**
|
|
1445
|
+
* Properties of a linked person.
|
|
1446
|
+
*/
|
|
1447
|
+
personProperties?: Schema$PersonProperties;
|
|
1448
|
+
/**
|
|
1449
|
+
* Properties of a rich link.
|
|
1450
|
+
*/
|
|
1451
|
+
richLinkProperties?: Schema$RichLinkProperties;
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* The run of a chip. The chip continues until the start index of the next run.
|
|
1455
|
+
*/
|
|
1456
|
+
export interface Schema$ChipRun {
|
|
1457
|
+
/**
|
|
1458
|
+
* Optional. The chip of this run.
|
|
1459
|
+
*/
|
|
1460
|
+
chip?: Schema$Chip;
|
|
1461
|
+
/**
|
|
1462
|
+
* Required. The zero-based character index where this run starts, in UTF-16 code units.
|
|
1463
|
+
*/
|
|
1464
|
+
startIndex?: number | null;
|
|
1465
|
+
}
|
|
1424
1466
|
/**
|
|
1425
1467
|
* Clears the basic filter, if any exists on the sheet.
|
|
1426
1468
|
*/
|
|
@@ -3098,6 +3140,19 @@ export declare namespace sheets_v4 {
|
|
|
3098
3140
|
*/
|
|
3099
3141
|
type?: string | null;
|
|
3100
3142
|
}
|
|
3143
|
+
/**
|
|
3144
|
+
* Properties specific to a linked person.
|
|
3145
|
+
*/
|
|
3146
|
+
export interface Schema$PersonProperties {
|
|
3147
|
+
/**
|
|
3148
|
+
* Optional. The display format of the person chip. If not set, the default display format is used.
|
|
3149
|
+
*/
|
|
3150
|
+
displayFormat?: string | null;
|
|
3151
|
+
/**
|
|
3152
|
+
* Required. The email address linked to this person. This field is always present.
|
|
3153
|
+
*/
|
|
3154
|
+
email?: string | null;
|
|
3155
|
+
}
|
|
3101
3156
|
/**
|
|
3102
3157
|
* A pie chart.
|
|
3103
3158
|
*/
|
|
@@ -3787,6 +3842,10 @@ export declare namespace sheets_v4 {
|
|
|
3787
3842
|
* A reply from adding a slicer.
|
|
3788
3843
|
*/
|
|
3789
3844
|
addSlicer?: Schema$AddSlicerResponse;
|
|
3845
|
+
/**
|
|
3846
|
+
* A reply from adding a table.
|
|
3847
|
+
*/
|
|
3848
|
+
addTable?: Schema$AddTableResponse;
|
|
3790
3849
|
/**
|
|
3791
3850
|
* A reply from cancelling data source object refreshes.
|
|
3792
3851
|
*/
|
|
@@ -3848,6 +3907,19 @@ export declare namespace sheets_v4 {
|
|
|
3848
3907
|
*/
|
|
3849
3908
|
updateEmbeddedObjectPosition?: Schema$UpdateEmbeddedObjectPositionResponse;
|
|
3850
3909
|
}
|
|
3910
|
+
/**
|
|
3911
|
+
* 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.
|
|
3912
|
+
*/
|
|
3913
|
+
export interface Schema$RichLinkProperties {
|
|
3914
|
+
/**
|
|
3915
|
+
* 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).
|
|
3916
|
+
*/
|
|
3917
|
+
mimeType?: string | null;
|
|
3918
|
+
/**
|
|
3919
|
+
* Required. The URI to the link. This is always present.
|
|
3920
|
+
*/
|
|
3921
|
+
uri?: string | null;
|
|
3922
|
+
}
|
|
3851
3923
|
/**
|
|
3852
3924
|
* Data about each cell in a row.
|
|
3853
3925
|
*/
|
|
@@ -5118,6 +5190,69 @@ export declare namespace sheets_v4 {
|
|
|
5118
5190
|
constructor(context: APIRequestContext);
|
|
5119
5191
|
/**
|
|
5120
5192
|
* 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.
|
|
5193
|
+
* @example
|
|
5194
|
+
* ```js
|
|
5195
|
+
* // Before running the sample:
|
|
5196
|
+
* // - Enable the API at:
|
|
5197
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5198
|
+
* // - Login into gcloud by running:
|
|
5199
|
+
* // ```sh
|
|
5200
|
+
* // $ gcloud auth application-default login
|
|
5201
|
+
* // ```
|
|
5202
|
+
* // - Install the npm module by running:
|
|
5203
|
+
* // ```sh
|
|
5204
|
+
* // $ npm install googleapis
|
|
5205
|
+
* // ```
|
|
5206
|
+
*
|
|
5207
|
+
* const {google} = require('googleapis');
|
|
5208
|
+
* const sheets = google.sheets('v4');
|
|
5209
|
+
*
|
|
5210
|
+
* async function main() {
|
|
5211
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5212
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5213
|
+
* scopes: [
|
|
5214
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5215
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5216
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5217
|
+
* ],
|
|
5218
|
+
* });
|
|
5219
|
+
*
|
|
5220
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5221
|
+
* const authClient = await auth.getClient();
|
|
5222
|
+
* google.options({auth: authClient});
|
|
5223
|
+
*
|
|
5224
|
+
* // Do the magic
|
|
5225
|
+
* const res = await sheets.spreadsheets.batchUpdate({
|
|
5226
|
+
* // The spreadsheet to apply the updates to.
|
|
5227
|
+
* spreadsheetId: 'placeholder-value',
|
|
5228
|
+
*
|
|
5229
|
+
* // Request body metadata
|
|
5230
|
+
* requestBody: {
|
|
5231
|
+
* // request body parameters
|
|
5232
|
+
* // {
|
|
5233
|
+
* // "includeSpreadsheetInResponse": false,
|
|
5234
|
+
* // "requests": [],
|
|
5235
|
+
* // "responseIncludeGridData": false,
|
|
5236
|
+
* // "responseRanges": []
|
|
5237
|
+
* // }
|
|
5238
|
+
* },
|
|
5239
|
+
* });
|
|
5240
|
+
* console.log(res.data);
|
|
5241
|
+
*
|
|
5242
|
+
* // Example response
|
|
5243
|
+
* // {
|
|
5244
|
+
* // "replies": [],
|
|
5245
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5246
|
+
* // "updatedSpreadsheet": {}
|
|
5247
|
+
* // }
|
|
5248
|
+
* }
|
|
5249
|
+
*
|
|
5250
|
+
* main().catch(e => {
|
|
5251
|
+
* console.error(e);
|
|
5252
|
+
* throw e;
|
|
5253
|
+
* });
|
|
5254
|
+
*
|
|
5255
|
+
* ```
|
|
5121
5256
|
*
|
|
5122
5257
|
* @param params - Parameters for request
|
|
5123
5258
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5132,6 +5267,75 @@ export declare namespace sheets_v4 {
|
|
|
5132
5267
|
batchUpdate(callback: BodyResponseCallback<Schema$BatchUpdateSpreadsheetResponse>): void;
|
|
5133
5268
|
/**
|
|
5134
5269
|
* Creates a spreadsheet, returning the newly created spreadsheet.
|
|
5270
|
+
* @example
|
|
5271
|
+
* ```js
|
|
5272
|
+
* // Before running the sample:
|
|
5273
|
+
* // - Enable the API at:
|
|
5274
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5275
|
+
* // - Login into gcloud by running:
|
|
5276
|
+
* // ```sh
|
|
5277
|
+
* // $ gcloud auth application-default login
|
|
5278
|
+
* // ```
|
|
5279
|
+
* // - Install the npm module by running:
|
|
5280
|
+
* // ```sh
|
|
5281
|
+
* // $ npm install googleapis
|
|
5282
|
+
* // ```
|
|
5283
|
+
*
|
|
5284
|
+
* const {google} = require('googleapis');
|
|
5285
|
+
* const sheets = google.sheets('v4');
|
|
5286
|
+
*
|
|
5287
|
+
* async function main() {
|
|
5288
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5289
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5290
|
+
* scopes: [
|
|
5291
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5292
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5293
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5294
|
+
* ],
|
|
5295
|
+
* });
|
|
5296
|
+
*
|
|
5297
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5298
|
+
* const authClient = await auth.getClient();
|
|
5299
|
+
* google.options({auth: authClient});
|
|
5300
|
+
*
|
|
5301
|
+
* // Do the magic
|
|
5302
|
+
* const res = await sheets.spreadsheets.create({
|
|
5303
|
+
* // Request body metadata
|
|
5304
|
+
* requestBody: {
|
|
5305
|
+
* // request body parameters
|
|
5306
|
+
* // {
|
|
5307
|
+
* // "dataSourceSchedules": [],
|
|
5308
|
+
* // "dataSources": [],
|
|
5309
|
+
* // "developerMetadata": [],
|
|
5310
|
+
* // "namedRanges": [],
|
|
5311
|
+
* // "properties": {},
|
|
5312
|
+
* // "sheets": [],
|
|
5313
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5314
|
+
* // "spreadsheetUrl": "my_spreadsheetUrl"
|
|
5315
|
+
* // }
|
|
5316
|
+
* },
|
|
5317
|
+
* });
|
|
5318
|
+
* console.log(res.data);
|
|
5319
|
+
*
|
|
5320
|
+
* // Example response
|
|
5321
|
+
* // {
|
|
5322
|
+
* // "dataSourceSchedules": [],
|
|
5323
|
+
* // "dataSources": [],
|
|
5324
|
+
* // "developerMetadata": [],
|
|
5325
|
+
* // "namedRanges": [],
|
|
5326
|
+
* // "properties": {},
|
|
5327
|
+
* // "sheets": [],
|
|
5328
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5329
|
+
* // "spreadsheetUrl": "my_spreadsheetUrl"
|
|
5330
|
+
* // }
|
|
5331
|
+
* }
|
|
5332
|
+
*
|
|
5333
|
+
* main().catch(e => {
|
|
5334
|
+
* console.error(e);
|
|
5335
|
+
* throw e;
|
|
5336
|
+
* });
|
|
5337
|
+
*
|
|
5338
|
+
* ```
|
|
5135
5339
|
*
|
|
5136
5340
|
* @param params - Parameters for request
|
|
5137
5341
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5146,6 +5350,71 @@ export declare namespace sheets_v4 {
|
|
|
5146
5350
|
create(callback: BodyResponseCallback<Schema$Spreadsheet>): void;
|
|
5147
5351
|
/**
|
|
5148
5352
|
* 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.
|
|
5353
|
+
* @example
|
|
5354
|
+
* ```js
|
|
5355
|
+
* // Before running the sample:
|
|
5356
|
+
* // - Enable the API at:
|
|
5357
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5358
|
+
* // - Login into gcloud by running:
|
|
5359
|
+
* // ```sh
|
|
5360
|
+
* // $ gcloud auth application-default login
|
|
5361
|
+
* // ```
|
|
5362
|
+
* // - Install the npm module by running:
|
|
5363
|
+
* // ```sh
|
|
5364
|
+
* // $ npm install googleapis
|
|
5365
|
+
* // ```
|
|
5366
|
+
*
|
|
5367
|
+
* const {google} = require('googleapis');
|
|
5368
|
+
* const sheets = google.sheets('v4');
|
|
5369
|
+
*
|
|
5370
|
+
* async function main() {
|
|
5371
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5372
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5373
|
+
* scopes: [
|
|
5374
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5375
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5376
|
+
* 'https://www.googleapis.com/auth/drive.readonly',
|
|
5377
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5378
|
+
* 'https://www.googleapis.com/auth/spreadsheets.readonly',
|
|
5379
|
+
* ],
|
|
5380
|
+
* });
|
|
5381
|
+
*
|
|
5382
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5383
|
+
* const authClient = await auth.getClient();
|
|
5384
|
+
* google.options({auth: authClient});
|
|
5385
|
+
*
|
|
5386
|
+
* // Do the magic
|
|
5387
|
+
* const res = await sheets.spreadsheets.get({
|
|
5388
|
+
* // True if tables should be excluded in the banded ranges. False if not set.
|
|
5389
|
+
* excludeTablesInBandedRanges: 'placeholder-value',
|
|
5390
|
+
* // True if grid data should be returned. This parameter is ignored if a field mask was set in the request.
|
|
5391
|
+
* includeGridData: 'placeholder-value',
|
|
5392
|
+
* // The ranges to retrieve from the spreadsheet.
|
|
5393
|
+
* ranges: 'placeholder-value',
|
|
5394
|
+
* // The spreadsheet to request.
|
|
5395
|
+
* spreadsheetId: 'placeholder-value',
|
|
5396
|
+
* });
|
|
5397
|
+
* console.log(res.data);
|
|
5398
|
+
*
|
|
5399
|
+
* // Example response
|
|
5400
|
+
* // {
|
|
5401
|
+
* // "dataSourceSchedules": [],
|
|
5402
|
+
* // "dataSources": [],
|
|
5403
|
+
* // "developerMetadata": [],
|
|
5404
|
+
* // "namedRanges": [],
|
|
5405
|
+
* // "properties": {},
|
|
5406
|
+
* // "sheets": [],
|
|
5407
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5408
|
+
* // "spreadsheetUrl": "my_spreadsheetUrl"
|
|
5409
|
+
* // }
|
|
5410
|
+
* }
|
|
5411
|
+
*
|
|
5412
|
+
* main().catch(e => {
|
|
5413
|
+
* console.error(e);
|
|
5414
|
+
* throw e;
|
|
5415
|
+
* });
|
|
5416
|
+
*
|
|
5417
|
+
* ```
|
|
5149
5418
|
*
|
|
5150
5419
|
* @param params - Parameters for request
|
|
5151
5420
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5160,6 +5429,73 @@ export declare namespace sheets_v4 {
|
|
|
5160
5429
|
get(callback: BodyResponseCallback<Schema$Spreadsheet>): void;
|
|
5161
5430
|
/**
|
|
5162
5431
|
* 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.
|
|
5432
|
+
* @example
|
|
5433
|
+
* ```js
|
|
5434
|
+
* // Before running the sample:
|
|
5435
|
+
* // - Enable the API at:
|
|
5436
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5437
|
+
* // - Login into gcloud by running:
|
|
5438
|
+
* // ```sh
|
|
5439
|
+
* // $ gcloud auth application-default login
|
|
5440
|
+
* // ```
|
|
5441
|
+
* // - Install the npm module by running:
|
|
5442
|
+
* // ```sh
|
|
5443
|
+
* // $ npm install googleapis
|
|
5444
|
+
* // ```
|
|
5445
|
+
*
|
|
5446
|
+
* const {google} = require('googleapis');
|
|
5447
|
+
* const sheets = google.sheets('v4');
|
|
5448
|
+
*
|
|
5449
|
+
* async function main() {
|
|
5450
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5451
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5452
|
+
* scopes: [
|
|
5453
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5454
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5455
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5456
|
+
* ],
|
|
5457
|
+
* });
|
|
5458
|
+
*
|
|
5459
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5460
|
+
* const authClient = await auth.getClient();
|
|
5461
|
+
* google.options({auth: authClient});
|
|
5462
|
+
*
|
|
5463
|
+
* // Do the magic
|
|
5464
|
+
* const res = await sheets.spreadsheets.getByDataFilter({
|
|
5465
|
+
* // The spreadsheet to request.
|
|
5466
|
+
* spreadsheetId: 'placeholder-value',
|
|
5467
|
+
*
|
|
5468
|
+
* // Request body metadata
|
|
5469
|
+
* requestBody: {
|
|
5470
|
+
* // request body parameters
|
|
5471
|
+
* // {
|
|
5472
|
+
* // "dataFilters": [],
|
|
5473
|
+
* // "excludeTablesInBandedRanges": false,
|
|
5474
|
+
* // "includeGridData": false
|
|
5475
|
+
* // }
|
|
5476
|
+
* },
|
|
5477
|
+
* });
|
|
5478
|
+
* console.log(res.data);
|
|
5479
|
+
*
|
|
5480
|
+
* // Example response
|
|
5481
|
+
* // {
|
|
5482
|
+
* // "dataSourceSchedules": [],
|
|
5483
|
+
* // "dataSources": [],
|
|
5484
|
+
* // "developerMetadata": [],
|
|
5485
|
+
* // "namedRanges": [],
|
|
5486
|
+
* // "properties": {},
|
|
5487
|
+
* // "sheets": [],
|
|
5488
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5489
|
+
* // "spreadsheetUrl": "my_spreadsheetUrl"
|
|
5490
|
+
* // }
|
|
5491
|
+
* }
|
|
5492
|
+
*
|
|
5493
|
+
* main().catch(e => {
|
|
5494
|
+
* console.error(e);
|
|
5495
|
+
* throw e;
|
|
5496
|
+
* });
|
|
5497
|
+
*
|
|
5498
|
+
* ```
|
|
5163
5499
|
*
|
|
5164
5500
|
* @param params - Parameters for request
|
|
5165
5501
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5222,6 +5558,62 @@ export declare namespace sheets_v4 {
|
|
|
5222
5558
|
constructor(context: APIRequestContext);
|
|
5223
5559
|
/**
|
|
5224
5560
|
* Returns the developer metadata with the specified ID. The caller must specify the spreadsheet ID and the developer metadata's unique metadataId.
|
|
5561
|
+
* @example
|
|
5562
|
+
* ```js
|
|
5563
|
+
* // Before running the sample:
|
|
5564
|
+
* // - Enable the API at:
|
|
5565
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5566
|
+
* // - Login into gcloud by running:
|
|
5567
|
+
* // ```sh
|
|
5568
|
+
* // $ gcloud auth application-default login
|
|
5569
|
+
* // ```
|
|
5570
|
+
* // - Install the npm module by running:
|
|
5571
|
+
* // ```sh
|
|
5572
|
+
* // $ npm install googleapis
|
|
5573
|
+
* // ```
|
|
5574
|
+
*
|
|
5575
|
+
* const {google} = require('googleapis');
|
|
5576
|
+
* const sheets = google.sheets('v4');
|
|
5577
|
+
*
|
|
5578
|
+
* async function main() {
|
|
5579
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5580
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5581
|
+
* scopes: [
|
|
5582
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5583
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5584
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5585
|
+
* ],
|
|
5586
|
+
* });
|
|
5587
|
+
*
|
|
5588
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5589
|
+
* const authClient = await auth.getClient();
|
|
5590
|
+
* google.options({auth: authClient});
|
|
5591
|
+
*
|
|
5592
|
+
* // Do the magic
|
|
5593
|
+
* const res = await sheets.spreadsheets.developerMetadata.get({
|
|
5594
|
+
* // The ID of the developer metadata to retrieve.
|
|
5595
|
+
* metadataId: 'placeholder-value',
|
|
5596
|
+
* // The ID of the spreadsheet to retrieve metadata from.
|
|
5597
|
+
* spreadsheetId: 'placeholder-value',
|
|
5598
|
+
* });
|
|
5599
|
+
* console.log(res.data);
|
|
5600
|
+
*
|
|
5601
|
+
* // Example response
|
|
5602
|
+
* // {
|
|
5603
|
+
* // "location": {},
|
|
5604
|
+
* // "metadataId": 0,
|
|
5605
|
+
* // "metadataKey": "my_metadataKey",
|
|
5606
|
+
* // "metadataValue": "my_metadataValue",
|
|
5607
|
+
* // "visibility": "my_visibility"
|
|
5608
|
+
* // }
|
|
5609
|
+
* }
|
|
5610
|
+
*
|
|
5611
|
+
* main().catch(e => {
|
|
5612
|
+
* console.error(e);
|
|
5613
|
+
* throw e;
|
|
5614
|
+
* });
|
|
5615
|
+
*
|
|
5616
|
+
* ```
|
|
5225
5617
|
*
|
|
5226
5618
|
* @param params - Parameters for request
|
|
5227
5619
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5236,6 +5628,64 @@ export declare namespace sheets_v4 {
|
|
|
5236
5628
|
get(callback: BodyResponseCallback<Schema$DeveloperMetadata>): void;
|
|
5237
5629
|
/**
|
|
5238
5630
|
* 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.
|
|
5631
|
+
* @example
|
|
5632
|
+
* ```js
|
|
5633
|
+
* // Before running the sample:
|
|
5634
|
+
* // - Enable the API at:
|
|
5635
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5636
|
+
* // - Login into gcloud by running:
|
|
5637
|
+
* // ```sh
|
|
5638
|
+
* // $ gcloud auth application-default login
|
|
5639
|
+
* // ```
|
|
5640
|
+
* // - Install the npm module by running:
|
|
5641
|
+
* // ```sh
|
|
5642
|
+
* // $ npm install googleapis
|
|
5643
|
+
* // ```
|
|
5644
|
+
*
|
|
5645
|
+
* const {google} = require('googleapis');
|
|
5646
|
+
* const sheets = google.sheets('v4');
|
|
5647
|
+
*
|
|
5648
|
+
* async function main() {
|
|
5649
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5650
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5651
|
+
* scopes: [
|
|
5652
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5653
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5654
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5655
|
+
* ],
|
|
5656
|
+
* });
|
|
5657
|
+
*
|
|
5658
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5659
|
+
* const authClient = await auth.getClient();
|
|
5660
|
+
* google.options({auth: authClient});
|
|
5661
|
+
*
|
|
5662
|
+
* // Do the magic
|
|
5663
|
+
* const res = await sheets.spreadsheets.developerMetadata.search({
|
|
5664
|
+
* // The ID of the spreadsheet to retrieve metadata from.
|
|
5665
|
+
* spreadsheetId: 'placeholder-value',
|
|
5666
|
+
*
|
|
5667
|
+
* // Request body metadata
|
|
5668
|
+
* requestBody: {
|
|
5669
|
+
* // request body parameters
|
|
5670
|
+
* // {
|
|
5671
|
+
* // "dataFilters": []
|
|
5672
|
+
* // }
|
|
5673
|
+
* },
|
|
5674
|
+
* });
|
|
5675
|
+
* console.log(res.data);
|
|
5676
|
+
*
|
|
5677
|
+
* // Example response
|
|
5678
|
+
* // {
|
|
5679
|
+
* // "matchedDeveloperMetadata": []
|
|
5680
|
+
* // }
|
|
5681
|
+
* }
|
|
5682
|
+
*
|
|
5683
|
+
* main().catch(e => {
|
|
5684
|
+
* console.error(e);
|
|
5685
|
+
* throw e;
|
|
5686
|
+
* });
|
|
5687
|
+
*
|
|
5688
|
+
* ```
|
|
5239
5689
|
*
|
|
5240
5690
|
* @param params - Parameters for request
|
|
5241
5691
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5274,6 +5724,75 @@ export declare namespace sheets_v4 {
|
|
|
5274
5724
|
constructor(context: APIRequestContext);
|
|
5275
5725
|
/**
|
|
5276
5726
|
* Copies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.
|
|
5727
|
+
* @example
|
|
5728
|
+
* ```js
|
|
5729
|
+
* // Before running the sample:
|
|
5730
|
+
* // - Enable the API at:
|
|
5731
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5732
|
+
* // - Login into gcloud by running:
|
|
5733
|
+
* // ```sh
|
|
5734
|
+
* // $ gcloud auth application-default login
|
|
5735
|
+
* // ```
|
|
5736
|
+
* // - Install the npm module by running:
|
|
5737
|
+
* // ```sh
|
|
5738
|
+
* // $ npm install googleapis
|
|
5739
|
+
* // ```
|
|
5740
|
+
*
|
|
5741
|
+
* const {google} = require('googleapis');
|
|
5742
|
+
* const sheets = google.sheets('v4');
|
|
5743
|
+
*
|
|
5744
|
+
* async function main() {
|
|
5745
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5746
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5747
|
+
* scopes: [
|
|
5748
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5749
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5750
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5751
|
+
* ],
|
|
5752
|
+
* });
|
|
5753
|
+
*
|
|
5754
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5755
|
+
* const authClient = await auth.getClient();
|
|
5756
|
+
* google.options({auth: authClient});
|
|
5757
|
+
*
|
|
5758
|
+
* // Do the magic
|
|
5759
|
+
* const res = await sheets.spreadsheets.sheets.copyTo({
|
|
5760
|
+
* // The ID of the sheet to copy.
|
|
5761
|
+
* sheetId: 'placeholder-value',
|
|
5762
|
+
* // The ID of the spreadsheet containing the sheet to copy.
|
|
5763
|
+
* spreadsheetId: 'placeholder-value',
|
|
5764
|
+
*
|
|
5765
|
+
* // Request body metadata
|
|
5766
|
+
* requestBody: {
|
|
5767
|
+
* // request body parameters
|
|
5768
|
+
* // {
|
|
5769
|
+
* // "destinationSpreadsheetId": "my_destinationSpreadsheetId"
|
|
5770
|
+
* // }
|
|
5771
|
+
* },
|
|
5772
|
+
* });
|
|
5773
|
+
* console.log(res.data);
|
|
5774
|
+
*
|
|
5775
|
+
* // Example response
|
|
5776
|
+
* // {
|
|
5777
|
+
* // "dataSourceSheetProperties": {},
|
|
5778
|
+
* // "gridProperties": {},
|
|
5779
|
+
* // "hidden": false,
|
|
5780
|
+
* // "index": 0,
|
|
5781
|
+
* // "rightToLeft": false,
|
|
5782
|
+
* // "sheetId": 0,
|
|
5783
|
+
* // "sheetType": "my_sheetType",
|
|
5784
|
+
* // "tabColor": {},
|
|
5785
|
+
* // "tabColorStyle": {},
|
|
5786
|
+
* // "title": "my_title"
|
|
5787
|
+
* // }
|
|
5788
|
+
* }
|
|
5789
|
+
*
|
|
5790
|
+
* main().catch(e => {
|
|
5791
|
+
* console.error(e);
|
|
5792
|
+
* throw e;
|
|
5793
|
+
* });
|
|
5794
|
+
*
|
|
5795
|
+
* ```
|
|
5277
5796
|
*
|
|
5278
5797
|
* @param params - Parameters for request
|
|
5279
5798
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5306,6 +5825,80 @@ export declare namespace sheets_v4 {
|
|
|
5306
5825
|
constructor(context: APIRequestContext);
|
|
5307
5826
|
/**
|
|
5308
5827
|
* 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.
|
|
5828
|
+
* @example
|
|
5829
|
+
* ```js
|
|
5830
|
+
* // Before running the sample:
|
|
5831
|
+
* // - Enable the API at:
|
|
5832
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5833
|
+
* // - Login into gcloud by running:
|
|
5834
|
+
* // ```sh
|
|
5835
|
+
* // $ gcloud auth application-default login
|
|
5836
|
+
* // ```
|
|
5837
|
+
* // - Install the npm module by running:
|
|
5838
|
+
* // ```sh
|
|
5839
|
+
* // $ npm install googleapis
|
|
5840
|
+
* // ```
|
|
5841
|
+
*
|
|
5842
|
+
* const {google} = require('googleapis');
|
|
5843
|
+
* const sheets = google.sheets('v4');
|
|
5844
|
+
*
|
|
5845
|
+
* async function main() {
|
|
5846
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5847
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5848
|
+
* scopes: [
|
|
5849
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5850
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5851
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5852
|
+
* ],
|
|
5853
|
+
* });
|
|
5854
|
+
*
|
|
5855
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5856
|
+
* const authClient = await auth.getClient();
|
|
5857
|
+
* google.options({auth: authClient});
|
|
5858
|
+
*
|
|
5859
|
+
* // Do the magic
|
|
5860
|
+
* const res = await sheets.spreadsheets.values.append({
|
|
5861
|
+
* // Determines if the update response should include the values of the cells that were appended. By default, responses do not include the updated values.
|
|
5862
|
+
* includeValuesInResponse: 'placeholder-value',
|
|
5863
|
+
* // How the input data should be inserted.
|
|
5864
|
+
* insertDataOption: 'placeholder-value',
|
|
5865
|
+
* // 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.
|
|
5866
|
+
* range: 'placeholder-value',
|
|
5867
|
+
* // 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.
|
|
5868
|
+
* responseDateTimeRenderOption: 'placeholder-value',
|
|
5869
|
+
* // Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
|
|
5870
|
+
* responseValueRenderOption: 'placeholder-value',
|
|
5871
|
+
* // The ID of the spreadsheet to update.
|
|
5872
|
+
* spreadsheetId: 'placeholder-value',
|
|
5873
|
+
* // How the input data should be interpreted.
|
|
5874
|
+
* valueInputOption: 'placeholder-value',
|
|
5875
|
+
*
|
|
5876
|
+
* // Request body metadata
|
|
5877
|
+
* requestBody: {
|
|
5878
|
+
* // request body parameters
|
|
5879
|
+
* // {
|
|
5880
|
+
* // "majorDimension": "my_majorDimension",
|
|
5881
|
+
* // "range": "my_range",
|
|
5882
|
+
* // "values": []
|
|
5883
|
+
* // }
|
|
5884
|
+
* },
|
|
5885
|
+
* });
|
|
5886
|
+
* console.log(res.data);
|
|
5887
|
+
*
|
|
5888
|
+
* // Example response
|
|
5889
|
+
* // {
|
|
5890
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
5891
|
+
* // "tableRange": "my_tableRange",
|
|
5892
|
+
* // "updates": {}
|
|
5893
|
+
* // }
|
|
5894
|
+
* }
|
|
5895
|
+
*
|
|
5896
|
+
* main().catch(e => {
|
|
5897
|
+
* console.error(e);
|
|
5898
|
+
* throw e;
|
|
5899
|
+
* });
|
|
5900
|
+
*
|
|
5901
|
+
* ```
|
|
5309
5902
|
*
|
|
5310
5903
|
* @param params - Parameters for request
|
|
5311
5904
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5320,6 +5913,65 @@ export declare namespace sheets_v4 {
|
|
|
5320
5913
|
append(callback: BodyResponseCallback<Schema$AppendValuesResponse>): void;
|
|
5321
5914
|
/**
|
|
5322
5915
|
* 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.
|
|
5916
|
+
* @example
|
|
5917
|
+
* ```js
|
|
5918
|
+
* // Before running the sample:
|
|
5919
|
+
* // - Enable the API at:
|
|
5920
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5921
|
+
* // - Login into gcloud by running:
|
|
5922
|
+
* // ```sh
|
|
5923
|
+
* // $ gcloud auth application-default login
|
|
5924
|
+
* // ```
|
|
5925
|
+
* // - Install the npm module by running:
|
|
5926
|
+
* // ```sh
|
|
5927
|
+
* // $ npm install googleapis
|
|
5928
|
+
* // ```
|
|
5929
|
+
*
|
|
5930
|
+
* const {google} = require('googleapis');
|
|
5931
|
+
* const sheets = google.sheets('v4');
|
|
5932
|
+
*
|
|
5933
|
+
* async function main() {
|
|
5934
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5935
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5936
|
+
* scopes: [
|
|
5937
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
5938
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
5939
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
5940
|
+
* ],
|
|
5941
|
+
* });
|
|
5942
|
+
*
|
|
5943
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5944
|
+
* const authClient = await auth.getClient();
|
|
5945
|
+
* google.options({auth: authClient});
|
|
5946
|
+
*
|
|
5947
|
+
* // Do the magic
|
|
5948
|
+
* const res = await sheets.spreadsheets.values.batchClear({
|
|
5949
|
+
* // The ID of the spreadsheet to update.
|
|
5950
|
+
* spreadsheetId: 'placeholder-value',
|
|
5951
|
+
*
|
|
5952
|
+
* // Request body metadata
|
|
5953
|
+
* requestBody: {
|
|
5954
|
+
* // request body parameters
|
|
5955
|
+
* // {
|
|
5956
|
+
* // "ranges": []
|
|
5957
|
+
* // }
|
|
5958
|
+
* },
|
|
5959
|
+
* });
|
|
5960
|
+
* console.log(res.data);
|
|
5961
|
+
*
|
|
5962
|
+
* // Example response
|
|
5963
|
+
* // {
|
|
5964
|
+
* // "clearedRanges": [],
|
|
5965
|
+
* // "spreadsheetId": "my_spreadsheetId"
|
|
5966
|
+
* // }
|
|
5967
|
+
* }
|
|
5968
|
+
*
|
|
5969
|
+
* main().catch(e => {
|
|
5970
|
+
* console.error(e);
|
|
5971
|
+
* throw e;
|
|
5972
|
+
* });
|
|
5973
|
+
*
|
|
5974
|
+
* ```
|
|
5323
5975
|
*
|
|
5324
5976
|
* @param params - Parameters for request
|
|
5325
5977
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5334,6 +5986,65 @@ export declare namespace sheets_v4 {
|
|
|
5334
5986
|
batchClear(callback: BodyResponseCallback<Schema$BatchClearValuesResponse>): void;
|
|
5335
5987
|
/**
|
|
5336
5988
|
* 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.
|
|
5989
|
+
* @example
|
|
5990
|
+
* ```js
|
|
5991
|
+
* // Before running the sample:
|
|
5992
|
+
* // - Enable the API at:
|
|
5993
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
5994
|
+
* // - Login into gcloud by running:
|
|
5995
|
+
* // ```sh
|
|
5996
|
+
* // $ gcloud auth application-default login
|
|
5997
|
+
* // ```
|
|
5998
|
+
* // - Install the npm module by running:
|
|
5999
|
+
* // ```sh
|
|
6000
|
+
* // $ npm install googleapis
|
|
6001
|
+
* // ```
|
|
6002
|
+
*
|
|
6003
|
+
* const {google} = require('googleapis');
|
|
6004
|
+
* const sheets = google.sheets('v4');
|
|
6005
|
+
*
|
|
6006
|
+
* async function main() {
|
|
6007
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6008
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6009
|
+
* scopes: [
|
|
6010
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6011
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6012
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6013
|
+
* ],
|
|
6014
|
+
* });
|
|
6015
|
+
*
|
|
6016
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6017
|
+
* const authClient = await auth.getClient();
|
|
6018
|
+
* google.options({auth: authClient});
|
|
6019
|
+
*
|
|
6020
|
+
* // Do the magic
|
|
6021
|
+
* const res = await sheets.spreadsheets.values.batchClearByDataFilter({
|
|
6022
|
+
* // The ID of the spreadsheet to update.
|
|
6023
|
+
* spreadsheetId: 'placeholder-value',
|
|
6024
|
+
*
|
|
6025
|
+
* // Request body metadata
|
|
6026
|
+
* requestBody: {
|
|
6027
|
+
* // request body parameters
|
|
6028
|
+
* // {
|
|
6029
|
+
* // "dataFilters": []
|
|
6030
|
+
* // }
|
|
6031
|
+
* },
|
|
6032
|
+
* });
|
|
6033
|
+
* console.log(res.data);
|
|
6034
|
+
*
|
|
6035
|
+
* // Example response
|
|
6036
|
+
* // {
|
|
6037
|
+
* // "clearedRanges": [],
|
|
6038
|
+
* // "spreadsheetId": "my_spreadsheetId"
|
|
6039
|
+
* // }
|
|
6040
|
+
* }
|
|
6041
|
+
*
|
|
6042
|
+
* main().catch(e => {
|
|
6043
|
+
* console.error(e);
|
|
6044
|
+
* throw e;
|
|
6045
|
+
* });
|
|
6046
|
+
*
|
|
6047
|
+
* ```
|
|
5337
6048
|
*
|
|
5338
6049
|
* @param params - Parameters for request
|
|
5339
6050
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5348,6 +6059,67 @@ export declare namespace sheets_v4 {
|
|
|
5348
6059
|
batchClearByDataFilter(callback: BodyResponseCallback<Schema$BatchClearValuesByDataFilterResponse>): void;
|
|
5349
6060
|
/**
|
|
5350
6061
|
* Returns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges.
|
|
6062
|
+
* @example
|
|
6063
|
+
* ```js
|
|
6064
|
+
* // Before running the sample:
|
|
6065
|
+
* // - Enable the API at:
|
|
6066
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6067
|
+
* // - Login into gcloud by running:
|
|
6068
|
+
* // ```sh
|
|
6069
|
+
* // $ gcloud auth application-default login
|
|
6070
|
+
* // ```
|
|
6071
|
+
* // - Install the npm module by running:
|
|
6072
|
+
* // ```sh
|
|
6073
|
+
* // $ npm install googleapis
|
|
6074
|
+
* // ```
|
|
6075
|
+
*
|
|
6076
|
+
* const {google} = require('googleapis');
|
|
6077
|
+
* const sheets = google.sheets('v4');
|
|
6078
|
+
*
|
|
6079
|
+
* async function main() {
|
|
6080
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6081
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6082
|
+
* scopes: [
|
|
6083
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6084
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6085
|
+
* 'https://www.googleapis.com/auth/drive.readonly',
|
|
6086
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6087
|
+
* 'https://www.googleapis.com/auth/spreadsheets.readonly',
|
|
6088
|
+
* ],
|
|
6089
|
+
* });
|
|
6090
|
+
*
|
|
6091
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6092
|
+
* const authClient = await auth.getClient();
|
|
6093
|
+
* google.options({auth: authClient});
|
|
6094
|
+
*
|
|
6095
|
+
* // Do the magic
|
|
6096
|
+
* const res = await sheets.spreadsheets.values.batchGet({
|
|
6097
|
+
* // 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.
|
|
6098
|
+
* dateTimeRenderOption: 'placeholder-value',
|
|
6099
|
+
* // 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]]`.
|
|
6100
|
+
* majorDimension: 'placeholder-value',
|
|
6101
|
+
* // The [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the range to retrieve values from.
|
|
6102
|
+
* ranges: 'placeholder-value',
|
|
6103
|
+
* // The ID of the spreadsheet to retrieve data from.
|
|
6104
|
+
* spreadsheetId: 'placeholder-value',
|
|
6105
|
+
* // How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE.
|
|
6106
|
+
* valueRenderOption: 'placeholder-value',
|
|
6107
|
+
* });
|
|
6108
|
+
* console.log(res.data);
|
|
6109
|
+
*
|
|
6110
|
+
* // Example response
|
|
6111
|
+
* // {
|
|
6112
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
6113
|
+
* // "valueRanges": []
|
|
6114
|
+
* // }
|
|
6115
|
+
* }
|
|
6116
|
+
*
|
|
6117
|
+
* main().catch(e => {
|
|
6118
|
+
* console.error(e);
|
|
6119
|
+
* throw e;
|
|
6120
|
+
* });
|
|
6121
|
+
*
|
|
6122
|
+
* ```
|
|
5351
6123
|
*
|
|
5352
6124
|
* @param params - Parameters for request
|
|
5353
6125
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5362,6 +6134,68 @@ export declare namespace sheets_v4 {
|
|
|
5362
6134
|
batchGet(callback: BodyResponseCallback<Schema$BatchGetValuesResponse>): void;
|
|
5363
6135
|
/**
|
|
5364
6136
|
* 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.
|
|
6137
|
+
* @example
|
|
6138
|
+
* ```js
|
|
6139
|
+
* // Before running the sample:
|
|
6140
|
+
* // - Enable the API at:
|
|
6141
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6142
|
+
* // - Login into gcloud by running:
|
|
6143
|
+
* // ```sh
|
|
6144
|
+
* // $ gcloud auth application-default login
|
|
6145
|
+
* // ```
|
|
6146
|
+
* // - Install the npm module by running:
|
|
6147
|
+
* // ```sh
|
|
6148
|
+
* // $ npm install googleapis
|
|
6149
|
+
* // ```
|
|
6150
|
+
*
|
|
6151
|
+
* const {google} = require('googleapis');
|
|
6152
|
+
* const sheets = google.sheets('v4');
|
|
6153
|
+
*
|
|
6154
|
+
* async function main() {
|
|
6155
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6156
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6157
|
+
* scopes: [
|
|
6158
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6159
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6160
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6161
|
+
* ],
|
|
6162
|
+
* });
|
|
6163
|
+
*
|
|
6164
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6165
|
+
* const authClient = await auth.getClient();
|
|
6166
|
+
* google.options({auth: authClient});
|
|
6167
|
+
*
|
|
6168
|
+
* // Do the magic
|
|
6169
|
+
* const res = await sheets.spreadsheets.values.batchGetByDataFilter({
|
|
6170
|
+
* // The ID of the spreadsheet to retrieve data from.
|
|
6171
|
+
* spreadsheetId: 'placeholder-value',
|
|
6172
|
+
*
|
|
6173
|
+
* // Request body metadata
|
|
6174
|
+
* requestBody: {
|
|
6175
|
+
* // request body parameters
|
|
6176
|
+
* // {
|
|
6177
|
+
* // "dataFilters": [],
|
|
6178
|
+
* // "dateTimeRenderOption": "my_dateTimeRenderOption",
|
|
6179
|
+
* // "majorDimension": "my_majorDimension",
|
|
6180
|
+
* // "valueRenderOption": "my_valueRenderOption"
|
|
6181
|
+
* // }
|
|
6182
|
+
* },
|
|
6183
|
+
* });
|
|
6184
|
+
* console.log(res.data);
|
|
6185
|
+
*
|
|
6186
|
+
* // Example response
|
|
6187
|
+
* // {
|
|
6188
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
6189
|
+
* // "valueRanges": []
|
|
6190
|
+
* // }
|
|
6191
|
+
* }
|
|
6192
|
+
*
|
|
6193
|
+
* main().catch(e => {
|
|
6194
|
+
* console.error(e);
|
|
6195
|
+
* throw e;
|
|
6196
|
+
* });
|
|
6197
|
+
*
|
|
6198
|
+
* ```
|
|
5365
6199
|
*
|
|
5366
6200
|
* @param params - Parameters for request
|
|
5367
6201
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5376,6 +6210,73 @@ export declare namespace sheets_v4 {
|
|
|
5376
6210
|
batchGetByDataFilter(callback: BodyResponseCallback<Schema$BatchGetValuesByDataFilterResponse>): void;
|
|
5377
6211
|
/**
|
|
5378
6212
|
* Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.
|
|
6213
|
+
* @example
|
|
6214
|
+
* ```js
|
|
6215
|
+
* // Before running the sample:
|
|
6216
|
+
* // - Enable the API at:
|
|
6217
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6218
|
+
* // - Login into gcloud by running:
|
|
6219
|
+
* // ```sh
|
|
6220
|
+
* // $ gcloud auth application-default login
|
|
6221
|
+
* // ```
|
|
6222
|
+
* // - Install the npm module by running:
|
|
6223
|
+
* // ```sh
|
|
6224
|
+
* // $ npm install googleapis
|
|
6225
|
+
* // ```
|
|
6226
|
+
*
|
|
6227
|
+
* const {google} = require('googleapis');
|
|
6228
|
+
* const sheets = google.sheets('v4');
|
|
6229
|
+
*
|
|
6230
|
+
* async function main() {
|
|
6231
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6232
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6233
|
+
* scopes: [
|
|
6234
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6235
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6236
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6237
|
+
* ],
|
|
6238
|
+
* });
|
|
6239
|
+
*
|
|
6240
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6241
|
+
* const authClient = await auth.getClient();
|
|
6242
|
+
* google.options({auth: authClient});
|
|
6243
|
+
*
|
|
6244
|
+
* // Do the magic
|
|
6245
|
+
* const res = await sheets.spreadsheets.values.batchUpdate({
|
|
6246
|
+
* // The ID of the spreadsheet to update.
|
|
6247
|
+
* spreadsheetId: 'placeholder-value',
|
|
6248
|
+
*
|
|
6249
|
+
* // Request body metadata
|
|
6250
|
+
* requestBody: {
|
|
6251
|
+
* // request body parameters
|
|
6252
|
+
* // {
|
|
6253
|
+
* // "data": [],
|
|
6254
|
+
* // "includeValuesInResponse": false,
|
|
6255
|
+
* // "responseDateTimeRenderOption": "my_responseDateTimeRenderOption",
|
|
6256
|
+
* // "responseValueRenderOption": "my_responseValueRenderOption",
|
|
6257
|
+
* // "valueInputOption": "my_valueInputOption"
|
|
6258
|
+
* // }
|
|
6259
|
+
* },
|
|
6260
|
+
* });
|
|
6261
|
+
* console.log(res.data);
|
|
6262
|
+
*
|
|
6263
|
+
* // Example response
|
|
6264
|
+
* // {
|
|
6265
|
+
* // "responses": [],
|
|
6266
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
6267
|
+
* // "totalUpdatedCells": 0,
|
|
6268
|
+
* // "totalUpdatedColumns": 0,
|
|
6269
|
+
* // "totalUpdatedRows": 0,
|
|
6270
|
+
* // "totalUpdatedSheets": 0
|
|
6271
|
+
* // }
|
|
6272
|
+
* }
|
|
6273
|
+
*
|
|
6274
|
+
* main().catch(e => {
|
|
6275
|
+
* console.error(e);
|
|
6276
|
+
* throw e;
|
|
6277
|
+
* });
|
|
6278
|
+
*
|
|
6279
|
+
* ```
|
|
5379
6280
|
*
|
|
5380
6281
|
* @param params - Parameters for request
|
|
5381
6282
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5390,6 +6291,73 @@ export declare namespace sheets_v4 {
|
|
|
5390
6291
|
batchUpdate(callback: BodyResponseCallback<Schema$BatchUpdateValuesResponse>): void;
|
|
5391
6292
|
/**
|
|
5392
6293
|
* Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more DataFilterValueRanges.
|
|
6294
|
+
* @example
|
|
6295
|
+
* ```js
|
|
6296
|
+
* // Before running the sample:
|
|
6297
|
+
* // - Enable the API at:
|
|
6298
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6299
|
+
* // - Login into gcloud by running:
|
|
6300
|
+
* // ```sh
|
|
6301
|
+
* // $ gcloud auth application-default login
|
|
6302
|
+
* // ```
|
|
6303
|
+
* // - Install the npm module by running:
|
|
6304
|
+
* // ```sh
|
|
6305
|
+
* // $ npm install googleapis
|
|
6306
|
+
* // ```
|
|
6307
|
+
*
|
|
6308
|
+
* const {google} = require('googleapis');
|
|
6309
|
+
* const sheets = google.sheets('v4');
|
|
6310
|
+
*
|
|
6311
|
+
* async function main() {
|
|
6312
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6313
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6314
|
+
* scopes: [
|
|
6315
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6316
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6317
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6318
|
+
* ],
|
|
6319
|
+
* });
|
|
6320
|
+
*
|
|
6321
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6322
|
+
* const authClient = await auth.getClient();
|
|
6323
|
+
* google.options({auth: authClient});
|
|
6324
|
+
*
|
|
6325
|
+
* // Do the magic
|
|
6326
|
+
* const res = await sheets.spreadsheets.values.batchUpdateByDataFilter({
|
|
6327
|
+
* // The ID of the spreadsheet to update.
|
|
6328
|
+
* spreadsheetId: 'placeholder-value',
|
|
6329
|
+
*
|
|
6330
|
+
* // Request body metadata
|
|
6331
|
+
* requestBody: {
|
|
6332
|
+
* // request body parameters
|
|
6333
|
+
* // {
|
|
6334
|
+
* // "data": [],
|
|
6335
|
+
* // "includeValuesInResponse": false,
|
|
6336
|
+
* // "responseDateTimeRenderOption": "my_responseDateTimeRenderOption",
|
|
6337
|
+
* // "responseValueRenderOption": "my_responseValueRenderOption",
|
|
6338
|
+
* // "valueInputOption": "my_valueInputOption"
|
|
6339
|
+
* // }
|
|
6340
|
+
* },
|
|
6341
|
+
* });
|
|
6342
|
+
* console.log(res.data);
|
|
6343
|
+
*
|
|
6344
|
+
* // Example response
|
|
6345
|
+
* // {
|
|
6346
|
+
* // "responses": [],
|
|
6347
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
6348
|
+
* // "totalUpdatedCells": 0,
|
|
6349
|
+
* // "totalUpdatedColumns": 0,
|
|
6350
|
+
* // "totalUpdatedRows": 0,
|
|
6351
|
+
* // "totalUpdatedSheets": 0
|
|
6352
|
+
* // }
|
|
6353
|
+
* }
|
|
6354
|
+
*
|
|
6355
|
+
* main().catch(e => {
|
|
6356
|
+
* console.error(e);
|
|
6357
|
+
* throw e;
|
|
6358
|
+
* });
|
|
6359
|
+
*
|
|
6360
|
+
* ```
|
|
5393
6361
|
*
|
|
5394
6362
|
* @param params - Parameters for request
|
|
5395
6363
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5404,6 +6372,65 @@ export declare namespace sheets_v4 {
|
|
|
5404
6372
|
batchUpdateByDataFilter(callback: BodyResponseCallback<Schema$BatchUpdateValuesByDataFilterResponse>): void;
|
|
5405
6373
|
/**
|
|
5406
6374
|
* 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.
|
|
6375
|
+
* @example
|
|
6376
|
+
* ```js
|
|
6377
|
+
* // Before running the sample:
|
|
6378
|
+
* // - Enable the API at:
|
|
6379
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6380
|
+
* // - Login into gcloud by running:
|
|
6381
|
+
* // ```sh
|
|
6382
|
+
* // $ gcloud auth application-default login
|
|
6383
|
+
* // ```
|
|
6384
|
+
* // - Install the npm module by running:
|
|
6385
|
+
* // ```sh
|
|
6386
|
+
* // $ npm install googleapis
|
|
6387
|
+
* // ```
|
|
6388
|
+
*
|
|
6389
|
+
* const {google} = require('googleapis');
|
|
6390
|
+
* const sheets = google.sheets('v4');
|
|
6391
|
+
*
|
|
6392
|
+
* async function main() {
|
|
6393
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6394
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6395
|
+
* scopes: [
|
|
6396
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6397
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6398
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6399
|
+
* ],
|
|
6400
|
+
* });
|
|
6401
|
+
*
|
|
6402
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6403
|
+
* const authClient = await auth.getClient();
|
|
6404
|
+
* google.options({auth: authClient});
|
|
6405
|
+
*
|
|
6406
|
+
* // Do the magic
|
|
6407
|
+
* const res = await sheets.spreadsheets.values.clear({
|
|
6408
|
+
* // The [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to clear.
|
|
6409
|
+
* range: 'placeholder-value',
|
|
6410
|
+
* // The ID of the spreadsheet to update.
|
|
6411
|
+
* spreadsheetId: 'placeholder-value',
|
|
6412
|
+
*
|
|
6413
|
+
* // Request body metadata
|
|
6414
|
+
* requestBody: {
|
|
6415
|
+
* // request body parameters
|
|
6416
|
+
* // {}
|
|
6417
|
+
* },
|
|
6418
|
+
* });
|
|
6419
|
+
* console.log(res.data);
|
|
6420
|
+
*
|
|
6421
|
+
* // Example response
|
|
6422
|
+
* // {
|
|
6423
|
+
* // "clearedRange": "my_clearedRange",
|
|
6424
|
+
* // "spreadsheetId": "my_spreadsheetId"
|
|
6425
|
+
* // }
|
|
6426
|
+
* }
|
|
6427
|
+
*
|
|
6428
|
+
* main().catch(e => {
|
|
6429
|
+
* console.error(e);
|
|
6430
|
+
* throw e;
|
|
6431
|
+
* });
|
|
6432
|
+
*
|
|
6433
|
+
* ```
|
|
5407
6434
|
*
|
|
5408
6435
|
* @param params - Parameters for request
|
|
5409
6436
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5418,6 +6445,68 @@ export declare namespace sheets_v4 {
|
|
|
5418
6445
|
clear(callback: BodyResponseCallback<Schema$ClearValuesResponse>): void;
|
|
5419
6446
|
/**
|
|
5420
6447
|
* Returns a range of values from a spreadsheet. The caller must specify the spreadsheet ID and a range.
|
|
6448
|
+
* @example
|
|
6449
|
+
* ```js
|
|
6450
|
+
* // Before running the sample:
|
|
6451
|
+
* // - Enable the API at:
|
|
6452
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6453
|
+
* // - Login into gcloud by running:
|
|
6454
|
+
* // ```sh
|
|
6455
|
+
* // $ gcloud auth application-default login
|
|
6456
|
+
* // ```
|
|
6457
|
+
* // - Install the npm module by running:
|
|
6458
|
+
* // ```sh
|
|
6459
|
+
* // $ npm install googleapis
|
|
6460
|
+
* // ```
|
|
6461
|
+
*
|
|
6462
|
+
* const {google} = require('googleapis');
|
|
6463
|
+
* const sheets = google.sheets('v4');
|
|
6464
|
+
*
|
|
6465
|
+
* async function main() {
|
|
6466
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6467
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6468
|
+
* scopes: [
|
|
6469
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6470
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6471
|
+
* 'https://www.googleapis.com/auth/drive.readonly',
|
|
6472
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6473
|
+
* 'https://www.googleapis.com/auth/spreadsheets.readonly',
|
|
6474
|
+
* ],
|
|
6475
|
+
* });
|
|
6476
|
+
*
|
|
6477
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6478
|
+
* const authClient = await auth.getClient();
|
|
6479
|
+
* google.options({auth: authClient});
|
|
6480
|
+
*
|
|
6481
|
+
* // Do the magic
|
|
6482
|
+
* const res = await sheets.spreadsheets.values.get({
|
|
6483
|
+
* // 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.
|
|
6484
|
+
* dateTimeRenderOption: 'placeholder-value',
|
|
6485
|
+
* // 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]]`.
|
|
6486
|
+
* majorDimension: 'placeholder-value',
|
|
6487
|
+
* // The [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the range to retrieve values from.
|
|
6488
|
+
* range: 'placeholder-value',
|
|
6489
|
+
* // The ID of the spreadsheet to retrieve data from.
|
|
6490
|
+
* spreadsheetId: 'placeholder-value',
|
|
6491
|
+
* // How values should be represented in the output. The default render option is FORMATTED_VALUE.
|
|
6492
|
+
* valueRenderOption: 'placeholder-value',
|
|
6493
|
+
* });
|
|
6494
|
+
* console.log(res.data);
|
|
6495
|
+
*
|
|
6496
|
+
* // Example response
|
|
6497
|
+
* // {
|
|
6498
|
+
* // "majorDimension": "my_majorDimension",
|
|
6499
|
+
* // "range": "my_range",
|
|
6500
|
+
* // "values": []
|
|
6501
|
+
* // }
|
|
6502
|
+
* }
|
|
6503
|
+
*
|
|
6504
|
+
* main().catch(e => {
|
|
6505
|
+
* console.error(e);
|
|
6506
|
+
* throw e;
|
|
6507
|
+
* });
|
|
6508
|
+
*
|
|
6509
|
+
* ```
|
|
5421
6510
|
*
|
|
5422
6511
|
* @param params - Parameters for request
|
|
5423
6512
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5432,6 +6521,81 @@ export declare namespace sheets_v4 {
|
|
|
5432
6521
|
get(callback: BodyResponseCallback<Schema$ValueRange>): void;
|
|
5433
6522
|
/**
|
|
5434
6523
|
* Sets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a valueInputOption.
|
|
6524
|
+
* @example
|
|
6525
|
+
* ```js
|
|
6526
|
+
* // Before running the sample:
|
|
6527
|
+
* // - Enable the API at:
|
|
6528
|
+
* // https://console.developers.google.com/apis/api/sheets.googleapis.com
|
|
6529
|
+
* // - Login into gcloud by running:
|
|
6530
|
+
* // ```sh
|
|
6531
|
+
* // $ gcloud auth application-default login
|
|
6532
|
+
* // ```
|
|
6533
|
+
* // - Install the npm module by running:
|
|
6534
|
+
* // ```sh
|
|
6535
|
+
* // $ npm install googleapis
|
|
6536
|
+
* // ```
|
|
6537
|
+
*
|
|
6538
|
+
* const {google} = require('googleapis');
|
|
6539
|
+
* const sheets = google.sheets('v4');
|
|
6540
|
+
*
|
|
6541
|
+
* async function main() {
|
|
6542
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6543
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6544
|
+
* scopes: [
|
|
6545
|
+
* 'https://www.googleapis.com/auth/drive',
|
|
6546
|
+
* 'https://www.googleapis.com/auth/drive.file',
|
|
6547
|
+
* 'https://www.googleapis.com/auth/spreadsheets',
|
|
6548
|
+
* ],
|
|
6549
|
+
* });
|
|
6550
|
+
*
|
|
6551
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6552
|
+
* const authClient = await auth.getClient();
|
|
6553
|
+
* google.options({auth: authClient});
|
|
6554
|
+
*
|
|
6555
|
+
* // Do the magic
|
|
6556
|
+
* const res = await sheets.spreadsheets.values.update({
|
|
6557
|
+
* // 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).
|
|
6558
|
+
* includeValuesInResponse: 'placeholder-value',
|
|
6559
|
+
* // The [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to update.
|
|
6560
|
+
* range: 'placeholder-value',
|
|
6561
|
+
* // 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.
|
|
6562
|
+
* responseDateTimeRenderOption: 'placeholder-value',
|
|
6563
|
+
* // Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
|
|
6564
|
+
* responseValueRenderOption: 'placeholder-value',
|
|
6565
|
+
* // The ID of the spreadsheet to update.
|
|
6566
|
+
* spreadsheetId: 'placeholder-value',
|
|
6567
|
+
* // How the input data should be interpreted.
|
|
6568
|
+
* valueInputOption: 'placeholder-value',
|
|
6569
|
+
*
|
|
6570
|
+
* // Request body metadata
|
|
6571
|
+
* requestBody: {
|
|
6572
|
+
* // request body parameters
|
|
6573
|
+
* // {
|
|
6574
|
+
* // "majorDimension": "my_majorDimension",
|
|
6575
|
+
* // "range": "my_range",
|
|
6576
|
+
* // "values": []
|
|
6577
|
+
* // }
|
|
6578
|
+
* },
|
|
6579
|
+
* });
|
|
6580
|
+
* console.log(res.data);
|
|
6581
|
+
*
|
|
6582
|
+
* // Example response
|
|
6583
|
+
* // {
|
|
6584
|
+
* // "spreadsheetId": "my_spreadsheetId",
|
|
6585
|
+
* // "updatedCells": 0,
|
|
6586
|
+
* // "updatedColumns": 0,
|
|
6587
|
+
* // "updatedData": {},
|
|
6588
|
+
* // "updatedRange": "my_updatedRange",
|
|
6589
|
+
* // "updatedRows": 0
|
|
6590
|
+
* // }
|
|
6591
|
+
* }
|
|
6592
|
+
*
|
|
6593
|
+
* main().catch(e => {
|
|
6594
|
+
* console.error(e);
|
|
6595
|
+
* throw e;
|
|
6596
|
+
* });
|
|
6597
|
+
*
|
|
6598
|
+
* ```
|
|
5435
6599
|
*
|
|
5436
6600
|
* @param params - Parameters for request
|
|
5437
6601
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|