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