sheets 0.4.0

A fully generated & opinionated API client for the Google Sheets API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
use anyhow::Result;

use crate::Client;

pub struct Spreadsheets {
    pub client: Client,
}

impl Spreadsheets {
    #[doc(hidden)]
    pub fn new(client: Client) -> Self {
        Spreadsheets { client }
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets` endpoint.
     *
     * Creates a spreadsheet, returning the newly created spreadsheet.
     */
    pub async fn create(
        &self,
        body: &crate::types::Spreadsheet,
    ) -> Result<crate::types::Spreadsheet> {
        let url = "/v4/spreadsheets".to_string();
        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `GET` to the `/v4/spreadsheets/{spreadsheetId}` endpoint.
     *
     * Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. By default, data within grids will not be returned. You can include grid data one of two ways: * Specify a field mask 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, it is recommended to retrieve only the specific fields of the spreadsheet that you want. To retrieve only subsets of the spreadsheet, use the ranges URL parameter. Multiple ranges can be specified. Limiting the range will return only the portions of the spreadsheet that intersect the requested ranges. Ranges are specified using A1 notation.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `include_grid_data: bool` -- True if we should generate data with the "alternate" series. This differs based on the type and amount of source data.
     * * `ranges: &[String]` -- The ranges that were cleared, in A1 notation. If the requests are for an unbounded range or a ranger larger than the bounds of the sheet, this is the actual ranges that were cleared, bounded to the sheet's limits.
     */
    pub async fn get(
        &self,
        spreadsheet_id: &str,
        include_grid_data: bool,
        ranges: &[String],
    ) -> Result<crate::types::Spreadsheet> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if include_grid_data {
            query_args.push(("includeGridData".to_string(), include_grid_data.to_string()));
        }
        if !ranges.is_empty() {
            query_args.push(("ranges".to_string(), ranges.join(" ")));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!(
            "/v4/spreadsheets/{}?{}",
            crate::progenitor_support::encode_path(spreadsheet_id),
            query_
        );

        self.client.get(&url, None).await
    }

    /**
     * This function performs a `GET` to the `/v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}` endpoint.
     *
     * Returns the developer metadata with the specified ID. The caller must specify the spreadsheet ID and the developer metadata's unique metadataId.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `metadata_id: i64` -- The zero-based index where the rule should be inserted.
     */
    pub async fn developer_metadata_get(
        &self,
        spreadsheet_id: &str,
        metadata_id: i64,
    ) -> Result<crate::types::DeveloperMetadata> {
        let url = format!(
            "/v4/spreadsheets/{}/developerMetadata/{}",
            crate::progenitor_support::encode_path(spreadsheet_id),
            crate::progenitor_support::encode_path(&metadata_id.to_string()),
        );

        self.client.get(&url, None).await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}/developerMetadata:search` endpoint.
     *
     * 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.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     */
    pub async fn developer_metadata_search(
        &self,
        spreadsheet_id: &str,
        body: &crate::types::SearchDeveloperMetadataRequest,
    ) -> Result<crate::types::SearchDeveloperMetadataResponse> {
        let url = format!(
            "/v4/spreadsheets/{}/developerMetadata:search",
            crate::progenitor_support::encode_path(spreadsheet_id),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo` endpoint.
     *
     * Copies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `sheet_id: i64` -- The zero-based index where the rule should be inserted.
     */
    pub async fn sheets_copy(
        &self,
        spreadsheet_id: &str,
        sheet_id: i64,
        body: &crate::types::CopySheetAnotherSpreadsheetRequest,
    ) -> Result<crate::types::SheetProperties> {
        let url = format!(
            "/v4/spreadsheets/{}/sheets/{}/copyTo",
            crate::progenitor_support::encode_path(spreadsheet_id),
            crate::progenitor_support::encode_path(&sheet_id.to_string()),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `GET` to the `/v4/spreadsheets/{spreadsheetId}/values/{range}` endpoint.
     *
     * Returns a range of values from a spreadsheet. The caller must specify the spreadsheet ID and a range.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `range: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `date_time_render_option: crate::types::DateTimeRenderOption` -- 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.
     * * `major_dimension: crate::types::Dimension` -- The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` returns `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` returns `[[1,3],[2,4]]`.
     * * `value_render_option: crate::types::ValueRenderOption` -- How values should be represented in the output. The default render option is FORMATTED_VALUE.
     */
    pub async fn values_get(
        &self,
        spreadsheet_id: &str,
        range: &str,
        date_time_render_option: crate::types::DateTimeRenderOption,
        major_dimension: crate::types::Dimension,
        value_render_option: crate::types::ValueRenderOption,
    ) -> Result<crate::types::ValueRange> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if !date_time_render_option.to_string().is_empty() {
            query_args.push((
                "dateTimeRenderOption".to_string(),
                date_time_render_option.to_string(),
            ));
        }
        if !major_dimension.to_string().is_empty() {
            query_args.push(("majorDimension".to_string(), major_dimension.to_string()));
        }
        if !value_render_option.to_string().is_empty() {
            query_args.push((
                "valueRenderOption".to_string(),
                value_render_option.to_string(),
            ));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!(
            "/v4/spreadsheets/{}/values/{}?{}",
            crate::progenitor_support::encode_path(spreadsheet_id),
            crate::progenitor_support::encode_path(range),
            query_
        );

        self.client.get(&url, None).await
    }

    /**
     * This function performs a `PUT` to the `/v4/spreadsheets/{spreadsheetId}/values/{range}` endpoint.
     *
     * Sets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a valueInputOption.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `range: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `include_values_in_response: bool` -- 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).
     * * `response_date_time_render_option: crate::types::DateTimeRenderOption` -- 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.
     * * `response_value_render_option: crate::types::ValueRenderOption` -- Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
     * * `value_input_option: crate::types::ValueInputOption` -- How the input data should be interpreted.
     */
    pub async fn values_update(
        &self,
        spreadsheet_id: &str,
        range: &str,
        include_values_in_response: bool,
        response_date_time_render_option: crate::types::DateTimeRenderOption,
        response_value_render_option: crate::types::ValueRenderOption,
        value_input_option: crate::types::ValueInputOption,
        body: &crate::types::ValueRange,
    ) -> Result<crate::types::UpdateValuesResponse> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if include_values_in_response {
            query_args.push((
                "includeValuesInResponse".to_string(),
                include_values_in_response.to_string(),
            ));
        }
        if !response_date_time_render_option.to_string().is_empty() {
            query_args.push((
                "responseDateTimeRenderOption".to_string(),
                response_date_time_render_option.to_string(),
            ));
        }
        if !response_value_render_option.to_string().is_empty() {
            query_args.push((
                "responseValueRenderOption".to_string(),
                response_value_render_option.to_string(),
            ));
        }
        if !value_input_option.to_string().is_empty() {
            query_args.push((
                "valueInputOption".to_string(),
                value_input_option.to_string(),
            ));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!(
            "/v4/spreadsheets/{}/values/{}?{}",
            crate::progenitor_support::encode_path(spreadsheet_id),
            crate::progenitor_support::encode_path(range),
            query_
        );

        self.client
            .put(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}/values/{range}:append` endpoint.
     *
     * 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](/sheets/api/guides/values#appending_values) and [sample code](/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.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `range: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `include_values_in_response: bool` -- Determines if the update response should include the values of the cells that were appended. By default, responses do not include the updated values.
     * * `insert_data_option: crate::types::InsertDataOption` -- How the input data should be inserted.
     * * `response_date_time_render_option: crate::types::DateTimeRenderOption` -- 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.
     * * `response_value_render_option: crate::types::ValueRenderOption` -- Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
     * * `value_input_option: crate::types::ValueInputOption` -- How the input data should be interpreted.
     */
    pub async fn values_append(
        &self,
        spreadsheet_id: &str,
        range: &str,
        include_values_in_response: bool,
        insert_data_option: crate::types::InsertDataOption,
        response_date_time_render_option: crate::types::DateTimeRenderOption,
        response_value_render_option: crate::types::ValueRenderOption,
        value_input_option: crate::types::ValueInputOption,
        body: &crate::types::ValueRange,
    ) -> Result<crate::types::AppendValuesResponse> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if include_values_in_response {
            query_args.push((
                "includeValuesInResponse".to_string(),
                include_values_in_response.to_string(),
            ));
        }
        if !insert_data_option.to_string().is_empty() {
            query_args.push((
                "insertDataOption".to_string(),
                insert_data_option.to_string(),
            ));
        }
        if !response_date_time_render_option.to_string().is_empty() {
            query_args.push((
                "responseDateTimeRenderOption".to_string(),
                response_date_time_render_option.to_string(),
            ));
        }
        if !response_value_render_option.to_string().is_empty() {
            query_args.push((
                "responseValueRenderOption".to_string(),
                response_value_render_option.to_string(),
            ));
        }
        if !value_input_option.to_string().is_empty() {
            query_args.push((
                "valueInputOption".to_string(),
                value_input_option.to_string(),
            ));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!(
            "/v4/spreadsheets/{}/values/{}/append?{}",
            crate::progenitor_support::encode_path(spreadsheet_id),
            crate::progenitor_support::encode_path(range),
            query_
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}/values/{range}:clear` endpoint.
     *
     * 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.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `range: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     */
    pub async fn values_clear(
        &self,
        spreadsheet_id: &str,
        range: &str,
        body: &crate::types::ClearValuesRequest,
    ) -> Result<crate::types::ClearValuesResponse> {
        let url = format!(
            "/v4/spreadsheets/{}/values/{}/clear",
            crate::progenitor_support::encode_path(spreadsheet_id),
            crate::progenitor_support::encode_path(range),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}/values:batchClear` endpoint.
     *
     * 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, data validation, etc..) are kept.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     */
    pub async fn values_batch_clear(
        &self,
        spreadsheet_id: &str,
        body: &crate::types::BatchClearValuesRequest,
    ) -> Result<crate::types::BatchClearValuesResponse> {
        let url = format!(
            "/v4/spreadsheets/{}/values:batchClear",
            crate::progenitor_support::encode_path(spreadsheet_id),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter` endpoint.
     *
     * 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.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     */
    pub async fn values_batch_clear_data_filter(
        &self,
        spreadsheet_id: &str,
        body: &crate::types::BatchClearValuesByDataFilterRequest,
    ) -> Result<crate::types::BatchClearValuesByDataFilterResponse> {
        let url = format!(
            "/v4/spreadsheets/{}/values:batchClearByDataFilter",
            crate::progenitor_support::encode_path(spreadsheet_id),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `GET` to the `/v4/spreadsheets/{spreadsheetId}/values:batchGet` endpoint.
     *
     * Returns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     * * `date_time_render_option: crate::types::DateTimeRenderOption` -- 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.
     * * `major_dimension: crate::types::Dimension` -- The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` returns `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` returns `[[1,3],[2,4]]`.
     * * `ranges: &[String]` -- The ranges that were cleared, in A1 notation. If the requests are for an unbounded range or a ranger larger than the bounds of the sheet, this is the actual ranges that were cleared, bounded to the sheet's limits.
     * * `value_render_option: crate::types::ValueRenderOption` -- How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE.
     */
    pub async fn values_batch_get(
        &self,
        spreadsheet_id: &str,
        date_time_render_option: crate::types::DateTimeRenderOption,
        major_dimension: crate::types::Dimension,
        ranges: &[String],
        value_render_option: crate::types::ValueRenderOption,
    ) -> Result<crate::types::BatchGetValuesResponse> {
        let mut query_args: Vec<(String, String)> = Default::default();
        if !date_time_render_option.to_string().is_empty() {
            query_args.push((
                "dateTimeRenderOption".to_string(),
                date_time_render_option.to_string(),
            ));
        }
        if !major_dimension.to_string().is_empty() {
            query_args.push(("majorDimension".to_string(), major_dimension.to_string()));
        }
        if !ranges.is_empty() {
            query_args.push(("ranges".to_string(), ranges.join(" ")));
        }
        if !value_render_option.to_string().is_empty() {
            query_args.push((
                "valueRenderOption".to_string(),
                value_render_option.to_string(),
            ));
        }
        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
        let url = format!(
            "/v4/spreadsheets/{}/values:batchGet?{}",
            crate::progenitor_support::encode_path(spreadsheet_id),
            query_
        );

        self.client.get(&url, None).await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter` endpoint.
     *
     * 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.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     */
    pub async fn values_batch_get_data_filter(
        &self,
        spreadsheet_id: &str,
        body: &crate::types::BatchGetValuesByDataFilterRequest,
    ) -> Result<crate::types::BatchGetValuesByDataFilterResponse> {
        let url = format!(
            "/v4/spreadsheets/{}/values:batchGetByDataFilter",
            crate::progenitor_support::encode_path(spreadsheet_id),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}/values:batchUpdate` endpoint.
     *
     * Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     */
    pub async fn values_batch_update(
        &self,
        spreadsheet_id: &str,
        body: &crate::types::BatchUpdateValuesRequest,
    ) -> Result<crate::types::BatchUpdateValuesResponse> {
        let url = format!(
            "/v4/spreadsheets/{}/values:batchUpdate",
            crate::progenitor_support::encode_path(spreadsheet_id),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter` endpoint.
     *
     * Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more DataFilterValueRanges.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     */
    pub async fn values_batch_update_data_filter(
        &self,
        spreadsheet_id: &str,
        body: &crate::types::BatchUpdateValuesByDataFilterRequest,
    ) -> Result<crate::types::BatchUpdateValuesByDataFilterResponse> {
        let url = format!(
            "/v4/spreadsheets/{}/values:batchUpdateByDataFilter",
            crate::progenitor_support::encode_path(spreadsheet_id),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}:batchUpdate` endpoint.
     *
     * 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.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     */
    pub async fn batch_update(
        &self,
        spreadsheet_id: &str,
        body: &crate::types::BatchUpdateSpreadsheetRequest,
    ) -> Result<crate::types::BatchUpdateSpreadsheetResponse> {
        let url = format!(
            "/v4/spreadsheets/{}/batchUpdate",
            crate::progenitor_support::encode_path(spreadsheet_id),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }

    /**
     * This function performs a `POST` to the `/v4/spreadsheets/{spreadsheetId}:getByDataFilter` endpoint.
     *
     * 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 will return the portions of the spreadsheet that intersect ranges matched by any of the filters. By default, data within grids will not be returned. You can include grid data one of two ways: * Specify a field mask 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, it is recommended to retrieve only the specific fields of the spreadsheet that you want.
     *
     * **Parameters:**
     *
     * * `spreadsheet_id: &str` -- The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single `"\*"` can be used as short-hand for listing every field.
     */
    pub async fn get_data_filter(
        &self,
        spreadsheet_id: &str,
        body: &crate::types::GetSpreadsheetByDataFilterRequest,
    ) -> Result<crate::types::Spreadsheet> {
        let url = format!(
            "/v4/spreadsheets/{}/getByDataFilter",
            crate::progenitor_support::encode_path(spreadsheet_id),
        );

        self.client
            .post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
            .await
    }
}