@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/v4.ts CHANGED
@@ -312,6 +312,15 @@ export namespace sheets_v4 {
312
312
  */
313
313
  table?: Schema$Table;
314
314
  }
315
+ /**
316
+ * The result of adding a table.
317
+ */
318
+ export interface Schema$AddTableResponse {
319
+ /**
320
+ * Output only. The table that was added.
321
+ */
322
+ table?: Schema$Table;
323
+ }
315
324
  /**
316
325
  * Adds new cells after the last row with data in a sheet, inserting new rows into the sheet if necessary.
317
326
  */
@@ -402,9 +411,13 @@ export namespace sheets_v4 {
402
411
  */
403
412
  export interface Schema$BandedRange {
404
413
  /**
405
- * The ID of the banded range.
414
+ * The ID of the banded range. If unset, refer to banded_range_reference.
406
415
  */
407
416
  bandedRangeId?: number | null;
417
+ /**
418
+ * Output only. The reference of the banded range, used to identify the ID that is not supported by the banded_range_id.
419
+ */
420
+ bandedRangeReference?: string | null;
408
421
  /**
409
422
  * Properties for column bands. These properties are applied on a column- by-column basis throughout all the columns in the range. At least one of row_properties or column_properties must be specified.
410
423
  */
@@ -1170,6 +1183,10 @@ export namespace sheets_v4 {
1170
1183
  * Data about a specific cell.
1171
1184
  */
1172
1185
  export interface Schema$CellData {
1186
+ /**
1187
+ * Optional. Runs of chips applied to subsections of the cell. Properties of a run start at a specific index in the text and continue until the next run. When reading, all chipped and non-chipped runs are included. Non-chipped runs will have an empty Chip. When writing, only runs with chips are included. Runs containing chips are of length 1 and are represented in the user-entered text by an “@” placeholder symbol. New runs will overwrite any prior runs. Writing a new user_entered_value will erase previous runs.
1188
+ */
1189
+ chipRuns?: Schema$ChipRun[];
1173
1190
  /**
1174
1191
  * Output only. Information about a data source formula on the cell. The field is set if user_entered_value is a formula referencing some DATA_SOURCE sheet, e.g. `=SUM(DataSheet!Column)`.
1175
1192
  */
@@ -1472,6 +1489,32 @@ export namespace sheets_v4 {
1472
1489
  */
1473
1490
  waterfallChart?: Schema$WaterfallChartSpec;
1474
1491
  }
1492
+ /**
1493
+ * The Smart Chip.
1494
+ */
1495
+ export interface Schema$Chip {
1496
+ /**
1497
+ * Properties of a linked person.
1498
+ */
1499
+ personProperties?: Schema$PersonProperties;
1500
+ /**
1501
+ * Properties of a rich link.
1502
+ */
1503
+ richLinkProperties?: Schema$RichLinkProperties;
1504
+ }
1505
+ /**
1506
+ * The run of a chip. The chip continues until the start index of the next run.
1507
+ */
1508
+ export interface Schema$ChipRun {
1509
+ /**
1510
+ * Optional. The chip of this run.
1511
+ */
1512
+ chip?: Schema$Chip;
1513
+ /**
1514
+ * Required. The zero-based character index where this run starts, in UTF-16 code units.
1515
+ */
1516
+ startIndex?: number | null;
1517
+ }
1475
1518
  /**
1476
1519
  * Clears the basic filter, if any exists on the sheet.
1477
1520
  */
@@ -3146,6 +3189,19 @@ export namespace sheets_v4 {
3146
3189
  */
3147
3190
  type?: string | null;
3148
3191
  }
3192
+ /**
3193
+ * Properties specific to a linked person.
3194
+ */
3195
+ export interface Schema$PersonProperties {
3196
+ /**
3197
+ * Optional. The display format of the person chip. If not set, the default display format is used.
3198
+ */
3199
+ displayFormat?: string | null;
3200
+ /**
3201
+ * Required. The email address linked to this person. This field is always present.
3202
+ */
3203
+ email?: string | null;
3204
+ }
3149
3205
  /**
3150
3206
  * A pie chart.
3151
3207
  */
@@ -3833,6 +3889,10 @@ export namespace sheets_v4 {
3833
3889
  * A reply from adding a slicer.
3834
3890
  */
3835
3891
  addSlicer?: Schema$AddSlicerResponse;
3892
+ /**
3893
+ * A reply from adding a table.
3894
+ */
3895
+ addTable?: Schema$AddTableResponse;
3836
3896
  /**
3837
3897
  * A reply from cancelling data source object refreshes.
3838
3898
  */
@@ -3894,6 +3954,19 @@ export namespace sheets_v4 {
3894
3954
  */
3895
3955
  updateEmbeddedObjectPosition?: Schema$UpdateEmbeddedObjectPositionResponse;
3896
3956
  }
3957
+ /**
3958
+ * Properties of a link to a Google resource (such as a file in Drive, a YouTube video, a Maps address, or a Calendar event). Only Drive files can be written as chips. All other rich link types are read only. URIs cannot exceed 2000 bytes when writing. NOTE: Writing Drive file chips requires at least one of the `drive.file`, `drive.readonly`, or `drive` OAuth scopes.
3959
+ */
3960
+ export interface Schema$RichLinkProperties {
3961
+ /**
3962
+ * Output only. The [MIME type](https://developers.google.com/drive/api/v3/mime-types) of the link, if there's one (for example, when it's a file in Drive).
3963
+ */
3964
+ mimeType?: string | null;
3965
+ /**
3966
+ * Required. The URI to the link. This is always present.
3967
+ */
3968
+ uri?: string | null;
3969
+ }
3897
3970
  /**
3898
3971
  * Data about each cell in a row.
3899
3972
  */
@@ -5173,6 +5246,69 @@ export namespace sheets_v4 {
5173
5246
 
5174
5247
  /**
5175
5248
  * Applies one or more updates to the spreadsheet. Each request is validated before being applied. If any request is not valid then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. The replies will mirror the requests. For example, if you applied 4 updates and the 3rd one had a reply, then the response will have 2 empty replies, the actual reply, and another empty reply, in that order. Due to the collaborative nature of spreadsheets, it is not guaranteed that the spreadsheet will reflect exactly your changes after this completes, however it is guaranteed that the updates in the request will be applied together atomically. Your changes may be altered with respect to collaborator changes. If there are no collaborators, the spreadsheet should reflect your changes.
5249
+ * @example
5250
+ * ```js
5251
+ * // Before running the sample:
5252
+ * // - Enable the API at:
5253
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
5254
+ * // - Login into gcloud by running:
5255
+ * // ```sh
5256
+ * // $ gcloud auth application-default login
5257
+ * // ```
5258
+ * // - Install the npm module by running:
5259
+ * // ```sh
5260
+ * // $ npm install googleapis
5261
+ * // ```
5262
+ *
5263
+ * const {google} = require('googleapis');
5264
+ * const sheets = google.sheets('v4');
5265
+ *
5266
+ * async function main() {
5267
+ * const auth = new google.auth.GoogleAuth({
5268
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5269
+ * scopes: [
5270
+ * 'https://www.googleapis.com/auth/drive',
5271
+ * 'https://www.googleapis.com/auth/drive.file',
5272
+ * 'https://www.googleapis.com/auth/spreadsheets',
5273
+ * ],
5274
+ * });
5275
+ *
5276
+ * // Acquire an auth client, and bind it to all future calls
5277
+ * const authClient = await auth.getClient();
5278
+ * google.options({auth: authClient});
5279
+ *
5280
+ * // Do the magic
5281
+ * const res = await sheets.spreadsheets.batchUpdate({
5282
+ * // The spreadsheet to apply the updates to.
5283
+ * spreadsheetId: 'placeholder-value',
5284
+ *
5285
+ * // Request body metadata
5286
+ * requestBody: {
5287
+ * // request body parameters
5288
+ * // {
5289
+ * // "includeSpreadsheetInResponse": false,
5290
+ * // "requests": [],
5291
+ * // "responseIncludeGridData": false,
5292
+ * // "responseRanges": []
5293
+ * // }
5294
+ * },
5295
+ * });
5296
+ * console.log(res.data);
5297
+ *
5298
+ * // Example response
5299
+ * // {
5300
+ * // "replies": [],
5301
+ * // "spreadsheetId": "my_spreadsheetId",
5302
+ * // "updatedSpreadsheet": {}
5303
+ * // }
5304
+ * }
5305
+ *
5306
+ * main().catch(e => {
5307
+ * console.error(e);
5308
+ * throw e;
5309
+ * });
5310
+ *
5311
+ * ```
5176
5312
  *
5177
5313
  * @param params - Parameters for request
5178
5314
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5269,6 +5405,75 @@ export namespace sheets_v4 {
5269
5405
 
5270
5406
  /**
5271
5407
  * Creates a spreadsheet, returning the newly created spreadsheet.
5408
+ * @example
5409
+ * ```js
5410
+ * // Before running the sample:
5411
+ * // - Enable the API at:
5412
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
5413
+ * // - Login into gcloud by running:
5414
+ * // ```sh
5415
+ * // $ gcloud auth application-default login
5416
+ * // ```
5417
+ * // - Install the npm module by running:
5418
+ * // ```sh
5419
+ * // $ npm install googleapis
5420
+ * // ```
5421
+ *
5422
+ * const {google} = require('googleapis');
5423
+ * const sheets = google.sheets('v4');
5424
+ *
5425
+ * async function main() {
5426
+ * const auth = new google.auth.GoogleAuth({
5427
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5428
+ * scopes: [
5429
+ * 'https://www.googleapis.com/auth/drive',
5430
+ * 'https://www.googleapis.com/auth/drive.file',
5431
+ * 'https://www.googleapis.com/auth/spreadsheets',
5432
+ * ],
5433
+ * });
5434
+ *
5435
+ * // Acquire an auth client, and bind it to all future calls
5436
+ * const authClient = await auth.getClient();
5437
+ * google.options({auth: authClient});
5438
+ *
5439
+ * // Do the magic
5440
+ * const res = await sheets.spreadsheets.create({
5441
+ * // Request body metadata
5442
+ * requestBody: {
5443
+ * // request body parameters
5444
+ * // {
5445
+ * // "dataSourceSchedules": [],
5446
+ * // "dataSources": [],
5447
+ * // "developerMetadata": [],
5448
+ * // "namedRanges": [],
5449
+ * // "properties": {},
5450
+ * // "sheets": [],
5451
+ * // "spreadsheetId": "my_spreadsheetId",
5452
+ * // "spreadsheetUrl": "my_spreadsheetUrl"
5453
+ * // }
5454
+ * },
5455
+ * });
5456
+ * console.log(res.data);
5457
+ *
5458
+ * // Example response
5459
+ * // {
5460
+ * // "dataSourceSchedules": [],
5461
+ * // "dataSources": [],
5462
+ * // "developerMetadata": [],
5463
+ * // "namedRanges": [],
5464
+ * // "properties": {},
5465
+ * // "sheets": [],
5466
+ * // "spreadsheetId": "my_spreadsheetId",
5467
+ * // "spreadsheetUrl": "my_spreadsheetUrl"
5468
+ * // }
5469
+ * }
5470
+ *
5471
+ * main().catch(e => {
5472
+ * console.error(e);
5473
+ * throw e;
5474
+ * });
5475
+ *
5476
+ * ```
5272
5477
  *
5273
5478
  * @param params - Parameters for request
5274
5479
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5357,6 +5562,71 @@ export namespace sheets_v4 {
5357
5562
 
5358
5563
  /**
5359
5564
  * Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. By default, data within grids is not returned. You can include grid data in one of 2 ways: * Specify a [field mask](https://developers.google.com/workspace/sheets/api/guides/field-masks) listing your desired fields using the `fields` URL parameter in HTTP * Set the includeGridData URL parameter to true. If a field mask is set, the `includeGridData` parameter is ignored For large spreadsheets, as a best practice, retrieve only the specific spreadsheet fields that you want. To retrieve only subsets of spreadsheet data, use the ranges URL parameter. Ranges are specified using [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell). You can define a single cell (for example, `A1`) or multiple cells (for example, `A1:D5`). You can also get cells from other sheets within the same spreadsheet (for example, `Sheet2!A1:C4`) or retrieve multiple ranges at once (for example, `?ranges=A1:D5&ranges=Sheet2!A1:C4`). Limiting the range returns only the portions of the spreadsheet that intersect the requested ranges.
5565
+ * @example
5566
+ * ```js
5567
+ * // Before running the sample:
5568
+ * // - Enable the API at:
5569
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
5570
+ * // - Login into gcloud by running:
5571
+ * // ```sh
5572
+ * // $ gcloud auth application-default login
5573
+ * // ```
5574
+ * // - Install the npm module by running:
5575
+ * // ```sh
5576
+ * // $ npm install googleapis
5577
+ * // ```
5578
+ *
5579
+ * const {google} = require('googleapis');
5580
+ * const sheets = google.sheets('v4');
5581
+ *
5582
+ * async function main() {
5583
+ * const auth = new google.auth.GoogleAuth({
5584
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5585
+ * scopes: [
5586
+ * 'https://www.googleapis.com/auth/drive',
5587
+ * 'https://www.googleapis.com/auth/drive.file',
5588
+ * 'https://www.googleapis.com/auth/drive.readonly',
5589
+ * 'https://www.googleapis.com/auth/spreadsheets',
5590
+ * 'https://www.googleapis.com/auth/spreadsheets.readonly',
5591
+ * ],
5592
+ * });
5593
+ *
5594
+ * // Acquire an auth client, and bind it to all future calls
5595
+ * const authClient = await auth.getClient();
5596
+ * google.options({auth: authClient});
5597
+ *
5598
+ * // Do the magic
5599
+ * const res = await sheets.spreadsheets.get({
5600
+ * // True if tables should be excluded in the banded ranges. False if not set.
5601
+ * excludeTablesInBandedRanges: 'placeholder-value',
5602
+ * // True if grid data should be returned. This parameter is ignored if a field mask was set in the request.
5603
+ * includeGridData: 'placeholder-value',
5604
+ * // The ranges to retrieve from the spreadsheet.
5605
+ * ranges: 'placeholder-value',
5606
+ * // The spreadsheet to request.
5607
+ * spreadsheetId: 'placeholder-value',
5608
+ * });
5609
+ * console.log(res.data);
5610
+ *
5611
+ * // Example response
5612
+ * // {
5613
+ * // "dataSourceSchedules": [],
5614
+ * // "dataSources": [],
5615
+ * // "developerMetadata": [],
5616
+ * // "namedRanges": [],
5617
+ * // "properties": {},
5618
+ * // "sheets": [],
5619
+ * // "spreadsheetId": "my_spreadsheetId",
5620
+ * // "spreadsheetUrl": "my_spreadsheetUrl"
5621
+ * // }
5622
+ * }
5623
+ *
5624
+ * main().catch(e => {
5625
+ * console.error(e);
5626
+ * throw e;
5627
+ * });
5628
+ *
5629
+ * ```
5360
5630
  *
5361
5631
  * @param params - Parameters for request
5362
5632
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5447,6 +5717,73 @@ export namespace sheets_v4 {
5447
5717
 
5448
5718
  /**
5449
5719
  * Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. This method differs from GetSpreadsheet in that it allows selecting which subsets of spreadsheet data to return by specifying a dataFilters parameter. Multiple DataFilters can be specified. Specifying one or more data filters returns the portions of the spreadsheet that intersect ranges matched by any of the filters. By default, data within grids is not returned. You can include grid data one of 2 ways: * Specify a [field mask](https://developers.google.com/workspace/sheets/api/guides/field-masks) listing your desired fields using the `fields` URL parameter in HTTP * Set the includeGridData parameter to true. If a field mask is set, the `includeGridData` parameter is ignored For large spreadsheets, as a best practice, retrieve only the specific spreadsheet fields that you want.
5720
+ * @example
5721
+ * ```js
5722
+ * // Before running the sample:
5723
+ * // - Enable the API at:
5724
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
5725
+ * // - Login into gcloud by running:
5726
+ * // ```sh
5727
+ * // $ gcloud auth application-default login
5728
+ * // ```
5729
+ * // - Install the npm module by running:
5730
+ * // ```sh
5731
+ * // $ npm install googleapis
5732
+ * // ```
5733
+ *
5734
+ * const {google} = require('googleapis');
5735
+ * const sheets = google.sheets('v4');
5736
+ *
5737
+ * async function main() {
5738
+ * const auth = new google.auth.GoogleAuth({
5739
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5740
+ * scopes: [
5741
+ * 'https://www.googleapis.com/auth/drive',
5742
+ * 'https://www.googleapis.com/auth/drive.file',
5743
+ * 'https://www.googleapis.com/auth/spreadsheets',
5744
+ * ],
5745
+ * });
5746
+ *
5747
+ * // Acquire an auth client, and bind it to all future calls
5748
+ * const authClient = await auth.getClient();
5749
+ * google.options({auth: authClient});
5750
+ *
5751
+ * // Do the magic
5752
+ * const res = await sheets.spreadsheets.getByDataFilter({
5753
+ * // The spreadsheet to request.
5754
+ * spreadsheetId: 'placeholder-value',
5755
+ *
5756
+ * // Request body metadata
5757
+ * requestBody: {
5758
+ * // request body parameters
5759
+ * // {
5760
+ * // "dataFilters": [],
5761
+ * // "excludeTablesInBandedRanges": false,
5762
+ * // "includeGridData": false
5763
+ * // }
5764
+ * },
5765
+ * });
5766
+ * console.log(res.data);
5767
+ *
5768
+ * // Example response
5769
+ * // {
5770
+ * // "dataSourceSchedules": [],
5771
+ * // "dataSources": [],
5772
+ * // "developerMetadata": [],
5773
+ * // "namedRanges": [],
5774
+ * // "properties": {},
5775
+ * // "sheets": [],
5776
+ * // "spreadsheetId": "my_spreadsheetId",
5777
+ * // "spreadsheetUrl": "my_spreadsheetUrl"
5778
+ * // }
5779
+ * }
5780
+ *
5781
+ * main().catch(e => {
5782
+ * console.error(e);
5783
+ * throw e;
5784
+ * });
5785
+ *
5786
+ * ```
5450
5787
  *
5451
5788
  * @param params - Parameters for request
5452
5789
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5594,6 +5931,62 @@ export namespace sheets_v4 {
5594
5931
 
5595
5932
  /**
5596
5933
  * Returns the developer metadata with the specified ID. The caller must specify the spreadsheet ID and the developer metadata's unique metadataId.
5934
+ * @example
5935
+ * ```js
5936
+ * // Before running the sample:
5937
+ * // - Enable the API at:
5938
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
5939
+ * // - Login into gcloud by running:
5940
+ * // ```sh
5941
+ * // $ gcloud auth application-default login
5942
+ * // ```
5943
+ * // - Install the npm module by running:
5944
+ * // ```sh
5945
+ * // $ npm install googleapis
5946
+ * // ```
5947
+ *
5948
+ * const {google} = require('googleapis');
5949
+ * const sheets = google.sheets('v4');
5950
+ *
5951
+ * async function main() {
5952
+ * const auth = new google.auth.GoogleAuth({
5953
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5954
+ * scopes: [
5955
+ * 'https://www.googleapis.com/auth/drive',
5956
+ * 'https://www.googleapis.com/auth/drive.file',
5957
+ * 'https://www.googleapis.com/auth/spreadsheets',
5958
+ * ],
5959
+ * });
5960
+ *
5961
+ * // Acquire an auth client, and bind it to all future calls
5962
+ * const authClient = await auth.getClient();
5963
+ * google.options({auth: authClient});
5964
+ *
5965
+ * // Do the magic
5966
+ * const res = await sheets.spreadsheets.developerMetadata.get({
5967
+ * // The ID of the developer metadata to retrieve.
5968
+ * metadataId: 'placeholder-value',
5969
+ * // The ID of the spreadsheet to retrieve metadata from.
5970
+ * spreadsheetId: 'placeholder-value',
5971
+ * });
5972
+ * console.log(res.data);
5973
+ *
5974
+ * // Example response
5975
+ * // {
5976
+ * // "location": {},
5977
+ * // "metadataId": 0,
5978
+ * // "metadataKey": "my_metadataKey",
5979
+ * // "metadataValue": "my_metadataValue",
5980
+ * // "visibility": "my_visibility"
5981
+ * // }
5982
+ * }
5983
+ *
5984
+ * main().catch(e => {
5985
+ * console.error(e);
5986
+ * throw e;
5987
+ * });
5988
+ *
5989
+ * ```
5597
5990
  *
5598
5991
  * @param params - Parameters for request
5599
5992
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5685,6 +6078,64 @@ export namespace sheets_v4 {
5685
6078
 
5686
6079
  /**
5687
6080
  * Returns all developer metadata matching the specified DataFilter. If the provided DataFilter represents a DeveloperMetadataLookup object, this will return all DeveloperMetadata entries selected by it. If the DataFilter represents a location in a spreadsheet, this will return all developer metadata associated with locations intersecting that region.
6081
+ * @example
6082
+ * ```js
6083
+ * // Before running the sample:
6084
+ * // - Enable the API at:
6085
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
6086
+ * // - Login into gcloud by running:
6087
+ * // ```sh
6088
+ * // $ gcloud auth application-default login
6089
+ * // ```
6090
+ * // - Install the npm module by running:
6091
+ * // ```sh
6092
+ * // $ npm install googleapis
6093
+ * // ```
6094
+ *
6095
+ * const {google} = require('googleapis');
6096
+ * const sheets = google.sheets('v4');
6097
+ *
6098
+ * async function main() {
6099
+ * const auth = new google.auth.GoogleAuth({
6100
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6101
+ * scopes: [
6102
+ * 'https://www.googleapis.com/auth/drive',
6103
+ * 'https://www.googleapis.com/auth/drive.file',
6104
+ * 'https://www.googleapis.com/auth/spreadsheets',
6105
+ * ],
6106
+ * });
6107
+ *
6108
+ * // Acquire an auth client, and bind it to all future calls
6109
+ * const authClient = await auth.getClient();
6110
+ * google.options({auth: authClient});
6111
+ *
6112
+ * // Do the magic
6113
+ * const res = await sheets.spreadsheets.developerMetadata.search({
6114
+ * // The ID of the spreadsheet to retrieve metadata from.
6115
+ * spreadsheetId: 'placeholder-value',
6116
+ *
6117
+ * // Request body metadata
6118
+ * requestBody: {
6119
+ * // request body parameters
6120
+ * // {
6121
+ * // "dataFilters": []
6122
+ * // }
6123
+ * },
6124
+ * });
6125
+ * console.log(res.data);
6126
+ *
6127
+ * // Example response
6128
+ * // {
6129
+ * // "matchedDeveloperMetadata": []
6130
+ * // }
6131
+ * }
6132
+ *
6133
+ * main().catch(e => {
6134
+ * console.error(e);
6135
+ * throw e;
6136
+ * });
6137
+ *
6138
+ * ```
5688
6139
  *
5689
6140
  * @param params - Parameters for request
5690
6141
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5813,6 +6264,75 @@ export namespace sheets_v4 {
5813
6264
 
5814
6265
  /**
5815
6266
  * Copies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.
6267
+ * @example
6268
+ * ```js
6269
+ * // Before running the sample:
6270
+ * // - Enable the API at:
6271
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
6272
+ * // - Login into gcloud by running:
6273
+ * // ```sh
6274
+ * // $ gcloud auth application-default login
6275
+ * // ```
6276
+ * // - Install the npm module by running:
6277
+ * // ```sh
6278
+ * // $ npm install googleapis
6279
+ * // ```
6280
+ *
6281
+ * const {google} = require('googleapis');
6282
+ * const sheets = google.sheets('v4');
6283
+ *
6284
+ * async function main() {
6285
+ * const auth = new google.auth.GoogleAuth({
6286
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6287
+ * scopes: [
6288
+ * 'https://www.googleapis.com/auth/drive',
6289
+ * 'https://www.googleapis.com/auth/drive.file',
6290
+ * 'https://www.googleapis.com/auth/spreadsheets',
6291
+ * ],
6292
+ * });
6293
+ *
6294
+ * // Acquire an auth client, and bind it to all future calls
6295
+ * const authClient = await auth.getClient();
6296
+ * google.options({auth: authClient});
6297
+ *
6298
+ * // Do the magic
6299
+ * const res = await sheets.spreadsheets.sheets.copyTo({
6300
+ * // The ID of the sheet to copy.
6301
+ * sheetId: 'placeholder-value',
6302
+ * // The ID of the spreadsheet containing the sheet to copy.
6303
+ * spreadsheetId: 'placeholder-value',
6304
+ *
6305
+ * // Request body metadata
6306
+ * requestBody: {
6307
+ * // request body parameters
6308
+ * // {
6309
+ * // "destinationSpreadsheetId": "my_destinationSpreadsheetId"
6310
+ * // }
6311
+ * },
6312
+ * });
6313
+ * console.log(res.data);
6314
+ *
6315
+ * // Example response
6316
+ * // {
6317
+ * // "dataSourceSheetProperties": {},
6318
+ * // "gridProperties": {},
6319
+ * // "hidden": false,
6320
+ * // "index": 0,
6321
+ * // "rightToLeft": false,
6322
+ * // "sheetId": 0,
6323
+ * // "sheetType": "my_sheetType",
6324
+ * // "tabColor": {},
6325
+ * // "tabColorStyle": {},
6326
+ * // "title": "my_title"
6327
+ * // }
6328
+ * }
6329
+ *
6330
+ * main().catch(e => {
6331
+ * console.error(e);
6332
+ * throw e;
6333
+ * });
6334
+ *
6335
+ * ```
5816
6336
  *
5817
6337
  * @param params - Parameters for request
5818
6338
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5928,6 +6448,80 @@ export namespace sheets_v4 {
5928
6448
 
5929
6449
  /**
5930
6450
  * Appends values to a spreadsheet. The input range is used to search for existing data and find a "table" within that range. Values will be appended to the next row of the table, starting with the first column of the table. See the [guide](https://developers.google.com/workspace/sheets/api/guides/values#appending_values) and [sample code](https://developers.google.com/workspace/sheets/api/samples/writing#append_values) for specific details of how tables are detected and data is appended. The caller must specify the spreadsheet ID, range, and a valueInputOption. The `valueInputOption` only controls how the input data will be added to the sheet (column-wise or row-wise), it does not influence what cell the data starts being written to.
6451
+ * @example
6452
+ * ```js
6453
+ * // Before running the sample:
6454
+ * // - Enable the API at:
6455
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
6456
+ * // - Login into gcloud by running:
6457
+ * // ```sh
6458
+ * // $ gcloud auth application-default login
6459
+ * // ```
6460
+ * // - Install the npm module by running:
6461
+ * // ```sh
6462
+ * // $ npm install googleapis
6463
+ * // ```
6464
+ *
6465
+ * const {google} = require('googleapis');
6466
+ * const sheets = google.sheets('v4');
6467
+ *
6468
+ * async function main() {
6469
+ * const auth = new google.auth.GoogleAuth({
6470
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6471
+ * scopes: [
6472
+ * 'https://www.googleapis.com/auth/drive',
6473
+ * 'https://www.googleapis.com/auth/drive.file',
6474
+ * 'https://www.googleapis.com/auth/spreadsheets',
6475
+ * ],
6476
+ * });
6477
+ *
6478
+ * // Acquire an auth client, and bind it to all future calls
6479
+ * const authClient = await auth.getClient();
6480
+ * google.options({auth: authClient});
6481
+ *
6482
+ * // Do the magic
6483
+ * const res = await sheets.spreadsheets.values.append({
6484
+ * // Determines if the update response should include the values of the cells that were appended. By default, responses do not include the updated values.
6485
+ * includeValuesInResponse: 'placeholder-value',
6486
+ * // How the input data should be inserted.
6487
+ * insertDataOption: 'placeholder-value',
6488
+ * // The [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of a range to search for a logical table of data. Values are appended after the last row of the table.
6489
+ * range: 'placeholder-value',
6490
+ * // Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
6491
+ * responseDateTimeRenderOption: 'placeholder-value',
6492
+ * // Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
6493
+ * responseValueRenderOption: 'placeholder-value',
6494
+ * // The ID of the spreadsheet to update.
6495
+ * spreadsheetId: 'placeholder-value',
6496
+ * // How the input data should be interpreted.
6497
+ * valueInputOption: 'placeholder-value',
6498
+ *
6499
+ * // Request body metadata
6500
+ * requestBody: {
6501
+ * // request body parameters
6502
+ * // {
6503
+ * // "majorDimension": "my_majorDimension",
6504
+ * // "range": "my_range",
6505
+ * // "values": []
6506
+ * // }
6507
+ * },
6508
+ * });
6509
+ * console.log(res.data);
6510
+ *
6511
+ * // Example response
6512
+ * // {
6513
+ * // "spreadsheetId": "my_spreadsheetId",
6514
+ * // "tableRange": "my_tableRange",
6515
+ * // "updates": {}
6516
+ * // }
6517
+ * }
6518
+ *
6519
+ * main().catch(e => {
6520
+ * console.error(e);
6521
+ * throw e;
6522
+ * });
6523
+ *
6524
+ * ```
5931
6525
  *
5932
6526
  * @param params - Parameters for request
5933
6527
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6020,6 +6614,65 @@ export namespace sheets_v4 {
6020
6614
 
6021
6615
  /**
6022
6616
  * Clears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges. Only values are cleared -- all other properties of the cell (such as formatting and data validation) are kept.
6617
+ * @example
6618
+ * ```js
6619
+ * // Before running the sample:
6620
+ * // - Enable the API at:
6621
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
6622
+ * // - Login into gcloud by running:
6623
+ * // ```sh
6624
+ * // $ gcloud auth application-default login
6625
+ * // ```
6626
+ * // - Install the npm module by running:
6627
+ * // ```sh
6628
+ * // $ npm install googleapis
6629
+ * // ```
6630
+ *
6631
+ * const {google} = require('googleapis');
6632
+ * const sheets = google.sheets('v4');
6633
+ *
6634
+ * async function main() {
6635
+ * const auth = new google.auth.GoogleAuth({
6636
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6637
+ * scopes: [
6638
+ * 'https://www.googleapis.com/auth/drive',
6639
+ * 'https://www.googleapis.com/auth/drive.file',
6640
+ * 'https://www.googleapis.com/auth/spreadsheets',
6641
+ * ],
6642
+ * });
6643
+ *
6644
+ * // Acquire an auth client, and bind it to all future calls
6645
+ * const authClient = await auth.getClient();
6646
+ * google.options({auth: authClient});
6647
+ *
6648
+ * // Do the magic
6649
+ * const res = await sheets.spreadsheets.values.batchClear({
6650
+ * // The ID of the spreadsheet to update.
6651
+ * spreadsheetId: 'placeholder-value',
6652
+ *
6653
+ * // Request body metadata
6654
+ * requestBody: {
6655
+ * // request body parameters
6656
+ * // {
6657
+ * // "ranges": []
6658
+ * // }
6659
+ * },
6660
+ * });
6661
+ * console.log(res.data);
6662
+ *
6663
+ * // Example response
6664
+ * // {
6665
+ * // "clearedRanges": [],
6666
+ * // "spreadsheetId": "my_spreadsheetId"
6667
+ * // }
6668
+ * }
6669
+ *
6670
+ * main().catch(e => {
6671
+ * console.error(e);
6672
+ * throw e;
6673
+ * });
6674
+ *
6675
+ * ```
6023
6676
  *
6024
6677
  * @param params - Parameters for request
6025
6678
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6114,6 +6767,65 @@ export namespace sheets_v4 {
6114
6767
 
6115
6768
  /**
6116
6769
  * Clears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges matching any of the specified data filters will be cleared. Only values are cleared -- all other properties of the cell (such as formatting, data validation, etc..) are kept.
6770
+ * @example
6771
+ * ```js
6772
+ * // Before running the sample:
6773
+ * // - Enable the API at:
6774
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
6775
+ * // - Login into gcloud by running:
6776
+ * // ```sh
6777
+ * // $ gcloud auth application-default login
6778
+ * // ```
6779
+ * // - Install the npm module by running:
6780
+ * // ```sh
6781
+ * // $ npm install googleapis
6782
+ * // ```
6783
+ *
6784
+ * const {google} = require('googleapis');
6785
+ * const sheets = google.sheets('v4');
6786
+ *
6787
+ * async function main() {
6788
+ * const auth = new google.auth.GoogleAuth({
6789
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6790
+ * scopes: [
6791
+ * 'https://www.googleapis.com/auth/drive',
6792
+ * 'https://www.googleapis.com/auth/drive.file',
6793
+ * 'https://www.googleapis.com/auth/spreadsheets',
6794
+ * ],
6795
+ * });
6796
+ *
6797
+ * // Acquire an auth client, and bind it to all future calls
6798
+ * const authClient = await auth.getClient();
6799
+ * google.options({auth: authClient});
6800
+ *
6801
+ * // Do the magic
6802
+ * const res = await sheets.spreadsheets.values.batchClearByDataFilter({
6803
+ * // The ID of the spreadsheet to update.
6804
+ * spreadsheetId: 'placeholder-value',
6805
+ *
6806
+ * // Request body metadata
6807
+ * requestBody: {
6808
+ * // request body parameters
6809
+ * // {
6810
+ * // "dataFilters": []
6811
+ * // }
6812
+ * },
6813
+ * });
6814
+ * console.log(res.data);
6815
+ *
6816
+ * // Example response
6817
+ * // {
6818
+ * // "clearedRanges": [],
6819
+ * // "spreadsheetId": "my_spreadsheetId"
6820
+ * // }
6821
+ * }
6822
+ *
6823
+ * main().catch(e => {
6824
+ * console.error(e);
6825
+ * throw e;
6826
+ * });
6827
+ *
6828
+ * ```
6117
6829
  *
6118
6830
  * @param params - Parameters for request
6119
6831
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6216,6 +6928,67 @@ export namespace sheets_v4 {
6216
6928
 
6217
6929
  /**
6218
6930
  * Returns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges.
6931
+ * @example
6932
+ * ```js
6933
+ * // Before running the sample:
6934
+ * // - Enable the API at:
6935
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
6936
+ * // - Login into gcloud by running:
6937
+ * // ```sh
6938
+ * // $ gcloud auth application-default login
6939
+ * // ```
6940
+ * // - Install the npm module by running:
6941
+ * // ```sh
6942
+ * // $ npm install googleapis
6943
+ * // ```
6944
+ *
6945
+ * const {google} = require('googleapis');
6946
+ * const sheets = google.sheets('v4');
6947
+ *
6948
+ * async function main() {
6949
+ * const auth = new google.auth.GoogleAuth({
6950
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6951
+ * scopes: [
6952
+ * 'https://www.googleapis.com/auth/drive',
6953
+ * 'https://www.googleapis.com/auth/drive.file',
6954
+ * 'https://www.googleapis.com/auth/drive.readonly',
6955
+ * 'https://www.googleapis.com/auth/spreadsheets',
6956
+ * 'https://www.googleapis.com/auth/spreadsheets.readonly',
6957
+ * ],
6958
+ * });
6959
+ *
6960
+ * // Acquire an auth client, and bind it to all future calls
6961
+ * const authClient = await auth.getClient();
6962
+ * google.options({auth: authClient});
6963
+ *
6964
+ * // Do the magic
6965
+ * const res = await sheets.spreadsheets.values.batchGet({
6966
+ * // How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
6967
+ * dateTimeRenderOption: 'placeholder-value',
6968
+ * // The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `ranges=["A1:B2"],majorDimension=ROWS` returns `[[1,2],[3,4]]`, whereas requesting `ranges=["A1:B2"],majorDimension=COLUMNS` returns `[[1,3],[2,4]]`.
6969
+ * majorDimension: 'placeholder-value',
6970
+ * // The [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the range to retrieve values from.
6971
+ * ranges: 'placeholder-value',
6972
+ * // The ID of the spreadsheet to retrieve data from.
6973
+ * spreadsheetId: 'placeholder-value',
6974
+ * // How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE.
6975
+ * valueRenderOption: 'placeholder-value',
6976
+ * });
6977
+ * console.log(res.data);
6978
+ *
6979
+ * // Example response
6980
+ * // {
6981
+ * // "spreadsheetId": "my_spreadsheetId",
6982
+ * // "valueRanges": []
6983
+ * // }
6984
+ * }
6985
+ *
6986
+ * main().catch(e => {
6987
+ * console.error(e);
6988
+ * throw e;
6989
+ * });
6990
+ *
6991
+ * ```
6219
6992
  *
6220
6993
  * @param params - Parameters for request
6221
6994
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6310,6 +7083,68 @@ export namespace sheets_v4 {
6310
7083
 
6311
7084
  /**
6312
7085
  * Returns one or more ranges of values that match the specified data filters. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges that match any of the data filters in the request will be returned.
7086
+ * @example
7087
+ * ```js
7088
+ * // Before running the sample:
7089
+ * // - Enable the API at:
7090
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
7091
+ * // - Login into gcloud by running:
7092
+ * // ```sh
7093
+ * // $ gcloud auth application-default login
7094
+ * // ```
7095
+ * // - Install the npm module by running:
7096
+ * // ```sh
7097
+ * // $ npm install googleapis
7098
+ * // ```
7099
+ *
7100
+ * const {google} = require('googleapis');
7101
+ * const sheets = google.sheets('v4');
7102
+ *
7103
+ * async function main() {
7104
+ * const auth = new google.auth.GoogleAuth({
7105
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7106
+ * scopes: [
7107
+ * 'https://www.googleapis.com/auth/drive',
7108
+ * 'https://www.googleapis.com/auth/drive.file',
7109
+ * 'https://www.googleapis.com/auth/spreadsheets',
7110
+ * ],
7111
+ * });
7112
+ *
7113
+ * // Acquire an auth client, and bind it to all future calls
7114
+ * const authClient = await auth.getClient();
7115
+ * google.options({auth: authClient});
7116
+ *
7117
+ * // Do the magic
7118
+ * const res = await sheets.spreadsheets.values.batchGetByDataFilter({
7119
+ * // The ID of the spreadsheet to retrieve data from.
7120
+ * spreadsheetId: 'placeholder-value',
7121
+ *
7122
+ * // Request body metadata
7123
+ * requestBody: {
7124
+ * // request body parameters
7125
+ * // {
7126
+ * // "dataFilters": [],
7127
+ * // "dateTimeRenderOption": "my_dateTimeRenderOption",
7128
+ * // "majorDimension": "my_majorDimension",
7129
+ * // "valueRenderOption": "my_valueRenderOption"
7130
+ * // }
7131
+ * },
7132
+ * });
7133
+ * console.log(res.data);
7134
+ *
7135
+ * // Example response
7136
+ * // {
7137
+ * // "spreadsheetId": "my_spreadsheetId",
7138
+ * // "valueRanges": []
7139
+ * // }
7140
+ * }
7141
+ *
7142
+ * main().catch(e => {
7143
+ * console.error(e);
7144
+ * throw e;
7145
+ * });
7146
+ *
7147
+ * ```
6313
7148
  *
6314
7149
  * @param params - Parameters for request
6315
7150
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6411,6 +7246,73 @@ export namespace sheets_v4 {
6411
7246
 
6412
7247
  /**
6413
7248
  * Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.
7249
+ * @example
7250
+ * ```js
7251
+ * // Before running the sample:
7252
+ * // - Enable the API at:
7253
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
7254
+ * // - Login into gcloud by running:
7255
+ * // ```sh
7256
+ * // $ gcloud auth application-default login
7257
+ * // ```
7258
+ * // - Install the npm module by running:
7259
+ * // ```sh
7260
+ * // $ npm install googleapis
7261
+ * // ```
7262
+ *
7263
+ * const {google} = require('googleapis');
7264
+ * const sheets = google.sheets('v4');
7265
+ *
7266
+ * async function main() {
7267
+ * const auth = new google.auth.GoogleAuth({
7268
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7269
+ * scopes: [
7270
+ * 'https://www.googleapis.com/auth/drive',
7271
+ * 'https://www.googleapis.com/auth/drive.file',
7272
+ * 'https://www.googleapis.com/auth/spreadsheets',
7273
+ * ],
7274
+ * });
7275
+ *
7276
+ * // Acquire an auth client, and bind it to all future calls
7277
+ * const authClient = await auth.getClient();
7278
+ * google.options({auth: authClient});
7279
+ *
7280
+ * // Do the magic
7281
+ * const res = await sheets.spreadsheets.values.batchUpdate({
7282
+ * // The ID of the spreadsheet to update.
7283
+ * spreadsheetId: 'placeholder-value',
7284
+ *
7285
+ * // Request body metadata
7286
+ * requestBody: {
7287
+ * // request body parameters
7288
+ * // {
7289
+ * // "data": [],
7290
+ * // "includeValuesInResponse": false,
7291
+ * // "responseDateTimeRenderOption": "my_responseDateTimeRenderOption",
7292
+ * // "responseValueRenderOption": "my_responseValueRenderOption",
7293
+ * // "valueInputOption": "my_valueInputOption"
7294
+ * // }
7295
+ * },
7296
+ * });
7297
+ * console.log(res.data);
7298
+ *
7299
+ * // Example response
7300
+ * // {
7301
+ * // "responses": [],
7302
+ * // "spreadsheetId": "my_spreadsheetId",
7303
+ * // "totalUpdatedCells": 0,
7304
+ * // "totalUpdatedColumns": 0,
7305
+ * // "totalUpdatedRows": 0,
7306
+ * // "totalUpdatedSheets": 0
7307
+ * // }
7308
+ * }
7309
+ *
7310
+ * main().catch(e => {
7311
+ * console.error(e);
7312
+ * throw e;
7313
+ * });
7314
+ *
7315
+ * ```
6414
7316
  *
6415
7317
  * @param params - Parameters for request
6416
7318
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6505,6 +7407,73 @@ export namespace sheets_v4 {
6505
7407
 
6506
7408
  /**
6507
7409
  * Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more DataFilterValueRanges.
7410
+ * @example
7411
+ * ```js
7412
+ * // Before running the sample:
7413
+ * // - Enable the API at:
7414
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
7415
+ * // - Login into gcloud by running:
7416
+ * // ```sh
7417
+ * // $ gcloud auth application-default login
7418
+ * // ```
7419
+ * // - Install the npm module by running:
7420
+ * // ```sh
7421
+ * // $ npm install googleapis
7422
+ * // ```
7423
+ *
7424
+ * const {google} = require('googleapis');
7425
+ * const sheets = google.sheets('v4');
7426
+ *
7427
+ * async function main() {
7428
+ * const auth = new google.auth.GoogleAuth({
7429
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7430
+ * scopes: [
7431
+ * 'https://www.googleapis.com/auth/drive',
7432
+ * 'https://www.googleapis.com/auth/drive.file',
7433
+ * 'https://www.googleapis.com/auth/spreadsheets',
7434
+ * ],
7435
+ * });
7436
+ *
7437
+ * // Acquire an auth client, and bind it to all future calls
7438
+ * const authClient = await auth.getClient();
7439
+ * google.options({auth: authClient});
7440
+ *
7441
+ * // Do the magic
7442
+ * const res = await sheets.spreadsheets.values.batchUpdateByDataFilter({
7443
+ * // The ID of the spreadsheet to update.
7444
+ * spreadsheetId: 'placeholder-value',
7445
+ *
7446
+ * // Request body metadata
7447
+ * requestBody: {
7448
+ * // request body parameters
7449
+ * // {
7450
+ * // "data": [],
7451
+ * // "includeValuesInResponse": false,
7452
+ * // "responseDateTimeRenderOption": "my_responseDateTimeRenderOption",
7453
+ * // "responseValueRenderOption": "my_responseValueRenderOption",
7454
+ * // "valueInputOption": "my_valueInputOption"
7455
+ * // }
7456
+ * },
7457
+ * });
7458
+ * console.log(res.data);
7459
+ *
7460
+ * // Example response
7461
+ * // {
7462
+ * // "responses": [],
7463
+ * // "spreadsheetId": "my_spreadsheetId",
7464
+ * // "totalUpdatedCells": 0,
7465
+ * // "totalUpdatedColumns": 0,
7466
+ * // "totalUpdatedRows": 0,
7467
+ * // "totalUpdatedSheets": 0
7468
+ * // }
7469
+ * }
7470
+ *
7471
+ * main().catch(e => {
7472
+ * console.error(e);
7473
+ * throw e;
7474
+ * });
7475
+ *
7476
+ * ```
6508
7477
  *
6509
7478
  * @param params - Parameters for request
6510
7479
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6607,6 +7576,65 @@ export namespace sheets_v4 {
6607
7576
 
6608
7577
  /**
6609
7578
  * Clears values from a spreadsheet. The caller must specify the spreadsheet ID and range. Only values are cleared -- all other properties of the cell (such as formatting, data validation, etc..) are kept.
7579
+ * @example
7580
+ * ```js
7581
+ * // Before running the sample:
7582
+ * // - Enable the API at:
7583
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
7584
+ * // - Login into gcloud by running:
7585
+ * // ```sh
7586
+ * // $ gcloud auth application-default login
7587
+ * // ```
7588
+ * // - Install the npm module by running:
7589
+ * // ```sh
7590
+ * // $ npm install googleapis
7591
+ * // ```
7592
+ *
7593
+ * const {google} = require('googleapis');
7594
+ * const sheets = google.sheets('v4');
7595
+ *
7596
+ * async function main() {
7597
+ * const auth = new google.auth.GoogleAuth({
7598
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7599
+ * scopes: [
7600
+ * 'https://www.googleapis.com/auth/drive',
7601
+ * 'https://www.googleapis.com/auth/drive.file',
7602
+ * 'https://www.googleapis.com/auth/spreadsheets',
7603
+ * ],
7604
+ * });
7605
+ *
7606
+ * // Acquire an auth client, and bind it to all future calls
7607
+ * const authClient = await auth.getClient();
7608
+ * google.options({auth: authClient});
7609
+ *
7610
+ * // Do the magic
7611
+ * const res = await sheets.spreadsheets.values.clear({
7612
+ * // The [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to clear.
7613
+ * range: 'placeholder-value',
7614
+ * // The ID of the spreadsheet to update.
7615
+ * spreadsheetId: 'placeholder-value',
7616
+ *
7617
+ * // Request body metadata
7618
+ * requestBody: {
7619
+ * // request body parameters
7620
+ * // {}
7621
+ * },
7622
+ * });
7623
+ * console.log(res.data);
7624
+ *
7625
+ * // Example response
7626
+ * // {
7627
+ * // "clearedRange": "my_clearedRange",
7628
+ * // "spreadsheetId": "my_spreadsheetId"
7629
+ * // }
7630
+ * }
7631
+ *
7632
+ * main().catch(e => {
7633
+ * console.error(e);
7634
+ * throw e;
7635
+ * });
7636
+ *
7637
+ * ```
6610
7638
  *
6611
7639
  * @param params - Parameters for request
6612
7640
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6697,6 +7725,68 @@ export namespace sheets_v4 {
6697
7725
 
6698
7726
  /**
6699
7727
  * Returns a range of values from a spreadsheet. The caller must specify the spreadsheet ID and a range.
7728
+ * @example
7729
+ * ```js
7730
+ * // Before running the sample:
7731
+ * // - Enable the API at:
7732
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
7733
+ * // - Login into gcloud by running:
7734
+ * // ```sh
7735
+ * // $ gcloud auth application-default login
7736
+ * // ```
7737
+ * // - Install the npm module by running:
7738
+ * // ```sh
7739
+ * // $ npm install googleapis
7740
+ * // ```
7741
+ *
7742
+ * const {google} = require('googleapis');
7743
+ * const sheets = google.sheets('v4');
7744
+ *
7745
+ * async function main() {
7746
+ * const auth = new google.auth.GoogleAuth({
7747
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7748
+ * scopes: [
7749
+ * 'https://www.googleapis.com/auth/drive',
7750
+ * 'https://www.googleapis.com/auth/drive.file',
7751
+ * 'https://www.googleapis.com/auth/drive.readonly',
7752
+ * 'https://www.googleapis.com/auth/spreadsheets',
7753
+ * 'https://www.googleapis.com/auth/spreadsheets.readonly',
7754
+ * ],
7755
+ * });
7756
+ *
7757
+ * // Acquire an auth client, and bind it to all future calls
7758
+ * const authClient = await auth.getClient();
7759
+ * google.options({auth: authClient});
7760
+ *
7761
+ * // Do the magic
7762
+ * const res = await sheets.spreadsheets.values.get({
7763
+ * // How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
7764
+ * dateTimeRenderOption: 'placeholder-value',
7765
+ * // The major dimension that results should use. For example, if the spreadsheet data in Sheet1 is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=Sheet1!A1:B2?majorDimension=ROWS` returns `[[1,2],[3,4]]`, whereas requesting `range=Sheet1!A1:B2?majorDimension=COLUMNS` returns `[[1,3],[2,4]]`.
7766
+ * majorDimension: 'placeholder-value',
7767
+ * // The [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the range to retrieve values from.
7768
+ * range: 'placeholder-value',
7769
+ * // The ID of the spreadsheet to retrieve data from.
7770
+ * spreadsheetId: 'placeholder-value',
7771
+ * // How values should be represented in the output. The default render option is FORMATTED_VALUE.
7772
+ * valueRenderOption: 'placeholder-value',
7773
+ * });
7774
+ * console.log(res.data);
7775
+ *
7776
+ * // Example response
7777
+ * // {
7778
+ * // "majorDimension": "my_majorDimension",
7779
+ * // "range": "my_range",
7780
+ * // "values": []
7781
+ * // }
7782
+ * }
7783
+ *
7784
+ * main().catch(e => {
7785
+ * console.error(e);
7786
+ * throw e;
7787
+ * });
7788
+ *
7789
+ * ```
6700
7790
  *
6701
7791
  * @param params - Parameters for request
6702
7792
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6787,6 +7877,81 @@ export namespace sheets_v4 {
6787
7877
 
6788
7878
  /**
6789
7879
  * Sets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a valueInputOption.
7880
+ * @example
7881
+ * ```js
7882
+ * // Before running the sample:
7883
+ * // - Enable the API at:
7884
+ * // https://console.developers.google.com/apis/api/sheets.googleapis.com
7885
+ * // - Login into gcloud by running:
7886
+ * // ```sh
7887
+ * // $ gcloud auth application-default login
7888
+ * // ```
7889
+ * // - Install the npm module by running:
7890
+ * // ```sh
7891
+ * // $ npm install googleapis
7892
+ * // ```
7893
+ *
7894
+ * const {google} = require('googleapis');
7895
+ * const sheets = google.sheets('v4');
7896
+ *
7897
+ * async function main() {
7898
+ * const auth = new google.auth.GoogleAuth({
7899
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7900
+ * scopes: [
7901
+ * 'https://www.googleapis.com/auth/drive',
7902
+ * 'https://www.googleapis.com/auth/drive.file',
7903
+ * 'https://www.googleapis.com/auth/spreadsheets',
7904
+ * ],
7905
+ * });
7906
+ *
7907
+ * // Acquire an auth client, and bind it to all future calls
7908
+ * const authClient = await auth.getClient();
7909
+ * google.options({auth: authClient});
7910
+ *
7911
+ * // Do the magic
7912
+ * const res = await sheets.spreadsheets.values.update({
7913
+ * // Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. If the range to write was larger than the range actually written, the response includes all values in the requested range (excluding trailing empty rows and columns).
7914
+ * includeValuesInResponse: 'placeholder-value',
7915
+ * // The [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to update.
7916
+ * range: 'placeholder-value',
7917
+ * // Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
7918
+ * responseDateTimeRenderOption: 'placeholder-value',
7919
+ * // Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
7920
+ * responseValueRenderOption: 'placeholder-value',
7921
+ * // The ID of the spreadsheet to update.
7922
+ * spreadsheetId: 'placeholder-value',
7923
+ * // How the input data should be interpreted.
7924
+ * valueInputOption: 'placeholder-value',
7925
+ *
7926
+ * // Request body metadata
7927
+ * requestBody: {
7928
+ * // request body parameters
7929
+ * // {
7930
+ * // "majorDimension": "my_majorDimension",
7931
+ * // "range": "my_range",
7932
+ * // "values": []
7933
+ * // }
7934
+ * },
7935
+ * });
7936
+ * console.log(res.data);
7937
+ *
7938
+ * // Example response
7939
+ * // {
7940
+ * // "spreadsheetId": "my_spreadsheetId",
7941
+ * // "updatedCells": 0,
7942
+ * // "updatedColumns": 0,
7943
+ * // "updatedData": {},
7944
+ * // "updatedRange": "my_updatedRange",
7945
+ * // "updatedRows": 0
7946
+ * // }
7947
+ * }
7948
+ *
7949
+ * main().catch(e => {
7950
+ * console.error(e);
7951
+ * throw e;
7952
+ * });
7953
+ *
7954
+ * ```
6790
7955
  *
6791
7956
  * @param params - Parameters for request
6792
7957
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.