google_sheets4/api.rs
1#![allow(clippy::ptr_arg)]
2
3use std::collections::{BTreeSet, HashMap};
4
5use tokio::time::sleep;
6
7// ##############
8// UTILITIES ###
9// ############
10
11/// Identifies the an OAuth2 authorization scope.
12/// A scope is needed when requesting an
13/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
14#[derive(PartialEq, Eq, Ord, PartialOrd, Hash, Debug, Clone, Copy)]
15pub enum Scope {
16 /// See, edit, create, and delete all of your Google Drive files
17 Drive,
18
19 /// See, edit, create, and delete only the specific Google Drive files you use with this app
20 DriveFile,
21
22 /// See and download all your Google Drive files
23 DriveReadonly,
24
25 /// See, edit, create, and delete all your Google Sheets spreadsheets
26 Spreadsheet,
27
28 /// See all your Google Sheets spreadsheets
29 SpreadsheetReadonly,
30}
31
32impl AsRef<str> for Scope {
33 fn as_ref(&self) -> &str {
34 match *self {
35 Scope::Drive => "https://www.googleapis.com/auth/drive",
36 Scope::DriveFile => "https://www.googleapis.com/auth/drive.file",
37 Scope::DriveReadonly => "https://www.googleapis.com/auth/drive.readonly",
38 Scope::Spreadsheet => "https://www.googleapis.com/auth/spreadsheets",
39 Scope::SpreadsheetReadonly => "https://www.googleapis.com/auth/spreadsheets.readonly",
40 }
41 }
42}
43
44#[allow(clippy::derivable_impls)]
45impl Default for Scope {
46 fn default() -> Scope {
47 Scope::DriveReadonly
48 }
49}
50
51// ########
52// HUB ###
53// ######
54
55/// Central instance to access all Sheets related resource activities
56///
57/// # Examples
58///
59/// Instantiate a new hub
60///
61/// ```test_harness,no_run
62/// extern crate hyper;
63/// extern crate hyper_rustls;
64/// extern crate google_sheets4 as sheets4;
65/// use sheets4::api::ValueRange;
66/// use sheets4::{Result, Error};
67/// # async fn dox() {
68/// use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
69///
70/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
71/// // `client_secret`, among other things.
72/// let secret: yup_oauth2::ApplicationSecret = Default::default();
73/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
74/// // unless you replace `None` with the desired Flow.
75/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
76/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
77/// // retrieve them from storage.
78/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
79/// secret,
80/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
81/// ).build().await.unwrap();
82///
83/// let client = hyper_util::client::legacy::Client::builder(
84/// hyper_util::rt::TokioExecutor::new()
85/// )
86/// .build(
87/// hyper_rustls::HttpsConnectorBuilder::new()
88/// .with_native_roots()
89/// .unwrap()
90/// .https_or_http()
91/// .enable_http1()
92/// .build()
93/// );
94/// let mut hub = Sheets::new(client, auth);
95/// // As the method needs a request, you would usually fill it with the desired information
96/// // into the respective structure. Some of the parts shown here might not be applicable !
97/// // Values shown here are possibly random and not representative !
98/// let mut req = ValueRange::default();
99///
100/// // You can configure optional parameters by calling the respective setters at will, and
101/// // execute the final call using `doit()`.
102/// // Values shown here are possibly random and not representative !
103/// let result = hub.spreadsheets().values_append(req, "spreadsheetId", "range")
104/// .value_input_option("dolor")
105/// .response_value_render_option("ea")
106/// .response_date_time_render_option("ipsum")
107/// .insert_data_option("invidunt")
108/// .include_values_in_response(true)
109/// .doit().await;
110///
111/// match result {
112/// Err(e) => match e {
113/// // The Error enum provides details about what exactly happened.
114/// // You can also just use its `Debug`, `Display` or `Error` traits
115/// Error::HttpError(_)
116/// |Error::Io(_)
117/// |Error::MissingAPIKey
118/// |Error::MissingToken(_)
119/// |Error::Cancelled
120/// |Error::UploadSizeLimitExceeded(_, _)
121/// |Error::Failure(_)
122/// |Error::BadRequest(_)
123/// |Error::FieldClash(_)
124/// |Error::JsonDecodeError(_, _) => println!("{}", e),
125/// },
126/// Ok(res) => println!("Success: {:?}", res),
127/// }
128/// # }
129/// ```
130#[derive(Clone)]
131pub struct Sheets<C> {
132 pub client: common::Client<C>,
133 pub auth: Box<dyn common::GetToken>,
134 _user_agent: String,
135 _base_url: String,
136 _root_url: String,
137}
138
139impl<C> common::Hub for Sheets<C> {}
140
141impl<'a, C> Sheets<C> {
142 pub fn new<A: 'static + common::GetToken>(client: common::Client<C>, auth: A) -> Sheets<C> {
143 Sheets {
144 client,
145 auth: Box::new(auth),
146 _user_agent: "google-api-rust-client/6.0.0".to_string(),
147 _base_url: "https://sheets.googleapis.com/".to_string(),
148 _root_url: "https://sheets.googleapis.com/".to_string(),
149 }
150 }
151
152 pub fn spreadsheets(&'a self) -> SpreadsheetMethods<'a, C> {
153 SpreadsheetMethods { hub: self }
154 }
155
156 /// Set the user-agent header field to use in all requests to the server.
157 /// It defaults to `google-api-rust-client/6.0.0`.
158 ///
159 /// Returns the previously set user-agent.
160 pub fn user_agent(&mut self, agent_name: String) -> String {
161 std::mem::replace(&mut self._user_agent, agent_name)
162 }
163
164 /// Set the base url to use in all requests to the server.
165 /// It defaults to `https://sheets.googleapis.com/`.
166 ///
167 /// Returns the previously set base url.
168 pub fn base_url(&mut self, new_base_url: String) -> String {
169 std::mem::replace(&mut self._base_url, new_base_url)
170 }
171
172 /// Set the root url to use in all requests to the server.
173 /// It defaults to `https://sheets.googleapis.com/`.
174 ///
175 /// Returns the previously set root url.
176 pub fn root_url(&mut self, new_root_url: String) -> String {
177 std::mem::replace(&mut self._root_url, new_root_url)
178 }
179}
180
181// ############
182// SCHEMAS ###
183// ##########
184/// Adds a new banded range to the spreadsheet.
185///
186/// This type is not used in any activity, and only used as *part* of another schema.
187///
188#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
189#[serde_with::serde_as]
190#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
191pub struct AddBandingRequest {
192 /// The banded range to add. The bandedRangeId field is optional; if one is not set, an id will be randomly generated. (It is an error to specify the ID of a range that already exists.)
193 #[serde(rename = "bandedRange")]
194 pub banded_range: Option<BandedRange>,
195}
196
197impl common::Part for AddBandingRequest {}
198
199/// The result of adding a banded range.
200///
201/// This type is not used in any activity, and only used as *part* of another schema.
202///
203#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
204#[serde_with::serde_as]
205#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
206pub struct AddBandingResponse {
207 /// The banded range that was added.
208 #[serde(rename = "bandedRange")]
209 pub banded_range: Option<BandedRange>,
210}
211
212impl common::Part for AddBandingResponse {}
213
214/// Adds a chart to a sheet in the spreadsheet.
215///
216/// This type is not used in any activity, and only used as *part* of another schema.
217///
218#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
219#[serde_with::serde_as]
220#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
221pub struct AddChartRequest {
222 /// The chart that should be added to the spreadsheet, including the position where it should be placed. The chartId field is optional; if one is not set, an id will be randomly generated. (It is an error to specify the ID of an embedded object that already exists.)
223 pub chart: Option<EmbeddedChart>,
224}
225
226impl common::Part for AddChartRequest {}
227
228/// The result of adding a chart to a spreadsheet.
229///
230/// This type is not used in any activity, and only used as *part* of another schema.
231///
232#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
233#[serde_with::serde_as]
234#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
235pub struct AddChartResponse {
236 /// The newly added chart.
237 pub chart: Option<EmbeddedChart>,
238}
239
240impl common::Part for AddChartResponse {}
241
242/// Adds a new conditional format rule at the given index. All subsequent rules' indexes are incremented.
243///
244/// This type is not used in any activity, and only used as *part* of another schema.
245///
246#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
247#[serde_with::serde_as]
248#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
249pub struct AddConditionalFormatRuleRequest {
250 /// The zero-based index where the rule should be inserted.
251 pub index: Option<i32>,
252 /// The rule to add.
253 pub rule: Option<ConditionalFormatRule>,
254}
255
256impl common::Part for AddConditionalFormatRuleRequest {}
257
258/// Adds a data source. After the data source is added successfully, an associated DATA_SOURCE sheet is created and an execution is triggered to refresh the sheet to read data from the data source. The request requires an additional `bigquery.readonly` OAuth scope.
259///
260/// This type is not used in any activity, and only used as *part* of another schema.
261///
262#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
263#[serde_with::serde_as]
264#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
265pub struct AddDataSourceRequest {
266 /// The data source to add.
267 #[serde(rename = "dataSource")]
268 pub data_source: Option<DataSource>,
269}
270
271impl common::Part for AddDataSourceRequest {}
272
273/// The result of adding a data source.
274///
275/// This type is not used in any activity, and only used as *part* of another schema.
276///
277#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
278#[serde_with::serde_as]
279#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
280pub struct AddDataSourceResponse {
281 /// The data execution status.
282 #[serde(rename = "dataExecutionStatus")]
283 pub data_execution_status: Option<DataExecutionStatus>,
284 /// The data source that was created.
285 #[serde(rename = "dataSource")]
286 pub data_source: Option<DataSource>,
287}
288
289impl common::Part for AddDataSourceResponse {}
290
291/// Creates a group over the specified range. If the requested range is a superset of the range of an existing group G, then the depth of G is incremented and this new group G' has the depth of that group. For example, a group [C:D, depth 1] + [B:E] results in groups [B:E, depth 1] and [C:D, depth 2]. If the requested range is a subset of the range of an existing group G, then the depth of the new group G' becomes one greater than the depth of G. For example, a group [B:E, depth 1] + [C:D] results in groups [B:E, depth 1] and [C:D, depth 2]. If the requested range starts before and ends within, or starts within and ends after, the range of an existing group G, then the range of the existing group G becomes the union of the ranges, and the new group G' has depth one greater than the depth of G and range as the intersection of the ranges. For example, a group [B:D, depth 1] + [C:E] results in groups [B:E, depth 1] and [C:D, depth 2].
292///
293/// This type is not used in any activity, and only used as *part* of another schema.
294///
295#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
296#[serde_with::serde_as]
297#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
298pub struct AddDimensionGroupRequest {
299 /// The range over which to create a group.
300 pub range: Option<DimensionRange>,
301}
302
303impl common::Part for AddDimensionGroupRequest {}
304
305/// The result of adding a group.
306///
307/// This type is not used in any activity, and only used as *part* of another schema.
308///
309#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
310#[serde_with::serde_as]
311#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
312pub struct AddDimensionGroupResponse {
313 /// All groups of a dimension after adding a group to that dimension.
314 #[serde(rename = "dimensionGroups")]
315 pub dimension_groups: Option<Vec<DimensionGroup>>,
316}
317
318impl common::Part for AddDimensionGroupResponse {}
319
320/// Adds a filter view.
321///
322/// This type is not used in any activity, and only used as *part* of another schema.
323///
324#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
325#[serde_with::serde_as]
326#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
327pub struct AddFilterViewRequest {
328 /// The filter to add. The filterViewId field is optional; if one is not set, an id will be randomly generated. (It is an error to specify the ID of a filter that already exists.)
329 pub filter: Option<FilterView>,
330}
331
332impl common::Part for AddFilterViewRequest {}
333
334/// The result of adding a filter view.
335///
336/// This type is not used in any activity, and only used as *part* of another schema.
337///
338#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
339#[serde_with::serde_as]
340#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
341pub struct AddFilterViewResponse {
342 /// The newly added filter view.
343 pub filter: Option<FilterView>,
344}
345
346impl common::Part for AddFilterViewResponse {}
347
348/// Adds a named range to the spreadsheet.
349///
350/// This type is not used in any activity, and only used as *part* of another schema.
351///
352#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
353#[serde_with::serde_as]
354#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
355pub struct AddNamedRangeRequest {
356 /// The named range to add. The namedRangeId field is optional; if one is not set, an id will be randomly generated. (It is an error to specify the ID of a range that already exists.)
357 #[serde(rename = "namedRange")]
358 pub named_range: Option<NamedRange>,
359}
360
361impl common::Part for AddNamedRangeRequest {}
362
363/// The result of adding a named range.
364///
365/// This type is not used in any activity, and only used as *part* of another schema.
366///
367#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
368#[serde_with::serde_as]
369#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
370pub struct AddNamedRangeResponse {
371 /// The named range to add.
372 #[serde(rename = "namedRange")]
373 pub named_range: Option<NamedRange>,
374}
375
376impl common::Part for AddNamedRangeResponse {}
377
378/// Adds a new protected range.
379///
380/// This type is not used in any activity, and only used as *part* of another schema.
381///
382#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
383#[serde_with::serde_as]
384#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
385pub struct AddProtectedRangeRequest {
386 /// The protected range to be added. The protectedRangeId field is optional; if one is not set, an id will be randomly generated. (It is an error to specify the ID of a range that already exists.)
387 #[serde(rename = "protectedRange")]
388 pub protected_range: Option<ProtectedRange>,
389}
390
391impl common::Part for AddProtectedRangeRequest {}
392
393/// The result of adding a new protected range.
394///
395/// This type is not used in any activity, and only used as *part* of another schema.
396///
397#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
398#[serde_with::serde_as]
399#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
400pub struct AddProtectedRangeResponse {
401 /// The newly added protected range.
402 #[serde(rename = "protectedRange")]
403 pub protected_range: Option<ProtectedRange>,
404}
405
406impl common::Part for AddProtectedRangeResponse {}
407
408/// Adds a new sheet. When a sheet is added at a given index, all subsequent sheets' indexes are incremented. To add an object sheet, use AddChartRequest instead and specify EmbeddedObjectPosition.sheetId or EmbeddedObjectPosition.newSheet.
409///
410/// This type is not used in any activity, and only used as *part* of another schema.
411///
412#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
413#[serde_with::serde_as]
414#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
415pub struct AddSheetRequest {
416 /// The properties the new sheet should have. All properties are optional. The sheetId field is optional; if one is not set, an id will be randomly generated. (It is an error to specify the ID of a sheet that already exists.)
417 pub properties: Option<SheetProperties>,
418}
419
420impl common::Part for AddSheetRequest {}
421
422/// The result of adding a sheet.
423///
424/// This type is not used in any activity, and only used as *part* of another schema.
425///
426#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
427#[serde_with::serde_as]
428#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
429pub struct AddSheetResponse {
430 /// The properties of the newly added sheet.
431 pub properties: Option<SheetProperties>,
432}
433
434impl common::Part for AddSheetResponse {}
435
436/// Adds a slicer to a sheet in the spreadsheet.
437///
438/// This type is not used in any activity, and only used as *part* of another schema.
439///
440#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
441#[serde_with::serde_as]
442#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
443pub struct AddSlicerRequest {
444 /// The slicer that should be added to the spreadsheet, including the position where it should be placed. The slicerId field is optional; if one is not set, an id will be randomly generated. (It is an error to specify the ID of a slicer that already exists.)
445 pub slicer: Option<Slicer>,
446}
447
448impl common::Part for AddSlicerRequest {}
449
450/// The result of adding a slicer to a spreadsheet.
451///
452/// This type is not used in any activity, and only used as *part* of another schema.
453///
454#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
455#[serde_with::serde_as]
456#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
457pub struct AddSlicerResponse {
458 /// The newly added slicer.
459 pub slicer: Option<Slicer>,
460}
461
462impl common::Part for AddSlicerResponse {}
463
464/// Adds new cells after the last row with data in a sheet, inserting new rows into the sheet if necessary.
465///
466/// This type is not used in any activity, and only used as *part* of another schema.
467///
468#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
469#[serde_with::serde_as]
470#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
471pub struct AppendCellsRequest {
472 /// 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.
473 pub fields: Option<common::FieldMask>,
474 /// The data to append.
475 pub rows: Option<Vec<RowData>>,
476 /// The sheet ID to append the data to.
477 #[serde(rename = "sheetId")]
478 pub sheet_id: Option<i32>,
479}
480
481impl common::Part for AppendCellsRequest {}
482
483/// Appends rows or columns to the end of a sheet.
484///
485/// This type is not used in any activity, and only used as *part* of another schema.
486///
487#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
488#[serde_with::serde_as]
489#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
490pub struct AppendDimensionRequest {
491 /// Whether rows or columns should be appended.
492 pub dimension: Option<String>,
493 /// The number of rows or columns to append.
494 pub length: Option<i32>,
495 /// The sheet to append rows or columns to.
496 #[serde(rename = "sheetId")]
497 pub sheet_id: Option<i32>,
498}
499
500impl common::Part for AppendDimensionRequest {}
501
502/// The response when updating a range of values in a spreadsheet.
503///
504/// # Activities
505///
506/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
507/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
508///
509/// * [values append spreadsheets](SpreadsheetValueAppendCall) (response)
510#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
511#[serde_with::serde_as]
512#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
513pub struct AppendValuesResponse {
514 /// The spreadsheet the updates were applied to.
515 #[serde(rename = "spreadsheetId")]
516 pub spreadsheet_id: Option<String>,
517 /// The range (in A1 notation) of the table that values are being appended to (before the values were appended). Empty if no table was found.
518 #[serde(rename = "tableRange")]
519 pub table_range: Option<String>,
520 /// Information about the updates that were applied.
521 pub updates: Option<UpdateValuesResponse>,
522}
523
524impl common::ResponseResult for AppendValuesResponse {}
525
526/// Fills in more data based on existing data.
527///
528/// This type is not used in any activity, and only used as *part* of another schema.
529///
530#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
531#[serde_with::serde_as]
532#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
533pub struct AutoFillRequest {
534 /// The range to autofill. This will examine the range and detect the location that has data and automatically fill that data in to the rest of the range.
535 pub range: Option<GridRange>,
536 /// The source and destination areas to autofill. This explicitly lists the source of the autofill and where to extend that data.
537 #[serde(rename = "sourceAndDestination")]
538 pub source_and_destination: Option<SourceAndDestination>,
539 /// True if we should generate data with the "alternate" series. This differs based on the type and amount of source data.
540 #[serde(rename = "useAlternateSeries")]
541 pub use_alternate_series: Option<bool>,
542}
543
544impl common::Part for AutoFillRequest {}
545
546/// Automatically resizes one or more dimensions based on the contents of the cells in that dimension.
547///
548/// This type is not used in any activity, and only used as *part* of another schema.
549///
550#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
551#[serde_with::serde_as]
552#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
553pub struct AutoResizeDimensionsRequest {
554 /// The dimensions on a data source sheet to automatically resize.
555 #[serde(rename = "dataSourceSheetDimensions")]
556 pub data_source_sheet_dimensions: Option<DataSourceSheetDimensionRange>,
557 /// The dimensions to automatically resize.
558 pub dimensions: Option<DimensionRange>,
559}
560
561impl common::Part for AutoResizeDimensionsRequest {}
562
563/// A banded (alternating colors) range in a sheet.
564///
565/// This type is not used in any activity, and only used as *part* of another schema.
566///
567#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
568#[serde_with::serde_as]
569#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
570pub struct BandedRange {
571 /// The ID of the banded range.
572 #[serde(rename = "bandedRangeId")]
573 pub banded_range_id: Option<i32>,
574 /// 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.
575 #[serde(rename = "columnProperties")]
576 pub column_properties: Option<BandingProperties>,
577 /// The range over which these properties are applied.
578 pub range: Option<GridRange>,
579 /// Properties for row bands. These properties are applied on a row-by-row basis throughout all the rows in the range. At least one of row_properties or column_properties must be specified.
580 #[serde(rename = "rowProperties")]
581 pub row_properties: Option<BandingProperties>,
582}
583
584impl common::Part for BandedRange {}
585
586/// Properties referring a single dimension (either row or column). If both BandedRange.row_properties and BandedRange.column_properties are set, the fill colors are applied to cells according to the following rules: * header_color and footer_color take priority over band colors. * first_band_color takes priority over second_band_color. * row_properties takes priority over column_properties. For example, the first row color takes priority over the first column color, but the first column color takes priority over the second row color. Similarly, the row header takes priority over the column header in the top left cell, but the column header takes priority over the first row color if the row header is not set.
587///
588/// This type is not used in any activity, and only used as *part* of another schema.
589///
590#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
591#[serde_with::serde_as]
592#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
593pub struct BandingProperties {
594 /// The first color that is alternating. (Required) Deprecated: Use first_band_color_style.
595 #[serde(rename = "firstBandColor")]
596 pub first_band_color: Option<Color>,
597 /// The first color that is alternating. (Required) If first_band_color is also set, this field takes precedence.
598 #[serde(rename = "firstBandColorStyle")]
599 pub first_band_color_style: Option<ColorStyle>,
600 /// The color of the last row or column. If this field is not set, the last row or column is filled with either first_band_color or second_band_color, depending on the color of the previous row or column. Deprecated: Use footer_color_style.
601 #[serde(rename = "footerColor")]
602 pub footer_color: Option<Color>,
603 /// The color of the last row or column. If this field is not set, the last row or column is filled with either first_band_color or second_band_color, depending on the color of the previous row or column. If footer_color is also set, this field takes precedence.
604 #[serde(rename = "footerColorStyle")]
605 pub footer_color_style: Option<ColorStyle>,
606 /// The color of the first row or column. If this field is set, the first row or column is filled with this color and the colors alternate between first_band_color and second_band_color starting from the second row or column. Otherwise, the first row or column is filled with first_band_color and the colors proceed to alternate as they normally would. Deprecated: Use header_color_style.
607 #[serde(rename = "headerColor")]
608 pub header_color: Option<Color>,
609 /// The color of the first row or column. If this field is set, the first row or column is filled with this color and the colors alternate between first_band_color and second_band_color starting from the second row or column. Otherwise, the first row or column is filled with first_band_color and the colors proceed to alternate as they normally would. If header_color is also set, this field takes precedence.
610 #[serde(rename = "headerColorStyle")]
611 pub header_color_style: Option<ColorStyle>,
612 /// The second color that is alternating. (Required) Deprecated: Use second_band_color_style.
613 #[serde(rename = "secondBandColor")]
614 pub second_band_color: Option<Color>,
615 /// The second color that is alternating. (Required) If second_band_color is also set, this field takes precedence.
616 #[serde(rename = "secondBandColorStyle")]
617 pub second_band_color_style: Option<ColorStyle>,
618}
619
620impl common::Part for BandingProperties {}
621
622/// Formatting options for baseline value.
623///
624/// This type is not used in any activity, and only used as *part* of another schema.
625///
626#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
627#[serde_with::serde_as]
628#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
629pub struct BaselineValueFormat {
630 /// The comparison type of key value with baseline value.
631 #[serde(rename = "comparisonType")]
632 pub comparison_type: Option<String>,
633 /// Description which is appended after the baseline value. This field is optional.
634 pub description: Option<String>,
635 /// Color to be used, in case baseline value represents a negative change for key value. This field is optional. Deprecated: Use negative_color_style.
636 #[serde(rename = "negativeColor")]
637 pub negative_color: Option<Color>,
638 /// Color to be used, in case baseline value represents a negative change for key value. This field is optional. If negative_color is also set, this field takes precedence.
639 #[serde(rename = "negativeColorStyle")]
640 pub negative_color_style: Option<ColorStyle>,
641 /// Specifies the horizontal text positioning of baseline value. This field is optional. If not specified, default positioning is used.
642 pub position: Option<TextPosition>,
643 /// Color to be used, in case baseline value represents a positive change for key value. This field is optional. Deprecated: Use positive_color_style.
644 #[serde(rename = "positiveColor")]
645 pub positive_color: Option<Color>,
646 /// Color to be used, in case baseline value represents a positive change for key value. This field is optional. If positive_color is also set, this field takes precedence.
647 #[serde(rename = "positiveColorStyle")]
648 pub positive_color_style: Option<ColorStyle>,
649 /// Text formatting options for baseline value. The link field is not supported.
650 #[serde(rename = "textFormat")]
651 pub text_format: Option<TextFormat>,
652}
653
654impl common::Part for BaselineValueFormat {}
655
656/// An axis of the chart. A chart may not have more than one axis per axis position.
657///
658/// This type is not used in any activity, and only used as *part* of another schema.
659///
660#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
661#[serde_with::serde_as]
662#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
663pub struct BasicChartAxis {
664 /// The format of the title. Only valid if the axis is not associated with the domain. The link field is not supported.
665 pub format: Option<TextFormat>,
666 /// The position of this axis.
667 pub position: Option<String>,
668 /// The title of this axis. If set, this overrides any title inferred from headers of the data.
669 pub title: Option<String>,
670 /// The axis title text position.
671 #[serde(rename = "titleTextPosition")]
672 pub title_text_position: Option<TextPosition>,
673 /// The view window options for this axis.
674 #[serde(rename = "viewWindowOptions")]
675 pub view_window_options: Option<ChartAxisViewWindowOptions>,
676}
677
678impl common::Part for BasicChartAxis {}
679
680/// The domain of a chart. For example, if charting stock prices over time, this would be the date.
681///
682/// This type is not used in any activity, and only used as *part* of another schema.
683///
684#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
685#[serde_with::serde_as]
686#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
687pub struct BasicChartDomain {
688 /// The data of the domain. For example, if charting stock prices over time, this is the data representing the dates.
689 pub domain: Option<ChartData>,
690 /// True to reverse the order of the domain values (horizontal axis).
691 pub reversed: Option<bool>,
692}
693
694impl common::Part for BasicChartDomain {}
695
696/// A single series of data in a chart. For example, if charting stock prices over time, multiple series may exist, one for the "Open Price", "High Price", "Low Price" and "Close Price".
697///
698/// This type is not used in any activity, and only used as *part* of another schema.
699///
700#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
701#[serde_with::serde_as]
702#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
703pub struct BasicChartSeries {
704 /// The color for elements (such as bars, lines, and points) associated with this series. If empty, a default color is used. Deprecated: Use color_style.
705 pub color: Option<Color>,
706 /// The color for elements (such as bars, lines, and points) associated with this series. If empty, a default color is used. If color is also set, this field takes precedence.
707 #[serde(rename = "colorStyle")]
708 pub color_style: Option<ColorStyle>,
709 /// Information about the data labels for this series.
710 #[serde(rename = "dataLabel")]
711 pub data_label: Option<DataLabel>,
712 /// The line style of this series. Valid only if the chartType is AREA, LINE, or SCATTER. COMBO charts are also supported if the series chart type is AREA or LINE.
713 #[serde(rename = "lineStyle")]
714 pub line_style: Option<LineStyle>,
715 /// The style for points associated with this series. Valid only if the chartType is AREA, LINE, or SCATTER. COMBO charts are also supported if the series chart type is AREA, LINE, or SCATTER. If empty, a default point style is used.
716 #[serde(rename = "pointStyle")]
717 pub point_style: Option<PointStyle>,
718 /// The data being visualized in this chart series.
719 pub series: Option<ChartData>,
720 /// Style override settings for series data points.
721 #[serde(rename = "styleOverrides")]
722 pub style_overrides: Option<Vec<BasicSeriesDataPointStyleOverride>>,
723 /// The minor axis that will specify the range of values for this series. For example, if charting stocks over time, the "Volume" series may want to be pinned to the right with the prices pinned to the left, because the scale of trading volume is different than the scale of prices. It is an error to specify an axis that isn't a valid minor axis for the chart's type.
724 #[serde(rename = "targetAxis")]
725 pub target_axis: Option<String>,
726 /// The type of this series. Valid only if the chartType is COMBO. Different types will change the way the series is visualized. Only LINE, AREA, and COLUMN are supported.
727 #[serde(rename = "type")]
728 pub type_: Option<String>,
729}
730
731impl common::Part for BasicChartSeries {}
732
733/// The specification for a basic chart. See BasicChartType for the list of charts this supports.
734///
735/// This type is not used in any activity, and only used as *part* of another schema.
736///
737#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
738#[serde_with::serde_as]
739#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
740pub struct BasicChartSpec {
741 /// The axis on the chart.
742 pub axis: Option<Vec<BasicChartAxis>>,
743 /// The type of the chart.
744 #[serde(rename = "chartType")]
745 pub chart_type: Option<String>,
746 /// The behavior of tooltips and data highlighting when hovering on data and chart area.
747 #[serde(rename = "compareMode")]
748 pub compare_mode: Option<String>,
749 /// The domain of data this is charting. Only a single domain is supported.
750 pub domains: Option<Vec<BasicChartDomain>>,
751 /// The number of rows or columns in the data that are "headers". If not set, Google Sheets will guess how many rows are headers based on the data. (Note that BasicChartAxis.title may override the axis title inferred from the header values.)
752 #[serde(rename = "headerCount")]
753 pub header_count: Option<i32>,
754 /// If some values in a series are missing, gaps may appear in the chart (e.g, segments of lines in a line chart will be missing). To eliminate these gaps set this to true. Applies to Line, Area, and Combo charts.
755 #[serde(rename = "interpolateNulls")]
756 pub interpolate_nulls: Option<bool>,
757 /// The position of the chart legend.
758 #[serde(rename = "legendPosition")]
759 pub legend_position: Option<String>,
760 /// Gets whether all lines should be rendered smooth or straight by default. Applies to Line charts.
761 #[serde(rename = "lineSmoothing")]
762 pub line_smoothing: Option<bool>,
763 /// The data this chart is visualizing.
764 pub series: Option<Vec<BasicChartSeries>>,
765 /// The stacked type for charts that support vertical stacking. Applies to Area, Bar, Column, Combo, and Stepped Area charts.
766 #[serde(rename = "stackedType")]
767 pub stacked_type: Option<String>,
768 /// True to make the chart 3D. Applies to Bar and Column charts.
769 #[serde(rename = "threeDimensional")]
770 pub three_dimensional: Option<bool>,
771 /// Controls whether to display additional data labels on stacked charts which sum the total value of all stacked values at each value along the domain axis. These data labels can only be set when chart_type is one of AREA, BAR, COLUMN, COMBO or STEPPED_AREA and stacked_type is either STACKED or PERCENT_STACKED. In addition, for COMBO, this will only be supported if there is only one type of stackable series type or one type has more series than the others and each of the other types have no more than one series. For example, if a chart has two stacked bar series and one area series, the total data labels will be supported. If it has three bar series and two area series, total data labels are not allowed. Neither CUSTOM nor placement can be set on the total_data_label.
772 #[serde(rename = "totalDataLabel")]
773 pub total_data_label: Option<DataLabel>,
774}
775
776impl common::Part for BasicChartSpec {}
777
778/// The default filter associated with a sheet.
779///
780/// This type is not used in any activity, and only used as *part* of another schema.
781///
782#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
783#[serde_with::serde_as]
784#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
785pub struct BasicFilter {
786 /// The criteria for showing/hiding values per column. The map's key is the column index, and the value is the criteria for that column. This field is deprecated in favor of filter_specs.
787 pub criteria: Option<HashMap<String, FilterCriteria>>,
788 /// The filter criteria per column. Both criteria and filter_specs are populated in responses. If both fields are specified in an update request, this field takes precedence.
789 #[serde(rename = "filterSpecs")]
790 pub filter_specs: Option<Vec<FilterSpec>>,
791 /// The range the filter covers.
792 pub range: Option<GridRange>,
793 /// The sort order per column. Later specifications are used when values are equal in the earlier specifications.
794 #[serde(rename = "sortSpecs")]
795 pub sort_specs: Option<Vec<SortSpec>>,
796}
797
798impl common::Part for BasicFilter {}
799
800/// Style override settings for a single series data point.
801///
802/// This type is not used in any activity, and only used as *part* of another schema.
803///
804#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
805#[serde_with::serde_as]
806#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
807pub struct BasicSeriesDataPointStyleOverride {
808 /// Color of the series data point. If empty, the series default is used. Deprecated: Use color_style.
809 pub color: Option<Color>,
810 /// Color of the series data point. If empty, the series default is used. If color is also set, this field takes precedence.
811 #[serde(rename = "colorStyle")]
812 pub color_style: Option<ColorStyle>,
813 /// The zero-based index of the series data point.
814 pub index: Option<i32>,
815 /// Point style of the series data point. Valid only if the chartType is AREA, LINE, or SCATTER. COMBO charts are also supported if the series chart type is AREA, LINE, or SCATTER. If empty, the series default is used.
816 #[serde(rename = "pointStyle")]
817 pub point_style: Option<PointStyle>,
818}
819
820impl common::Part for BasicSeriesDataPointStyleOverride {}
821
822/// The request for clearing more than one range selected by a DataFilter in a spreadsheet.
823///
824/// # Activities
825///
826/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
827/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
828///
829/// * [values batch clear by data filter spreadsheets](SpreadsheetValueBatchClearByDataFilterCall) (request)
830#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
831#[serde_with::serde_as]
832#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
833pub struct BatchClearValuesByDataFilterRequest {
834 /// The DataFilters used to determine which ranges to clear.
835 #[serde(rename = "dataFilters")]
836 pub data_filters: Option<Vec<DataFilter>>,
837}
838
839impl common::RequestValue for BatchClearValuesByDataFilterRequest {}
840
841/// The response when clearing a range of values selected with DataFilters in a spreadsheet.
842///
843/// # Activities
844///
845/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
846/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
847///
848/// * [values batch clear by data filter spreadsheets](SpreadsheetValueBatchClearByDataFilterCall) (response)
849#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
850#[serde_with::serde_as]
851#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
852pub struct BatchClearValuesByDataFilterResponse {
853 /// The ranges that were cleared, in [A1 notation](https://developers.google.com/sheets/api/guides/concepts#cell). 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.
854 #[serde(rename = "clearedRanges")]
855 pub cleared_ranges: Option<Vec<String>>,
856 /// The spreadsheet the updates were applied to.
857 #[serde(rename = "spreadsheetId")]
858 pub spreadsheet_id: Option<String>,
859}
860
861impl common::ResponseResult for BatchClearValuesByDataFilterResponse {}
862
863/// The request for clearing more than one range of values in a spreadsheet.
864///
865/// # Activities
866///
867/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
868/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
869///
870/// * [values batch clear spreadsheets](SpreadsheetValueBatchClearCall) (request)
871#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
872#[serde_with::serde_as]
873#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
874pub struct BatchClearValuesRequest {
875 /// The ranges to clear, in [A1 notation or R1C1 notation](https://developers.google.com/sheets/api/guides/concepts#cell).
876 pub ranges: Option<Vec<String>>,
877}
878
879impl common::RequestValue for BatchClearValuesRequest {}
880
881/// The response when clearing a range of values in a spreadsheet.
882///
883/// # Activities
884///
885/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
886/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
887///
888/// * [values batch clear spreadsheets](SpreadsheetValueBatchClearCall) (response)
889#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
890#[serde_with::serde_as]
891#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
892pub struct BatchClearValuesResponse {
893 /// 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.
894 #[serde(rename = "clearedRanges")]
895 pub cleared_ranges: Option<Vec<String>>,
896 /// The spreadsheet the updates were applied to.
897 #[serde(rename = "spreadsheetId")]
898 pub spreadsheet_id: Option<String>,
899}
900
901impl common::ResponseResult for BatchClearValuesResponse {}
902
903/// The request for retrieving a range of values in a spreadsheet selected by a set of DataFilters.
904///
905/// # Activities
906///
907/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
908/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
909///
910/// * [values batch get by data filter spreadsheets](SpreadsheetValueBatchGetByDataFilterCall) (request)
911#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
912#[serde_with::serde_as]
913#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
914pub struct BatchGetValuesByDataFilterRequest {
915 /// The data filters used to match the ranges of values to retrieve. Ranges that match any of the specified data filters are included in the response.
916 #[serde(rename = "dataFilters")]
917 pub data_filters: Option<Vec<DataFilter>>,
918 /// 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.
919 #[serde(rename = "dateTimeRenderOption")]
920 pub date_time_render_option: Option<String>,
921 /// The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then a request that selects that range and sets `majorDimension=ROWS` returns `[[1,2],[3,4]]`, whereas a request that sets `majorDimension=COLUMNS` returns `[[1,3],[2,4]]`.
922 #[serde(rename = "majorDimension")]
923 pub major_dimension: Option<String>,
924 /// How values should be represented in the output. The default render option is FORMATTED_VALUE.
925 #[serde(rename = "valueRenderOption")]
926 pub value_render_option: Option<String>,
927}
928
929impl common::RequestValue for BatchGetValuesByDataFilterRequest {}
930
931/// The response when retrieving more than one range of values in a spreadsheet selected by DataFilters.
932///
933/// # Activities
934///
935/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
936/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
937///
938/// * [values batch get by data filter spreadsheets](SpreadsheetValueBatchGetByDataFilterCall) (response)
939#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
940#[serde_with::serde_as]
941#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
942pub struct BatchGetValuesByDataFilterResponse {
943 /// The ID of the spreadsheet the data was retrieved from.
944 #[serde(rename = "spreadsheetId")]
945 pub spreadsheet_id: Option<String>,
946 /// The requested values with the list of data filters that matched them.
947 #[serde(rename = "valueRanges")]
948 pub value_ranges: Option<Vec<MatchedValueRange>>,
949}
950
951impl common::ResponseResult for BatchGetValuesByDataFilterResponse {}
952
953/// The response when retrieving more than one range of values in a spreadsheet.
954///
955/// # Activities
956///
957/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
958/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
959///
960/// * [values batch get spreadsheets](SpreadsheetValueBatchGetCall) (response)
961#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
962#[serde_with::serde_as]
963#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
964pub struct BatchGetValuesResponse {
965 /// The ID of the spreadsheet the data was retrieved from.
966 #[serde(rename = "spreadsheetId")]
967 pub spreadsheet_id: Option<String>,
968 /// The requested values. The order of the ValueRanges is the same as the order of the requested ranges.
969 #[serde(rename = "valueRanges")]
970 pub value_ranges: Option<Vec<ValueRange>>,
971}
972
973impl common::ResponseResult for BatchGetValuesResponse {}
974
975/// The request for updating any aspect of a spreadsheet.
976///
977/// # Activities
978///
979/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
980/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
981///
982/// * [batch update spreadsheets](SpreadsheetBatchUpdateCall) (request)
983#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
984#[serde_with::serde_as]
985#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
986pub struct BatchUpdateSpreadsheetRequest {
987 /// Determines if the update response should include the spreadsheet resource.
988 #[serde(rename = "includeSpreadsheetInResponse")]
989 pub include_spreadsheet_in_response: Option<bool>,
990 /// A list of updates to apply to the spreadsheet. Requests will be applied in the order they are specified. If any request is not valid, no requests will be applied.
991 pub requests: Option<Vec<Request>>,
992 /// True if grid data should be returned. Meaningful only if include_spreadsheet_in_response is 'true'. This parameter is ignored if a field mask was set in the request.
993 #[serde(rename = "responseIncludeGridData")]
994 pub response_include_grid_data: Option<bool>,
995 /// Limits the ranges included in the response spreadsheet. Meaningful only if include_spreadsheet_in_response is 'true'.
996 #[serde(rename = "responseRanges")]
997 pub response_ranges: Option<Vec<String>>,
998}
999
1000impl common::RequestValue for BatchUpdateSpreadsheetRequest {}
1001
1002/// The reply for batch updating a spreadsheet.
1003///
1004/// # Activities
1005///
1006/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1007/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1008///
1009/// * [batch update spreadsheets](SpreadsheetBatchUpdateCall) (response)
1010#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1011#[serde_with::serde_as]
1012#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1013pub struct BatchUpdateSpreadsheetResponse {
1014 /// The reply of the updates. This maps 1:1 with the updates, although replies to some requests may be empty.
1015 pub replies: Option<Vec<Response>>,
1016 /// The spreadsheet the updates were applied to.
1017 #[serde(rename = "spreadsheetId")]
1018 pub spreadsheet_id: Option<String>,
1019 /// The spreadsheet after updates were applied. This is only set if BatchUpdateSpreadsheetRequest.include_spreadsheet_in_response is `true`.
1020 #[serde(rename = "updatedSpreadsheet")]
1021 pub updated_spreadsheet: Option<Spreadsheet>,
1022}
1023
1024impl common::ResponseResult for BatchUpdateSpreadsheetResponse {}
1025
1026/// The request for updating more than one range of values in a spreadsheet.
1027///
1028/// # Activities
1029///
1030/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1031/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1032///
1033/// * [values batch update by data filter spreadsheets](SpreadsheetValueBatchUpdateByDataFilterCall) (request)
1034#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1035#[serde_with::serde_as]
1036#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1037pub struct BatchUpdateValuesByDataFilterRequest {
1038 /// The new values to apply to the spreadsheet. If more than one range is matched by the specified DataFilter the specified values are applied to all of those ranges.
1039 pub data: Option<Vec<DataFilterValueRange>>,
1040 /// Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. The `updatedData` field within each of the BatchUpdateValuesResponse.responses contains 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).
1041 #[serde(rename = "includeValuesInResponse")]
1042 pub include_values_in_response: Option<bool>,
1043 /// 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.
1044 #[serde(rename = "responseDateTimeRenderOption")]
1045 pub response_date_time_render_option: Option<String>,
1046 /// Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
1047 #[serde(rename = "responseValueRenderOption")]
1048 pub response_value_render_option: Option<String>,
1049 /// How the input data should be interpreted.
1050 #[serde(rename = "valueInputOption")]
1051 pub value_input_option: Option<String>,
1052}
1053
1054impl common::RequestValue for BatchUpdateValuesByDataFilterRequest {}
1055
1056/// The response when updating a range of values in a spreadsheet.
1057///
1058/// # Activities
1059///
1060/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1061/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1062///
1063/// * [values batch update by data filter spreadsheets](SpreadsheetValueBatchUpdateByDataFilterCall) (response)
1064#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1065#[serde_with::serde_as]
1066#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1067pub struct BatchUpdateValuesByDataFilterResponse {
1068 /// The response for each range updated.
1069 pub responses: Option<Vec<UpdateValuesByDataFilterResponse>>,
1070 /// The spreadsheet the updates were applied to.
1071 #[serde(rename = "spreadsheetId")]
1072 pub spreadsheet_id: Option<String>,
1073 /// The total number of cells updated.
1074 #[serde(rename = "totalUpdatedCells")]
1075 pub total_updated_cells: Option<i32>,
1076 /// The total number of columns where at least one cell in the column was updated.
1077 #[serde(rename = "totalUpdatedColumns")]
1078 pub total_updated_columns: Option<i32>,
1079 /// The total number of rows where at least one cell in the row was updated.
1080 #[serde(rename = "totalUpdatedRows")]
1081 pub total_updated_rows: Option<i32>,
1082 /// The total number of sheets where at least one cell in the sheet was updated.
1083 #[serde(rename = "totalUpdatedSheets")]
1084 pub total_updated_sheets: Option<i32>,
1085}
1086
1087impl common::ResponseResult for BatchUpdateValuesByDataFilterResponse {}
1088
1089/// The request for updating more than one range of values in a spreadsheet.
1090///
1091/// # Activities
1092///
1093/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1094/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1095///
1096/// * [values batch update spreadsheets](SpreadsheetValueBatchUpdateCall) (request)
1097#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1098#[serde_with::serde_as]
1099#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1100pub struct BatchUpdateValuesRequest {
1101 /// The new values to apply to the spreadsheet.
1102 pub data: Option<Vec<ValueRange>>,
1103 /// Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. The `updatedData` field within each of the BatchUpdateValuesResponse.responses contains 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).
1104 #[serde(rename = "includeValuesInResponse")]
1105 pub include_values_in_response: Option<bool>,
1106 /// 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.
1107 #[serde(rename = "responseDateTimeRenderOption")]
1108 pub response_date_time_render_option: Option<String>,
1109 /// Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
1110 #[serde(rename = "responseValueRenderOption")]
1111 pub response_value_render_option: Option<String>,
1112 /// How the input data should be interpreted.
1113 #[serde(rename = "valueInputOption")]
1114 pub value_input_option: Option<String>,
1115}
1116
1117impl common::RequestValue for BatchUpdateValuesRequest {}
1118
1119/// The response when updating a range of values in a spreadsheet.
1120///
1121/// # Activities
1122///
1123/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1124/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1125///
1126/// * [values batch update spreadsheets](SpreadsheetValueBatchUpdateCall) (response)
1127#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1128#[serde_with::serde_as]
1129#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1130pub struct BatchUpdateValuesResponse {
1131 /// One UpdateValuesResponse per requested range, in the same order as the requests appeared.
1132 pub responses: Option<Vec<UpdateValuesResponse>>,
1133 /// The spreadsheet the updates were applied to.
1134 #[serde(rename = "spreadsheetId")]
1135 pub spreadsheet_id: Option<String>,
1136 /// The total number of cells updated.
1137 #[serde(rename = "totalUpdatedCells")]
1138 pub total_updated_cells: Option<i32>,
1139 /// The total number of columns where at least one cell in the column was updated.
1140 #[serde(rename = "totalUpdatedColumns")]
1141 pub total_updated_columns: Option<i32>,
1142 /// The total number of rows where at least one cell in the row was updated.
1143 #[serde(rename = "totalUpdatedRows")]
1144 pub total_updated_rows: Option<i32>,
1145 /// The total number of sheets where at least one cell in the sheet was updated.
1146 #[serde(rename = "totalUpdatedSheets")]
1147 pub total_updated_sheets: Option<i32>,
1148}
1149
1150impl common::ResponseResult for BatchUpdateValuesResponse {}
1151
1152/// The specification of a BigQuery data source that's connected to a sheet.
1153///
1154/// This type is not used in any activity, and only used as *part* of another schema.
1155///
1156#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1157#[serde_with::serde_as]
1158#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1159pub struct BigQueryDataSourceSpec {
1160 /// The ID of a BigQuery enabled Google Cloud project with a billing account attached. For any queries executed against the data source, the project is charged.
1161 #[serde(rename = "projectId")]
1162 pub project_id: Option<String>,
1163 /// A BigQueryQuerySpec.
1164 #[serde(rename = "querySpec")]
1165 pub query_spec: Option<BigQueryQuerySpec>,
1166 /// A BigQueryTableSpec.
1167 #[serde(rename = "tableSpec")]
1168 pub table_spec: Option<BigQueryTableSpec>,
1169}
1170
1171impl common::Part for BigQueryDataSourceSpec {}
1172
1173/// Specifies a custom BigQuery query.
1174///
1175/// This type is not used in any activity, and only used as *part* of another schema.
1176///
1177#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1178#[serde_with::serde_as]
1179#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1180pub struct BigQueryQuerySpec {
1181 /// The raw query string.
1182 #[serde(rename = "rawQuery")]
1183 pub raw_query: Option<String>,
1184}
1185
1186impl common::Part for BigQueryQuerySpec {}
1187
1188/// Specifies a BigQuery table definition. Only [native tables](https://cloud.google.com/bigquery/docs/tables-intro) are allowed.
1189///
1190/// This type is not used in any activity, and only used as *part* of another schema.
1191///
1192#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1193#[serde_with::serde_as]
1194#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1195pub struct BigQueryTableSpec {
1196 /// The BigQuery dataset id.
1197 #[serde(rename = "datasetId")]
1198 pub dataset_id: Option<String>,
1199 /// The BigQuery table id.
1200 #[serde(rename = "tableId")]
1201 pub table_id: Option<String>,
1202 /// The ID of a BigQuery project the table belongs to. If not specified, the project_id is assumed.
1203 #[serde(rename = "tableProjectId")]
1204 pub table_project_id: Option<String>,
1205}
1206
1207impl common::Part for BigQueryTableSpec {}
1208
1209/// A condition that can evaluate to true or false. BooleanConditions are used by conditional formatting, data validation, and the criteria in filters.
1210///
1211/// This type is not used in any activity, and only used as *part* of another schema.
1212///
1213#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1214#[serde_with::serde_as]
1215#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1216pub struct BooleanCondition {
1217 /// The type of condition.
1218 #[serde(rename = "type")]
1219 pub type_: Option<String>,
1220 /// The values of the condition. The number of supported values depends on the condition type. Some support zero values, others one or two values, and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
1221 pub values: Option<Vec<ConditionValue>>,
1222}
1223
1224impl common::Part for BooleanCondition {}
1225
1226/// A rule that may or may not match, depending on the condition.
1227///
1228/// This type is not used in any activity, and only used as *part* of another schema.
1229///
1230#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1231#[serde_with::serde_as]
1232#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1233pub struct BooleanRule {
1234 /// The condition of the rule. If the condition evaluates to true, the format is applied.
1235 pub condition: Option<BooleanCondition>,
1236 /// The format to apply. Conditional formatting can only apply a subset of formatting: bold, italic, strikethrough, foreground color and, background color.
1237 pub format: Option<CellFormat>,
1238}
1239
1240impl common::Part for BooleanRule {}
1241
1242/// A border along a cell.
1243///
1244/// This type is not used in any activity, and only used as *part* of another schema.
1245///
1246#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1247#[serde_with::serde_as]
1248#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1249pub struct Border {
1250 /// The color of the border. Deprecated: Use color_style.
1251 pub color: Option<Color>,
1252 /// The color of the border. If color is also set, this field takes precedence.
1253 #[serde(rename = "colorStyle")]
1254 pub color_style: Option<ColorStyle>,
1255 /// The style of the border.
1256 pub style: Option<String>,
1257 /// The width of the border, in pixels. Deprecated; the width is determined by the "style" field.
1258 pub width: Option<i32>,
1259}
1260
1261impl common::Part for Border {}
1262
1263/// The borders of the cell.
1264///
1265/// This type is not used in any activity, and only used as *part* of another schema.
1266///
1267#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1268#[serde_with::serde_as]
1269#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1270pub struct Borders {
1271 /// The bottom border of the cell.
1272 pub bottom: Option<Border>,
1273 /// The left border of the cell.
1274 pub left: Option<Border>,
1275 /// The right border of the cell.
1276 pub right: Option<Border>,
1277 /// The top border of the cell.
1278 pub top: Option<Border>,
1279}
1280
1281impl common::Part for Borders {}
1282
1283/// A bubble chart.
1284///
1285/// This type is not used in any activity, and only used as *part* of another schema.
1286///
1287#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1288#[serde_with::serde_as]
1289#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1290pub struct BubbleChartSpec {
1291 /// The bubble border color. Deprecated: Use bubble_border_color_style.
1292 #[serde(rename = "bubbleBorderColor")]
1293 pub bubble_border_color: Option<Color>,
1294 /// The bubble border color. If bubble_border_color is also set, this field takes precedence.
1295 #[serde(rename = "bubbleBorderColorStyle")]
1296 pub bubble_border_color_style: Option<ColorStyle>,
1297 /// The data containing the bubble labels. These do not need to be unique.
1298 #[serde(rename = "bubbleLabels")]
1299 pub bubble_labels: Option<ChartData>,
1300 /// The max radius size of the bubbles, in pixels. If specified, the field must be a positive value.
1301 #[serde(rename = "bubbleMaxRadiusSize")]
1302 pub bubble_max_radius_size: Option<i32>,
1303 /// The minimum radius size of the bubbles, in pixels. If specific, the field must be a positive value.
1304 #[serde(rename = "bubbleMinRadiusSize")]
1305 pub bubble_min_radius_size: Option<i32>,
1306 /// The opacity of the bubbles between 0 and 1.0. 0 is fully transparent and 1 is fully opaque.
1307 #[serde(rename = "bubbleOpacity")]
1308 pub bubble_opacity: Option<f32>,
1309 /// The data containing the bubble sizes. Bubble sizes are used to draw the bubbles at different sizes relative to each other. If specified, group_ids must also be specified. This field is optional.
1310 #[serde(rename = "bubbleSizes")]
1311 pub bubble_sizes: Option<ChartData>,
1312 /// The format of the text inside the bubbles. Strikethrough, underline, and link are not supported.
1313 #[serde(rename = "bubbleTextStyle")]
1314 pub bubble_text_style: Option<TextFormat>,
1315 /// The data containing the bubble x-values. These values locate the bubbles in the chart horizontally.
1316 pub domain: Option<ChartData>,
1317 /// The data containing the bubble group IDs. All bubbles with the same group ID are drawn in the same color. If bubble_sizes is specified then this field must also be specified but may contain blank values. This field is optional.
1318 #[serde(rename = "groupIds")]
1319 pub group_ids: Option<ChartData>,
1320 /// Where the legend of the chart should be drawn.
1321 #[serde(rename = "legendPosition")]
1322 pub legend_position: Option<String>,
1323 /// The data containing the bubble y-values. These values locate the bubbles in the chart vertically.
1324 pub series: Option<ChartData>,
1325}
1326
1327impl common::Part for BubbleChartSpec {}
1328
1329/// Cancels one or multiple refreshes of data source objects in the spreadsheet by the specified references.
1330///
1331/// This type is not used in any activity, and only used as *part* of another schema.
1332///
1333#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1334#[serde_with::serde_as]
1335#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1336pub struct CancelDataSourceRefreshRequest {
1337 /// Reference to a DataSource. If specified, cancels all associated data source object refreshes for this data source.
1338 #[serde(rename = "dataSourceId")]
1339 pub data_source_id: Option<String>,
1340 /// Cancels all existing data source object refreshes for all data sources in the spreadsheet.
1341 #[serde(rename = "isAll")]
1342 pub is_all: Option<bool>,
1343 /// References to data source objects whose refreshes are to be cancelled.
1344 pub references: Option<DataSourceObjectReferences>,
1345}
1346
1347impl common::Part for CancelDataSourceRefreshRequest {}
1348
1349/// The response from cancelling one or multiple data source object refreshes.
1350///
1351/// This type is not used in any activity, and only used as *part* of another schema.
1352///
1353#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1354#[serde_with::serde_as]
1355#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1356pub struct CancelDataSourceRefreshResponse {
1357 /// The cancellation statuses of refreshes of all data source objects specified in the request. If is_all is specified, the field contains only those in failure status. Refreshing and canceling refresh the same data source object is also not allowed in the same `batchUpdate`.
1358 pub statuses: Option<Vec<CancelDataSourceRefreshStatus>>,
1359}
1360
1361impl common::Part for CancelDataSourceRefreshResponse {}
1362
1363/// The status of cancelling a single data source object refresh.
1364///
1365/// This type is not used in any activity, and only used as *part* of another schema.
1366///
1367#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1368#[serde_with::serde_as]
1369#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1370pub struct CancelDataSourceRefreshStatus {
1371 /// Reference to the data source object whose refresh is being cancelled.
1372 pub reference: Option<DataSourceObjectReference>,
1373 /// The cancellation status.
1374 #[serde(rename = "refreshCancellationStatus")]
1375 pub refresh_cancellation_status: Option<RefreshCancellationStatus>,
1376}
1377
1378impl common::Part for CancelDataSourceRefreshStatus {}
1379
1380/// A candlestick chart.
1381///
1382/// This type is not used in any activity, and only used as *part* of another schema.
1383///
1384#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1385#[serde_with::serde_as]
1386#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1387pub struct CandlestickChartSpec {
1388 /// The Candlestick chart data. Only one CandlestickData is supported.
1389 pub data: Option<Vec<CandlestickData>>,
1390 /// The domain data (horizontal axis) for the candlestick chart. String data will be treated as discrete labels, other data will be treated as continuous values.
1391 pub domain: Option<CandlestickDomain>,
1392}
1393
1394impl common::Part for CandlestickChartSpec {}
1395
1396/// The Candlestick chart data, each containing the low, open, close, and high values for a series.
1397///
1398/// This type is not used in any activity, and only used as *part* of another schema.
1399///
1400#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1401#[serde_with::serde_as]
1402#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1403pub struct CandlestickData {
1404 /// The range data (vertical axis) for the close/final value for each candle. This is the top of the candle body. If greater than the open value the candle will be filled. Otherwise the candle will be hollow.
1405 #[serde(rename = "closeSeries")]
1406 pub close_series: Option<CandlestickSeries>,
1407 /// The range data (vertical axis) for the high/maximum value for each candle. This is the top of the candle's center line.
1408 #[serde(rename = "highSeries")]
1409 pub high_series: Option<CandlestickSeries>,
1410 /// The range data (vertical axis) for the low/minimum value for each candle. This is the bottom of the candle's center line.
1411 #[serde(rename = "lowSeries")]
1412 pub low_series: Option<CandlestickSeries>,
1413 /// The range data (vertical axis) for the open/initial value for each candle. This is the bottom of the candle body. If less than the close value the candle will be filled. Otherwise the candle will be hollow.
1414 #[serde(rename = "openSeries")]
1415 pub open_series: Option<CandlestickSeries>,
1416}
1417
1418impl common::Part for CandlestickData {}
1419
1420/// The domain of a CandlestickChart.
1421///
1422/// This type is not used in any activity, and only used as *part* of another schema.
1423///
1424#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1425#[serde_with::serde_as]
1426#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1427pub struct CandlestickDomain {
1428 /// The data of the CandlestickDomain.
1429 pub data: Option<ChartData>,
1430 /// True to reverse the order of the domain values (horizontal axis).
1431 pub reversed: Option<bool>,
1432}
1433
1434impl common::Part for CandlestickDomain {}
1435
1436/// The series of a CandlestickData.
1437///
1438/// This type is not used in any activity, and only used as *part* of another schema.
1439///
1440#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1441#[serde_with::serde_as]
1442#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1443pub struct CandlestickSeries {
1444 /// The data of the CandlestickSeries.
1445 pub data: Option<ChartData>,
1446}
1447
1448impl common::Part for CandlestickSeries {}
1449
1450/// Data about a specific cell.
1451///
1452/// This type is not used in any activity, and only used as *part* of another schema.
1453///
1454#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1455#[serde_with::serde_as]
1456#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1457pub struct CellData {
1458 /// 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)`.
1459 #[serde(rename = "dataSourceFormula")]
1460 pub data_source_formula: Option<DataSourceFormula>,
1461 /// A data source table anchored at this cell. The size of data source table itself is computed dynamically based on its configuration. Only the first cell of the data source table contains the data source table definition. The other cells will contain the display values of the data source table result in their effective_value fields.
1462 #[serde(rename = "dataSourceTable")]
1463 pub data_source_table: Option<DataSourceTable>,
1464 /// A data validation rule on the cell, if any. When writing, the new data validation rule will overwrite any prior rule.
1465 #[serde(rename = "dataValidation")]
1466 pub data_validation: Option<DataValidationRule>,
1467 /// The effective format being used by the cell. This includes the results of applying any conditional formatting and, if the cell contains a formula, the computed number format. If the effective format is the default format, effective format will not be written. This field is read-only.
1468 #[serde(rename = "effectiveFormat")]
1469 pub effective_format: Option<CellFormat>,
1470 /// The effective value of the cell. For cells with formulas, this is the calculated value. For cells with literals, this is the same as the user_entered_value. This field is read-only.
1471 #[serde(rename = "effectiveValue")]
1472 pub effective_value: Option<ExtendedValue>,
1473 /// The formatted value of the cell. This is the value as it's shown to the user. This field is read-only.
1474 #[serde(rename = "formattedValue")]
1475 pub formatted_value: Option<String>,
1476 /// A hyperlink this cell points to, if any. If the cell contains multiple hyperlinks, this field will be empty. This field is read-only. To set it, use a `=HYPERLINK` formula in the userEnteredValue.formulaValue field. A cell-level link can also be set from the userEnteredFormat.textFormat field. Alternatively, set a hyperlink in the textFormatRun.format.link field that spans the entire cell.
1477 pub hyperlink: Option<String>,
1478 /// Any note on the cell.
1479 pub note: Option<String>,
1480 /// A pivot table anchored at this cell. The size of pivot table itself is computed dynamically based on its data, grouping, filters, values, etc. Only the top-left cell of the pivot table contains the pivot table definition. The other cells will contain the calculated values of the results of the pivot in their effective_value fields.
1481 #[serde(rename = "pivotTable")]
1482 pub pivot_table: Option<PivotTable>,
1483 /// Runs of rich text applied to subsections of the cell. Runs are only valid on user entered strings, not formulas, bools, or numbers. Properties of a run start at a specific index in the text and continue until the next run. Runs will inherit the properties of the cell unless explicitly changed. When writing, the new runs will overwrite any prior runs. When writing a new user_entered_value, previous runs are erased.
1484 #[serde(rename = "textFormatRuns")]
1485 pub text_format_runs: Option<Vec<TextFormatRun>>,
1486 /// The format the user entered for the cell. When writing, the new format will be merged with the existing format.
1487 #[serde(rename = "userEnteredFormat")]
1488 pub user_entered_format: Option<CellFormat>,
1489 /// The value the user entered in the cell. e.g., `1234`, `'Hello'`, or `=NOW()` Note: Dates, Times and DateTimes are represented as doubles in serial number format.
1490 #[serde(rename = "userEnteredValue")]
1491 pub user_entered_value: Option<ExtendedValue>,
1492}
1493
1494impl common::Part for CellData {}
1495
1496/// The format of a cell.
1497///
1498/// This type is not used in any activity, and only used as *part* of another schema.
1499///
1500#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1501#[serde_with::serde_as]
1502#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1503pub struct CellFormat {
1504 /// The background color of the cell. Deprecated: Use background_color_style.
1505 #[serde(rename = "backgroundColor")]
1506 pub background_color: Option<Color>,
1507 /// The background color of the cell. If background_color is also set, this field takes precedence.
1508 #[serde(rename = "backgroundColorStyle")]
1509 pub background_color_style: Option<ColorStyle>,
1510 /// The borders of the cell.
1511 pub borders: Option<Borders>,
1512 /// The horizontal alignment of the value in the cell.
1513 #[serde(rename = "horizontalAlignment")]
1514 pub horizontal_alignment: Option<String>,
1515 /// If one exists, how a hyperlink should be displayed in the cell.
1516 #[serde(rename = "hyperlinkDisplayType")]
1517 pub hyperlink_display_type: Option<String>,
1518 /// A format describing how number values should be represented to the user.
1519 #[serde(rename = "numberFormat")]
1520 pub number_format: Option<NumberFormat>,
1521 /// The padding of the cell.
1522 pub padding: Option<Padding>,
1523 /// The direction of the text in the cell.
1524 #[serde(rename = "textDirection")]
1525 pub text_direction: Option<String>,
1526 /// The format of the text in the cell (unless overridden by a format run). Setting a cell-level link here clears the cell's existing links. Setting the link field in a TextFormatRun takes precedence over the cell-level link.
1527 #[serde(rename = "textFormat")]
1528 pub text_format: Option<TextFormat>,
1529 /// The rotation applied to text in the cell.
1530 #[serde(rename = "textRotation")]
1531 pub text_rotation: Option<TextRotation>,
1532 /// The vertical alignment of the value in the cell.
1533 #[serde(rename = "verticalAlignment")]
1534 pub vertical_alignment: Option<String>,
1535 /// The wrap strategy for the value in the cell.
1536 #[serde(rename = "wrapStrategy")]
1537 pub wrap_strategy: Option<String>,
1538}
1539
1540impl common::Part for CellFormat {}
1541
1542/// The options that define a "view window" for a chart (such as the visible values in an axis).
1543///
1544/// This type is not used in any activity, and only used as *part* of another schema.
1545///
1546#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1547#[serde_with::serde_as]
1548#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1549pub struct ChartAxisViewWindowOptions {
1550 /// The maximum numeric value to be shown in this view window. If unset, will automatically determine a maximum value that looks good for the data.
1551 #[serde(rename = "viewWindowMax")]
1552 pub view_window_max: Option<f64>,
1553 /// The minimum numeric value to be shown in this view window. If unset, will automatically determine a minimum value that looks good for the data.
1554 #[serde(rename = "viewWindowMin")]
1555 pub view_window_min: Option<f64>,
1556 /// The view window's mode.
1557 #[serde(rename = "viewWindowMode")]
1558 pub view_window_mode: Option<String>,
1559}
1560
1561impl common::Part for ChartAxisViewWindowOptions {}
1562
1563/// Custom number formatting options for chart attributes.
1564///
1565/// This type is not used in any activity, and only used as *part* of another schema.
1566///
1567#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1568#[serde_with::serde_as]
1569#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1570pub struct ChartCustomNumberFormatOptions {
1571 /// Custom prefix to be prepended to the chart attribute. This field is optional.
1572 pub prefix: Option<String>,
1573 /// Custom suffix to be appended to the chart attribute. This field is optional.
1574 pub suffix: Option<String>,
1575}
1576
1577impl common::Part for ChartCustomNumberFormatOptions {}
1578
1579/// The data included in a domain or series.
1580///
1581/// This type is not used in any activity, and only used as *part* of another schema.
1582///
1583#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1584#[serde_with::serde_as]
1585#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1586pub struct ChartData {
1587 /// The aggregation type for the series of a data source chart. Only supported for data source charts.
1588 #[serde(rename = "aggregateType")]
1589 pub aggregate_type: Option<String>,
1590 /// The reference to the data source column that the data reads from.
1591 #[serde(rename = "columnReference")]
1592 pub column_reference: Option<DataSourceColumnReference>,
1593 /// The rule to group the data by if the ChartData backs the domain of a data source chart. Only supported for data source charts.
1594 #[serde(rename = "groupRule")]
1595 pub group_rule: Option<ChartGroupRule>,
1596 /// The source ranges of the data.
1597 #[serde(rename = "sourceRange")]
1598 pub source_range: Option<ChartSourceRange>,
1599}
1600
1601impl common::Part for ChartData {}
1602
1603/// Allows you to organize the date-time values in a source data column into buckets based on selected parts of their date or time values.
1604///
1605/// This type is not used in any activity, and only used as *part* of another schema.
1606///
1607#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1608#[serde_with::serde_as]
1609#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1610pub struct ChartDateTimeRule {
1611 /// The type of date-time grouping to apply.
1612 #[serde(rename = "type")]
1613 pub type_: Option<String>,
1614}
1615
1616impl common::Part for ChartDateTimeRule {}
1617
1618/// An optional setting on the ChartData of the domain of a data source chart that defines buckets for the values in the domain rather than breaking out each individual value. For example, when plotting a data source chart, you can specify a histogram rule on the domain (it should only contain numeric values), grouping its values into buckets. Any values of a chart series that fall into the same bucket are aggregated based on the aggregate_type.
1619///
1620/// This type is not used in any activity, and only used as *part* of another schema.
1621///
1622#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1623#[serde_with::serde_as]
1624#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1625pub struct ChartGroupRule {
1626 /// A ChartDateTimeRule.
1627 #[serde(rename = "dateTimeRule")]
1628 pub date_time_rule: Option<ChartDateTimeRule>,
1629 /// A ChartHistogramRule
1630 #[serde(rename = "histogramRule")]
1631 pub histogram_rule: Option<ChartHistogramRule>,
1632}
1633
1634impl common::Part for ChartGroupRule {}
1635
1636/// Allows you to organize numeric values in a source data column into buckets of constant size.
1637///
1638/// This type is not used in any activity, and only used as *part* of another schema.
1639///
1640#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1641#[serde_with::serde_as]
1642#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1643pub struct ChartHistogramRule {
1644 /// The size of the buckets that are created. Must be positive.
1645 #[serde(rename = "intervalSize")]
1646 pub interval_size: Option<f64>,
1647 /// The maximum value at which items are placed into buckets. Values greater than the maximum are grouped into a single bucket. If omitted, it is determined by the maximum item value.
1648 #[serde(rename = "maxValue")]
1649 pub max_value: Option<f64>,
1650 /// The minimum value at which items are placed into buckets. Values that are less than the minimum are grouped into a single bucket. If omitted, it is determined by the minimum item value.
1651 #[serde(rename = "minValue")]
1652 pub min_value: Option<f64>,
1653}
1654
1655impl common::Part for ChartHistogramRule {}
1656
1657/// Source ranges for a chart.
1658///
1659/// This type is not used in any activity, and only used as *part* of another schema.
1660///
1661#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1662#[serde_with::serde_as]
1663#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1664pub struct ChartSourceRange {
1665 /// The ranges of data for a series or domain. Exactly one dimension must have a length of 1, and all sources in the list must have the same dimension with length 1. The domain (if it exists) & all series must have the same number of source ranges. If using more than one source range, then the source range at a given offset must be in order and contiguous across the domain and series. For example, these are valid configurations: domain sources: A1:A5 series1 sources: B1:B5 series2 sources: D6:D10 domain sources: A1:A5, C10:C12 series1 sources: B1:B5, D10:D12 series2 sources: C1:C5, E10:E12
1666 pub sources: Option<Vec<GridRange>>,
1667}
1668
1669impl common::Part for ChartSourceRange {}
1670
1671/// The specifications of a chart.
1672///
1673/// This type is not used in any activity, and only used as *part* of another schema.
1674///
1675#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1676#[serde_with::serde_as]
1677#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1678pub struct ChartSpec {
1679 /// The alternative text that describes the chart. This is often used for accessibility.
1680 #[serde(rename = "altText")]
1681 pub alt_text: Option<String>,
1682 /// The background color of the entire chart. Not applicable to Org charts. Deprecated: Use background_color_style.
1683 #[serde(rename = "backgroundColor")]
1684 pub background_color: Option<Color>,
1685 /// The background color of the entire chart. Not applicable to Org charts. If background_color is also set, this field takes precedence.
1686 #[serde(rename = "backgroundColorStyle")]
1687 pub background_color_style: Option<ColorStyle>,
1688 /// A basic chart specification, can be one of many kinds of charts. See BasicChartType for the list of all charts this supports.
1689 #[serde(rename = "basicChart")]
1690 pub basic_chart: Option<BasicChartSpec>,
1691 /// A bubble chart specification.
1692 #[serde(rename = "bubbleChart")]
1693 pub bubble_chart: Option<BubbleChartSpec>,
1694 /// A candlestick chart specification.
1695 #[serde(rename = "candlestickChart")]
1696 pub candlestick_chart: Option<CandlestickChartSpec>,
1697 /// If present, the field contains data source chart specific properties.
1698 #[serde(rename = "dataSourceChartProperties")]
1699 pub data_source_chart_properties: Option<DataSourceChartProperties>,
1700 /// The filters applied to the source data of the chart. Only supported for data source charts.
1701 #[serde(rename = "filterSpecs")]
1702 pub filter_specs: Option<Vec<FilterSpec>>,
1703 /// The name of the font to use by default for all chart text (e.g. title, axis labels, legend). If a font is specified for a specific part of the chart it will override this font name.
1704 #[serde(rename = "fontName")]
1705 pub font_name: Option<String>,
1706 /// Determines how the charts will use hidden rows or columns.
1707 #[serde(rename = "hiddenDimensionStrategy")]
1708 pub hidden_dimension_strategy: Option<String>,
1709 /// A histogram chart specification.
1710 #[serde(rename = "histogramChart")]
1711 pub histogram_chart: Option<HistogramChartSpec>,
1712 /// True to make a chart fill the entire space in which it's rendered with minimum padding. False to use the default padding. (Not applicable to Geo and Org charts.)
1713 pub maximized: Option<bool>,
1714 /// An org chart specification.
1715 #[serde(rename = "orgChart")]
1716 pub org_chart: Option<OrgChartSpec>,
1717 /// A pie chart specification.
1718 #[serde(rename = "pieChart")]
1719 pub pie_chart: Option<PieChartSpec>,
1720 /// A scorecard chart specification.
1721 #[serde(rename = "scorecardChart")]
1722 pub scorecard_chart: Option<ScorecardChartSpec>,
1723 /// The order to sort the chart data by. Only a single sort spec is supported. Only supported for data source charts.
1724 #[serde(rename = "sortSpecs")]
1725 pub sort_specs: Option<Vec<SortSpec>>,
1726 /// The subtitle of the chart.
1727 pub subtitle: Option<String>,
1728 /// The subtitle text format. Strikethrough, underline, and link are not supported.
1729 #[serde(rename = "subtitleTextFormat")]
1730 pub subtitle_text_format: Option<TextFormat>,
1731 /// The subtitle text position. This field is optional.
1732 #[serde(rename = "subtitleTextPosition")]
1733 pub subtitle_text_position: Option<TextPosition>,
1734 /// The title of the chart.
1735 pub title: Option<String>,
1736 /// The title text format. Strikethrough, underline, and link are not supported.
1737 #[serde(rename = "titleTextFormat")]
1738 pub title_text_format: Option<TextFormat>,
1739 /// The title text position. This field is optional.
1740 #[serde(rename = "titleTextPosition")]
1741 pub title_text_position: Option<TextPosition>,
1742 /// A treemap chart specification.
1743 #[serde(rename = "treemapChart")]
1744 pub treemap_chart: Option<TreemapChartSpec>,
1745 /// A waterfall chart specification.
1746 #[serde(rename = "waterfallChart")]
1747 pub waterfall_chart: Option<WaterfallChartSpec>,
1748}
1749
1750impl common::Part for ChartSpec {}
1751
1752/// Clears the basic filter, if any exists on the sheet.
1753///
1754/// This type is not used in any activity, and only used as *part* of another schema.
1755///
1756#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1757#[serde_with::serde_as]
1758#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1759pub struct ClearBasicFilterRequest {
1760 /// The sheet ID on which the basic filter should be cleared.
1761 #[serde(rename = "sheetId")]
1762 pub sheet_id: Option<i32>,
1763}
1764
1765impl common::Part for ClearBasicFilterRequest {}
1766
1767/// The request for clearing a range of values in a spreadsheet.
1768///
1769/// # Activities
1770///
1771/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1772/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1773///
1774/// * [values clear spreadsheets](SpreadsheetValueClearCall) (request)
1775#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1776#[serde_with::serde_as]
1777#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1778pub struct ClearValuesRequest {
1779 _never_set: Option<bool>,
1780}
1781
1782impl common::RequestValue for ClearValuesRequest {}
1783
1784/// The response when clearing a range of values in a spreadsheet.
1785///
1786/// # Activities
1787///
1788/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1789/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1790///
1791/// * [values clear spreadsheets](SpreadsheetValueClearCall) (response)
1792#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1793#[serde_with::serde_as]
1794#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1795pub struct ClearValuesResponse {
1796 /// The range (in A1 notation) that was cleared. (If the request was for an unbounded range or a ranger larger than the bounds of the sheet, this will be the actual range that was cleared, bounded to the sheet's limits.)
1797 #[serde(rename = "clearedRange")]
1798 pub cleared_range: Option<String>,
1799 /// The spreadsheet the updates were applied to.
1800 #[serde(rename = "spreadsheetId")]
1801 pub spreadsheet_id: Option<String>,
1802}
1803
1804impl common::ResponseResult for ClearValuesResponse {}
1805
1806/// Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...
1807///
1808/// This type is not used in any activity, and only used as *part* of another schema.
1809///
1810#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1811#[serde_with::serde_as]
1812#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1813pub struct Color {
1814 /// The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
1815 pub alpha: Option<f32>,
1816 /// The amount of blue in the color as a value in the interval [0, 1].
1817 pub blue: Option<f32>,
1818 /// The amount of green in the color as a value in the interval [0, 1].
1819 pub green: Option<f32>,
1820 /// The amount of red in the color as a value in the interval [0, 1].
1821 pub red: Option<f32>,
1822}
1823
1824impl common::Part for Color {}
1825
1826/// A color value.
1827///
1828/// This type is not used in any activity, and only used as *part* of another schema.
1829///
1830#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1831#[serde_with::serde_as]
1832#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1833pub struct ColorStyle {
1834 /// RGB color. The [`alpha`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/other#Color.FIELDS.alpha) value in the [`Color`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/other#color) object isn’t generally supported.
1835 #[serde(rename = "rgbColor")]
1836 pub rgb_color: Option<Color>,
1837 /// Theme color.
1838 #[serde(rename = "themeColor")]
1839 pub theme_color: Option<String>,
1840}
1841
1842impl common::Part for ColorStyle {}
1843
1844/// The value of the condition.
1845///
1846/// This type is not used in any activity, and only used as *part* of another schema.
1847///
1848#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1849#[serde_with::serde_as]
1850#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1851pub struct ConditionValue {
1852 /// A relative date (based on the current date). Valid only if the type is DATE_BEFORE, DATE_AFTER, DATE_ON_OR_BEFORE or DATE_ON_OR_AFTER. Relative dates are not supported in data validation. They are supported only in conditional formatting and conditional filters.
1853 #[serde(rename = "relativeDate")]
1854 pub relative_date: Option<String>,
1855 /// A value the condition is based on. The value is parsed as if the user typed into a cell. Formulas are supported (and must begin with an `=` or a '+').
1856 #[serde(rename = "userEnteredValue")]
1857 pub user_entered_value: Option<String>,
1858}
1859
1860impl common::Part for ConditionValue {}
1861
1862/// A rule describing a conditional format.
1863///
1864/// This type is not used in any activity, and only used as *part* of another schema.
1865///
1866#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1867#[serde_with::serde_as]
1868#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1869pub struct ConditionalFormatRule {
1870 /// The formatting is either "on" or "off" according to the rule.
1871 #[serde(rename = "booleanRule")]
1872 pub boolean_rule: Option<BooleanRule>,
1873 /// The formatting will vary based on the gradients in the rule.
1874 #[serde(rename = "gradientRule")]
1875 pub gradient_rule: Option<GradientRule>,
1876 /// The ranges that are formatted if the condition is true. All the ranges must be on the same grid.
1877 pub ranges: Option<Vec<GridRange>>,
1878}
1879
1880impl common::Part for ConditionalFormatRule {}
1881
1882/// Copies data from the source to the destination.
1883///
1884/// This type is not used in any activity, and only used as *part* of another schema.
1885///
1886#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1887#[serde_with::serde_as]
1888#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1889pub struct CopyPasteRequest {
1890 /// The location to paste to. If the range covers a span that's a multiple of the source's height or width, then the data will be repeated to fill in the destination range. If the range is smaller than the source range, the entire source data will still be copied (beyond the end of the destination range).
1891 pub destination: Option<GridRange>,
1892 /// How that data should be oriented when pasting.
1893 #[serde(rename = "pasteOrientation")]
1894 pub paste_orientation: Option<String>,
1895 /// What kind of data to paste.
1896 #[serde(rename = "pasteType")]
1897 pub paste_type: Option<String>,
1898 /// The source range to copy.
1899 pub source: Option<GridRange>,
1900}
1901
1902impl common::Part for CopyPasteRequest {}
1903
1904/// The request to copy a sheet across spreadsheets.
1905///
1906/// # Activities
1907///
1908/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1909/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1910///
1911/// * [sheets copy to spreadsheets](SpreadsheetSheetCopyToCall) (request)
1912#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1913#[serde_with::serde_as]
1914#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1915pub struct CopySheetToAnotherSpreadsheetRequest {
1916 /// The ID of the spreadsheet to copy the sheet to.
1917 #[serde(rename = "destinationSpreadsheetId")]
1918 pub destination_spreadsheet_id: Option<String>,
1919}
1920
1921impl common::RequestValue for CopySheetToAnotherSpreadsheetRequest {}
1922
1923/// A request to create developer metadata.
1924///
1925/// This type is not used in any activity, and only used as *part* of another schema.
1926///
1927#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1928#[serde_with::serde_as]
1929#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1930pub struct CreateDeveloperMetadataRequest {
1931 /// The developer metadata to create.
1932 #[serde(rename = "developerMetadata")]
1933 pub developer_metadata: Option<DeveloperMetadata>,
1934}
1935
1936impl common::Part for CreateDeveloperMetadataRequest {}
1937
1938/// The response from creating developer metadata.
1939///
1940/// This type is not used in any activity, and only used as *part* of another schema.
1941///
1942#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1943#[serde_with::serde_as]
1944#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1945pub struct CreateDeveloperMetadataResponse {
1946 /// The developer metadata that was created.
1947 #[serde(rename = "developerMetadata")]
1948 pub developer_metadata: Option<DeveloperMetadata>,
1949}
1950
1951impl common::Part for CreateDeveloperMetadataResponse {}
1952
1953/// Moves data from the source to the destination.
1954///
1955/// This type is not used in any activity, and only used as *part* of another schema.
1956///
1957#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1958#[serde_with::serde_as]
1959#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1960pub struct CutPasteRequest {
1961 /// The top-left coordinate where the data should be pasted.
1962 pub destination: Option<GridCoordinate>,
1963 /// What kind of data to paste. All the source data will be cut, regardless of what is pasted.
1964 #[serde(rename = "pasteType")]
1965 pub paste_type: Option<String>,
1966 /// The source data to cut.
1967 pub source: Option<GridRange>,
1968}
1969
1970impl common::Part for CutPasteRequest {}
1971
1972/// The data execution status. A data execution is created to sync a data source object with the latest data from a DataSource. It is usually scheduled to run at background, you can check its state to tell if an execution completes There are several scenarios where a data execution is triggered to run: * Adding a data source creates an associated data source sheet as well as a data execution to sync the data from the data source to the sheet. * Updating a data source creates a data execution to refresh the associated data source sheet similarly. * You can send refresh request to explicitly refresh one or multiple data source objects.
1973///
1974/// This type is not used in any activity, and only used as *part* of another schema.
1975///
1976#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1977#[serde_with::serde_as]
1978#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1979pub struct DataExecutionStatus {
1980 /// The error code.
1981 #[serde(rename = "errorCode")]
1982 pub error_code: Option<String>,
1983 /// The error message, which may be empty.
1984 #[serde(rename = "errorMessage")]
1985 pub error_message: Option<String>,
1986 /// Gets the time the data last successfully refreshed.
1987 #[serde(rename = "lastRefreshTime")]
1988 pub last_refresh_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1989 /// The state of the data execution.
1990 pub state: Option<String>,
1991}
1992
1993impl common::Part for DataExecutionStatus {}
1994
1995/// Filter that describes what data should be selected or returned from a request.
1996///
1997/// This type is not used in any activity, and only used as *part* of another schema.
1998///
1999#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2000#[serde_with::serde_as]
2001#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2002pub struct DataFilter {
2003 /// Selects data that matches the specified A1 range.
2004 #[serde(rename = "a1Range")]
2005 pub a1_range: Option<String>,
2006 /// Selects data associated with the developer metadata matching the criteria described by this DeveloperMetadataLookup.
2007 #[serde(rename = "developerMetadataLookup")]
2008 pub developer_metadata_lookup: Option<DeveloperMetadataLookup>,
2009 /// Selects data that matches the range described by the GridRange.
2010 #[serde(rename = "gridRange")]
2011 pub grid_range: Option<GridRange>,
2012}
2013
2014impl common::Part for DataFilter {}
2015
2016/// A range of values whose location is specified by a DataFilter.
2017///
2018/// This type is not used in any activity, and only used as *part* of another schema.
2019///
2020#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2021#[serde_with::serde_as]
2022#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2023pub struct DataFilterValueRange {
2024 /// The data filter describing the location of the values in the spreadsheet.
2025 #[serde(rename = "dataFilter")]
2026 pub data_filter: Option<DataFilter>,
2027 /// The major dimension of the values.
2028 #[serde(rename = "majorDimension")]
2029 pub major_dimension: Option<String>,
2030 /// The data to be written. If the provided values exceed any of the ranges matched by the data filter then the request fails. If the provided values are less than the matched ranges only the specified values are written, existing values in the matched ranges remain unaffected.
2031 pub values: Option<Vec<Vec<serde_json::Value>>>,
2032}
2033
2034impl common::Part for DataFilterValueRange {}
2035
2036/// Settings for one set of data labels. Data labels are annotations that appear next to a set of data, such as the points on a line chart, and provide additional information about what the data represents, such as a text representation of the value behind that point on the graph.
2037///
2038/// This type is not used in any activity, and only used as *part* of another schema.
2039///
2040#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2041#[serde_with::serde_as]
2042#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2043pub struct DataLabel {
2044 /// Data to use for custom labels. Only used if type is set to CUSTOM. This data must be the same length as the series or other element this data label is applied to. In addition, if the series is split into multiple source ranges, this source data must come from the next column in the source data. For example, if the series is B2:B4,E6:E8 then this data must come from C2:C4,F6:F8.
2045 #[serde(rename = "customLabelData")]
2046 pub custom_label_data: Option<ChartData>,
2047 /// The placement of the data label relative to the labeled data.
2048 pub placement: Option<String>,
2049 /// The text format used for the data label. The link field is not supported.
2050 #[serde(rename = "textFormat")]
2051 pub text_format: Option<TextFormat>,
2052 /// The type of the data label.
2053 #[serde(rename = "type")]
2054 pub type_: Option<String>,
2055}
2056
2057impl common::Part for DataLabel {}
2058
2059/// Information about an external data source in the spreadsheet.
2060///
2061/// This type is not used in any activity, and only used as *part* of another schema.
2062///
2063#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2064#[serde_with::serde_as]
2065#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2066pub struct DataSource {
2067 /// All calculated columns in the data source.
2068 #[serde(rename = "calculatedColumns")]
2069 pub calculated_columns: Option<Vec<DataSourceColumn>>,
2070 /// The spreadsheet-scoped unique ID that identifies the data source. Example: 1080547365.
2071 #[serde(rename = "dataSourceId")]
2072 pub data_source_id: Option<String>,
2073 /// The ID of the Sheet connected with the data source. The field cannot be changed once set. When creating a data source, an associated DATA_SOURCE sheet is also created, if the field is not specified, the ID of the created sheet will be randomly generated.
2074 #[serde(rename = "sheetId")]
2075 pub sheet_id: Option<i32>,
2076 /// The DataSourceSpec for the data source connected with this spreadsheet.
2077 pub spec: Option<DataSourceSpec>,
2078}
2079
2080impl common::Part for DataSource {}
2081
2082/// Properties of a data source chart.
2083///
2084/// This type is not used in any activity, and only used as *part* of another schema.
2085///
2086#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2087#[serde_with::serde_as]
2088#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2089pub struct DataSourceChartProperties {
2090 /// Output only. The data execution status.
2091 #[serde(rename = "dataExecutionStatus")]
2092 pub data_execution_status: Option<DataExecutionStatus>,
2093 /// ID of the data source that the chart is associated with.
2094 #[serde(rename = "dataSourceId")]
2095 pub data_source_id: Option<String>,
2096}
2097
2098impl common::Part for DataSourceChartProperties {}
2099
2100/// A column in a data source.
2101///
2102/// This type is not used in any activity, and only used as *part* of another schema.
2103///
2104#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2105#[serde_with::serde_as]
2106#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2107pub struct DataSourceColumn {
2108 /// The formula of the calculated column.
2109 pub formula: Option<String>,
2110 /// The column reference.
2111 pub reference: Option<DataSourceColumnReference>,
2112}
2113
2114impl common::Part for DataSourceColumn {}
2115
2116/// An unique identifier that references a data source column.
2117///
2118/// This type is not used in any activity, and only used as *part* of another schema.
2119///
2120#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2121#[serde_with::serde_as]
2122#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2123pub struct DataSourceColumnReference {
2124 /// The display name of the column. It should be unique within a data source.
2125 pub name: Option<String>,
2126}
2127
2128impl common::Part for DataSourceColumnReference {}
2129
2130/// A data source formula.
2131///
2132/// This type is not used in any activity, and only used as *part* of another schema.
2133///
2134#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2135#[serde_with::serde_as]
2136#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2137pub struct DataSourceFormula {
2138 /// Output only. The data execution status.
2139 #[serde(rename = "dataExecutionStatus")]
2140 pub data_execution_status: Option<DataExecutionStatus>,
2141 /// The ID of the data source the formula is associated with.
2142 #[serde(rename = "dataSourceId")]
2143 pub data_source_id: Option<String>,
2144}
2145
2146impl common::Part for DataSourceFormula {}
2147
2148/// Reference to a data source object.
2149///
2150/// This type is not used in any activity, and only used as *part* of another schema.
2151///
2152#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2153#[serde_with::serde_as]
2154#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2155pub struct DataSourceObjectReference {
2156 /// References to a data source chart.
2157 #[serde(rename = "chartId")]
2158 pub chart_id: Option<i32>,
2159 /// References to a cell containing DataSourceFormula.
2160 #[serde(rename = "dataSourceFormulaCell")]
2161 pub data_source_formula_cell: Option<GridCoordinate>,
2162 /// References to a data source PivotTable anchored at the cell.
2163 #[serde(rename = "dataSourcePivotTableAnchorCell")]
2164 pub data_source_pivot_table_anchor_cell: Option<GridCoordinate>,
2165 /// References to a DataSourceTable anchored at the cell.
2166 #[serde(rename = "dataSourceTableAnchorCell")]
2167 pub data_source_table_anchor_cell: Option<GridCoordinate>,
2168 /// References to a DATA_SOURCE sheet.
2169 #[serde(rename = "sheetId")]
2170 pub sheet_id: Option<String>,
2171}
2172
2173impl common::Part for DataSourceObjectReference {}
2174
2175/// A list of references to data source objects.
2176///
2177/// This type is not used in any activity, and only used as *part* of another schema.
2178///
2179#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2180#[serde_with::serde_as]
2181#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2182pub struct DataSourceObjectReferences {
2183 /// The references.
2184 pub references: Option<Vec<DataSourceObjectReference>>,
2185}
2186
2187impl common::Part for DataSourceObjectReferences {}
2188
2189/// A parameter in a data source's query. The parameter allows the user to pass in values from the spreadsheet into a query.
2190///
2191/// This type is not used in any activity, and only used as *part* of another schema.
2192///
2193#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2194#[serde_with::serde_as]
2195#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2196pub struct DataSourceParameter {
2197 /// Named parameter. Must be a legitimate identifier for the DataSource that supports it. For example, [BigQuery identifier](https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#identifiers).
2198 pub name: Option<String>,
2199 /// ID of a NamedRange. Its size must be 1x1.
2200 #[serde(rename = "namedRangeId")]
2201 pub named_range_id: Option<String>,
2202 /// A range that contains the value of the parameter. Its size must be 1x1.
2203 pub range: Option<GridRange>,
2204}
2205
2206impl common::Part for DataSourceParameter {}
2207
2208/// A schedule for data to refresh every day in a given time interval.
2209///
2210/// This type is not used in any activity, and only used as *part* of another schema.
2211///
2212#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2213#[serde_with::serde_as]
2214#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2215pub struct DataSourceRefreshDailySchedule {
2216 /// The start time of a time interval in which a data source refresh is scheduled. Only `hours` part is used. The time interval size defaults to that in the Sheets editor.
2217 #[serde(rename = "startTime")]
2218 pub start_time: Option<TimeOfDay>,
2219}
2220
2221impl common::Part for DataSourceRefreshDailySchedule {}
2222
2223/// A monthly schedule for data to refresh on specific days in the month in a given time interval.
2224///
2225/// This type is not used in any activity, and only used as *part* of another schema.
2226///
2227#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2228#[serde_with::serde_as]
2229#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2230pub struct DataSourceRefreshMonthlySchedule {
2231 /// Days of the month to refresh. Only 1-28 are supported, mapping to the 1st to the 28th day. At least one day must be specified.
2232 #[serde(rename = "daysOfMonth")]
2233 pub days_of_month: Option<Vec<i32>>,
2234 /// The start time of a time interval in which a data source refresh is scheduled. Only `hours` part is used. The time interval size defaults to that in the Sheets editor.
2235 #[serde(rename = "startTime")]
2236 pub start_time: Option<TimeOfDay>,
2237}
2238
2239impl common::Part for DataSourceRefreshMonthlySchedule {}
2240
2241/// Schedule for refreshing the data source. Data sources in the spreadsheet are refreshed within a time interval. You can specify the start time by clicking the Scheduled Refresh button in the Sheets editor, but the interval is fixed at 4 hours. For example, if you specify a start time of 8 AM , the refresh will take place between 8 AM and 12 PM every day.
2242///
2243/// This type is not used in any activity, and only used as *part* of another schema.
2244///
2245#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2246#[serde_with::serde_as]
2247#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2248pub struct DataSourceRefreshSchedule {
2249 /// Daily refresh schedule.
2250 #[serde(rename = "dailySchedule")]
2251 pub daily_schedule: Option<DataSourceRefreshDailySchedule>,
2252 /// True if the refresh schedule is enabled, or false otherwise.
2253 pub enabled: Option<bool>,
2254 /// Monthly refresh schedule.
2255 #[serde(rename = "monthlySchedule")]
2256 pub monthly_schedule: Option<DataSourceRefreshMonthlySchedule>,
2257 /// Output only. The time interval of the next run.
2258 #[serde(rename = "nextRun")]
2259 pub next_run: Option<Interval>,
2260 /// The scope of the refresh. Must be ALL_DATA_SOURCES.
2261 #[serde(rename = "refreshScope")]
2262 pub refresh_scope: Option<String>,
2263 /// Weekly refresh schedule.
2264 #[serde(rename = "weeklySchedule")]
2265 pub weekly_schedule: Option<DataSourceRefreshWeeklySchedule>,
2266}
2267
2268impl common::Part for DataSourceRefreshSchedule {}
2269
2270/// A weekly schedule for data to refresh on specific days in a given time interval.
2271///
2272/// This type is not used in any activity, and only used as *part* of another schema.
2273///
2274#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2275#[serde_with::serde_as]
2276#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2277pub struct DataSourceRefreshWeeklySchedule {
2278 /// Days of the week to refresh. At least one day must be specified.
2279 #[serde(rename = "daysOfWeek")]
2280 pub days_of_week: Option<Vec<String>>,
2281 /// The start time of a time interval in which a data source refresh is scheduled. Only `hours` part is used. The time interval size defaults to that in the Sheets editor.
2282 #[serde(rename = "startTime")]
2283 pub start_time: Option<TimeOfDay>,
2284}
2285
2286impl common::Part for DataSourceRefreshWeeklySchedule {}
2287
2288/// A range along a single dimension on a DATA_SOURCE sheet.
2289///
2290/// This type is not used in any activity, and only used as *part* of another schema.
2291///
2292#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2293#[serde_with::serde_as]
2294#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2295pub struct DataSourceSheetDimensionRange {
2296 /// The columns on the data source sheet.
2297 #[serde(rename = "columnReferences")]
2298 pub column_references: Option<Vec<DataSourceColumnReference>>,
2299 /// The ID of the data source sheet the range is on.
2300 #[serde(rename = "sheetId")]
2301 pub sheet_id: Option<i32>,
2302}
2303
2304impl common::Part for DataSourceSheetDimensionRange {}
2305
2306/// Additional properties of a DATA_SOURCE sheet.
2307///
2308/// This type is not used in any activity, and only used as *part* of another schema.
2309///
2310#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2311#[serde_with::serde_as]
2312#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2313pub struct DataSourceSheetProperties {
2314 /// The columns displayed on the sheet, corresponding to the values in RowData.
2315 pub columns: Option<Vec<DataSourceColumn>>,
2316 /// The data execution status.
2317 #[serde(rename = "dataExecutionStatus")]
2318 pub data_execution_status: Option<DataExecutionStatus>,
2319 /// ID of the DataSource the sheet is connected to.
2320 #[serde(rename = "dataSourceId")]
2321 pub data_source_id: Option<String>,
2322}
2323
2324impl common::Part for DataSourceSheetProperties {}
2325
2326/// This specifies the details of the data source. For example, for BigQuery, this specifies information about the BigQuery source.
2327///
2328/// This type is not used in any activity, and only used as *part* of another schema.
2329///
2330#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2331#[serde_with::serde_as]
2332#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2333pub struct DataSourceSpec {
2334 /// A BigQueryDataSourceSpec.
2335 #[serde(rename = "bigQuery")]
2336 pub big_query: Option<BigQueryDataSourceSpec>,
2337 /// The parameters of the data source, used when querying the data source.
2338 pub parameters: Option<Vec<DataSourceParameter>>,
2339}
2340
2341impl common::Part for DataSourceSpec {}
2342
2343/// A data source table, which allows the user to import a static table of data from the DataSource into Sheets. This is also known as "Extract" in the Sheets editor.
2344///
2345/// This type is not used in any activity, and only used as *part* of another schema.
2346///
2347#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2348#[serde_with::serde_as]
2349#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2350pub struct DataSourceTable {
2351 /// The type to select columns for the data source table. Defaults to SELECTED.
2352 #[serde(rename = "columnSelectionType")]
2353 pub column_selection_type: Option<String>,
2354 /// Columns selected for the data source table. The column_selection_type must be SELECTED.
2355 pub columns: Option<Vec<DataSourceColumnReference>>,
2356 /// Output only. The data execution status.
2357 #[serde(rename = "dataExecutionStatus")]
2358 pub data_execution_status: Option<DataExecutionStatus>,
2359 /// The ID of the data source the data source table is associated with.
2360 #[serde(rename = "dataSourceId")]
2361 pub data_source_id: Option<String>,
2362 /// Filter specifications in the data source table.
2363 #[serde(rename = "filterSpecs")]
2364 pub filter_specs: Option<Vec<FilterSpec>>,
2365 /// The limit of rows to return. If not set, a default limit is applied. Please refer to the Sheets editor for the default and max limit.
2366 #[serde(rename = "rowLimit")]
2367 pub row_limit: Option<i32>,
2368 /// Sort specifications in the data source table. The result of the data source table is sorted based on the sort specifications in order.
2369 #[serde(rename = "sortSpecs")]
2370 pub sort_specs: Option<Vec<SortSpec>>,
2371}
2372
2373impl common::Part for DataSourceTable {}
2374
2375/// A data validation rule.
2376///
2377/// This type is not used in any activity, and only used as *part* of another schema.
2378///
2379#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2380#[serde_with::serde_as]
2381#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2382pub struct DataValidationRule {
2383 /// The condition that data in the cell must match.
2384 pub condition: Option<BooleanCondition>,
2385 /// A message to show the user when adding data to the cell.
2386 #[serde(rename = "inputMessage")]
2387 pub input_message: Option<String>,
2388 /// True if the UI should be customized based on the kind of condition. If true, "List" conditions will show a dropdown.
2389 #[serde(rename = "showCustomUi")]
2390 pub show_custom_ui: Option<bool>,
2391 /// True if invalid data should be rejected.
2392 pub strict: Option<bool>,
2393}
2394
2395impl common::Part for DataValidationRule {}
2396
2397/// Allows you to organize the date-time values in a source data column into buckets based on selected parts of their date or time values. For example, consider a pivot table showing sales transactions by date: +----------+--------------+ | Date | SUM of Sales | +----------+--------------+ | 1/1/2017 | $621.14 | | 2/3/2017 | $708.84 | | 5/8/2017 | $326.84 | ... +----------+--------------+ Applying a date-time group rule with a DateTimeRuleType of YEAR_MONTH results in the following pivot table. +--------------+--------------+ | Grouped Date | SUM of Sales | +--------------+--------------+ | 2017-Jan | $53,731.78 | | 2017-Feb | $83,475.32 | | 2017-Mar | $94,385.05 | ... +--------------+--------------+
2398///
2399/// This type is not used in any activity, and only used as *part* of another schema.
2400///
2401#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2402#[serde_with::serde_as]
2403#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2404pub struct DateTimeRule {
2405 /// The type of date-time grouping to apply.
2406 #[serde(rename = "type")]
2407 pub type_: Option<String>,
2408}
2409
2410impl common::Part for DateTimeRule {}
2411
2412/// Removes the banded range with the given ID from the spreadsheet.
2413///
2414/// This type is not used in any activity, and only used as *part* of another schema.
2415///
2416#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2417#[serde_with::serde_as]
2418#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2419pub struct DeleteBandingRequest {
2420 /// The ID of the banded range to delete.
2421 #[serde(rename = "bandedRangeId")]
2422 pub banded_range_id: Option<i32>,
2423}
2424
2425impl common::Part for DeleteBandingRequest {}
2426
2427/// Deletes a conditional format rule at the given index. All subsequent rules' indexes are decremented.
2428///
2429/// This type is not used in any activity, and only used as *part* of another schema.
2430///
2431#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2432#[serde_with::serde_as]
2433#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2434pub struct DeleteConditionalFormatRuleRequest {
2435 /// The zero-based index of the rule to be deleted.
2436 pub index: Option<i32>,
2437 /// The sheet the rule is being deleted from.
2438 #[serde(rename = "sheetId")]
2439 pub sheet_id: Option<i32>,
2440}
2441
2442impl common::Part for DeleteConditionalFormatRuleRequest {}
2443
2444/// The result of deleting a conditional format rule.
2445///
2446/// This type is not used in any activity, and only used as *part* of another schema.
2447///
2448#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2449#[serde_with::serde_as]
2450#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2451pub struct DeleteConditionalFormatRuleResponse {
2452 /// The rule that was deleted.
2453 pub rule: Option<ConditionalFormatRule>,
2454}
2455
2456impl common::Part for DeleteConditionalFormatRuleResponse {}
2457
2458/// Deletes a data source. The request also deletes the associated data source sheet, and unlinks all associated data source objects.
2459///
2460/// This type is not used in any activity, and only used as *part* of another schema.
2461///
2462#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2463#[serde_with::serde_as]
2464#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2465pub struct DeleteDataSourceRequest {
2466 /// The ID of the data source to delete.
2467 #[serde(rename = "dataSourceId")]
2468 pub data_source_id: Option<String>,
2469}
2470
2471impl common::Part for DeleteDataSourceRequest {}
2472
2473/// A request to delete developer metadata.
2474///
2475/// This type is not used in any activity, and only used as *part* of another schema.
2476///
2477#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2478#[serde_with::serde_as]
2479#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2480pub struct DeleteDeveloperMetadataRequest {
2481 /// The data filter describing the criteria used to select which developer metadata entry to delete.
2482 #[serde(rename = "dataFilter")]
2483 pub data_filter: Option<DataFilter>,
2484}
2485
2486impl common::Part for DeleteDeveloperMetadataRequest {}
2487
2488/// The response from deleting developer metadata.
2489///
2490/// This type is not used in any activity, and only used as *part* of another schema.
2491///
2492#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2493#[serde_with::serde_as]
2494#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2495pub struct DeleteDeveloperMetadataResponse {
2496 /// The metadata that was deleted.
2497 #[serde(rename = "deletedDeveloperMetadata")]
2498 pub deleted_developer_metadata: Option<Vec<DeveloperMetadata>>,
2499}
2500
2501impl common::Part for DeleteDeveloperMetadataResponse {}
2502
2503/// Deletes a group over the specified range by decrementing the depth of the dimensions in the range. For example, assume the sheet has a depth-1 group over B:E and a depth-2 group over C:D. Deleting a group over D:E leaves the sheet with a depth-1 group over B:D and a depth-2 group over C:C.
2504///
2505/// This type is not used in any activity, and only used as *part* of another schema.
2506///
2507#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2508#[serde_with::serde_as]
2509#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2510pub struct DeleteDimensionGroupRequest {
2511 /// The range of the group to be deleted.
2512 pub range: Option<DimensionRange>,
2513}
2514
2515impl common::Part for DeleteDimensionGroupRequest {}
2516
2517/// The result of deleting a group.
2518///
2519/// This type is not used in any activity, and only used as *part* of another schema.
2520///
2521#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2522#[serde_with::serde_as]
2523#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2524pub struct DeleteDimensionGroupResponse {
2525 /// All groups of a dimension after deleting a group from that dimension.
2526 #[serde(rename = "dimensionGroups")]
2527 pub dimension_groups: Option<Vec<DimensionGroup>>,
2528}
2529
2530impl common::Part for DeleteDimensionGroupResponse {}
2531
2532/// Deletes the dimensions from the sheet.
2533///
2534/// This type is not used in any activity, and only used as *part* of another schema.
2535///
2536#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2537#[serde_with::serde_as]
2538#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2539pub struct DeleteDimensionRequest {
2540 /// The dimensions to delete from the sheet.
2541 pub range: Option<DimensionRange>,
2542}
2543
2544impl common::Part for DeleteDimensionRequest {}
2545
2546/// Removes rows within this range that contain values in the specified columns that are duplicates of values in any previous row. Rows with identical values but different letter cases, formatting, or formulas are considered to be duplicates. This request also removes duplicate rows hidden from view (for example, due to a filter). When removing duplicates, the first instance of each duplicate row scanning from the top downwards is kept in the resulting range. Content outside of the specified range isn't removed, and rows considered duplicates do not have to be adjacent to each other in the range.
2547///
2548/// This type is not used in any activity, and only used as *part* of another schema.
2549///
2550#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2551#[serde_with::serde_as]
2552#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2553pub struct DeleteDuplicatesRequest {
2554 /// The columns in the range to analyze for duplicate values. If no columns are selected then all columns are analyzed for duplicates.
2555 #[serde(rename = "comparisonColumns")]
2556 pub comparison_columns: Option<Vec<DimensionRange>>,
2557 /// The range to remove duplicates rows from.
2558 pub range: Option<GridRange>,
2559}
2560
2561impl common::Part for DeleteDuplicatesRequest {}
2562
2563/// The result of removing duplicates in a range.
2564///
2565/// This type is not used in any activity, and only used as *part* of another schema.
2566///
2567#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2568#[serde_with::serde_as]
2569#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2570pub struct DeleteDuplicatesResponse {
2571 /// The number of duplicate rows removed.
2572 #[serde(rename = "duplicatesRemovedCount")]
2573 pub duplicates_removed_count: Option<i32>,
2574}
2575
2576impl common::Part for DeleteDuplicatesResponse {}
2577
2578/// Deletes the embedded object with the given ID.
2579///
2580/// This type is not used in any activity, and only used as *part* of another schema.
2581///
2582#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2583#[serde_with::serde_as]
2584#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2585pub struct DeleteEmbeddedObjectRequest {
2586 /// The ID of the embedded object to delete.
2587 #[serde(rename = "objectId")]
2588 pub object_id: Option<i32>,
2589}
2590
2591impl common::Part for DeleteEmbeddedObjectRequest {}
2592
2593/// Deletes a particular filter view.
2594///
2595/// This type is not used in any activity, and only used as *part* of another schema.
2596///
2597#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2598#[serde_with::serde_as]
2599#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2600pub struct DeleteFilterViewRequest {
2601 /// The ID of the filter to delete.
2602 #[serde(rename = "filterId")]
2603 pub filter_id: Option<i32>,
2604}
2605
2606impl common::Part for DeleteFilterViewRequest {}
2607
2608/// Removes the named range with the given ID from the spreadsheet.
2609///
2610/// This type is not used in any activity, and only used as *part* of another schema.
2611///
2612#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2613#[serde_with::serde_as]
2614#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2615pub struct DeleteNamedRangeRequest {
2616 /// The ID of the named range to delete.
2617 #[serde(rename = "namedRangeId")]
2618 pub named_range_id: Option<String>,
2619}
2620
2621impl common::Part for DeleteNamedRangeRequest {}
2622
2623/// Deletes the protected range with the given ID.
2624///
2625/// This type is not used in any activity, and only used as *part* of another schema.
2626///
2627#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2628#[serde_with::serde_as]
2629#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2630pub struct DeleteProtectedRangeRequest {
2631 /// The ID of the protected range to delete.
2632 #[serde(rename = "protectedRangeId")]
2633 pub protected_range_id: Option<i32>,
2634}
2635
2636impl common::Part for DeleteProtectedRangeRequest {}
2637
2638/// Deletes a range of cells, shifting other cells into the deleted area.
2639///
2640/// This type is not used in any activity, and only used as *part* of another schema.
2641///
2642#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2643#[serde_with::serde_as]
2644#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2645pub struct DeleteRangeRequest {
2646 /// The range of cells to delete.
2647 pub range: Option<GridRange>,
2648 /// The dimension from which deleted cells will be replaced with. If ROWS, existing cells will be shifted upward to replace the deleted cells. If COLUMNS, existing cells will be shifted left to replace the deleted cells.
2649 #[serde(rename = "shiftDimension")]
2650 pub shift_dimension: Option<String>,
2651}
2652
2653impl common::Part for DeleteRangeRequest {}
2654
2655/// Deletes the requested sheet.
2656///
2657/// This type is not used in any activity, and only used as *part* of another schema.
2658///
2659#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2660#[serde_with::serde_as]
2661#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2662pub struct DeleteSheetRequest {
2663 /// The ID of the sheet to delete. If the sheet is of DATA_SOURCE type, the associated DataSource is also deleted.
2664 #[serde(rename = "sheetId")]
2665 pub sheet_id: Option<i32>,
2666}
2667
2668impl common::Part for DeleteSheetRequest {}
2669
2670/// Developer metadata associated with a location or object in a spreadsheet. Developer metadata may be used to associate arbitrary data with various parts of a spreadsheet and will remain associated at those locations as they move around and the spreadsheet is edited. For example, if developer metadata is associated with row 5 and another row is then subsequently inserted above row 5, that original metadata will still be associated with the row it was first associated with (what is now row 6). If the associated object is deleted its metadata is deleted too.
2671///
2672/// # Activities
2673///
2674/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
2675/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
2676///
2677/// * [developer metadata get spreadsheets](SpreadsheetDeveloperMetadataGetCall) (response)
2678#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2679#[serde_with::serde_as]
2680#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2681pub struct DeveloperMetadata {
2682 /// The location where the metadata is associated.
2683 pub location: Option<DeveloperMetadataLocation>,
2684 /// The spreadsheet-scoped unique ID that identifies the metadata. IDs may be specified when metadata is created, otherwise one will be randomly generated and assigned. Must be positive.
2685 #[serde(rename = "metadataId")]
2686 pub metadata_id: Option<i32>,
2687 /// The metadata key. There may be multiple metadata in a spreadsheet with the same key. Developer metadata must always have a key specified.
2688 #[serde(rename = "metadataKey")]
2689 pub metadata_key: Option<String>,
2690 /// Data associated with the metadata's key.
2691 #[serde(rename = "metadataValue")]
2692 pub metadata_value: Option<String>,
2693 /// The metadata visibility. Developer metadata must always have a visibility specified.
2694 pub visibility: Option<String>,
2695}
2696
2697impl common::ResponseResult for DeveloperMetadata {}
2698
2699/// A location where metadata may be associated in a spreadsheet.
2700///
2701/// This type is not used in any activity, and only used as *part* of another schema.
2702///
2703#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2704#[serde_with::serde_as]
2705#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2706pub struct DeveloperMetadataLocation {
2707 /// Represents the row or column when metadata is associated with a dimension. The specified DimensionRange must represent a single row or column; it cannot be unbounded or span multiple rows or columns.
2708 #[serde(rename = "dimensionRange")]
2709 pub dimension_range: Option<DimensionRange>,
2710 /// The type of location this object represents. This field is read-only.
2711 #[serde(rename = "locationType")]
2712 pub location_type: Option<String>,
2713 /// The ID of the sheet when metadata is associated with an entire sheet.
2714 #[serde(rename = "sheetId")]
2715 pub sheet_id: Option<i32>,
2716 /// True when metadata is associated with an entire spreadsheet.
2717 pub spreadsheet: Option<bool>,
2718}
2719
2720impl common::Part for DeveloperMetadataLocation {}
2721
2722/// Selects DeveloperMetadata that matches all of the specified fields. For example, if only a metadata ID is specified this considers the DeveloperMetadata with that particular unique ID. If a metadata key is specified, this considers all developer metadata with that key. If a key, visibility, and location type are all specified, this considers all developer metadata with that key and visibility that are associated with a location of that type. In general, this selects all DeveloperMetadata that matches the intersection of all the specified fields; any field or combination of fields may be specified.
2723///
2724/// This type is not used in any activity, and only used as *part* of another schema.
2725///
2726#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2727#[serde_with::serde_as]
2728#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2729pub struct DeveloperMetadataLookup {
2730 /// Determines how this lookup matches the location. If this field is specified as EXACT, only developer metadata associated on the exact location specified is matched. If this field is specified to INTERSECTING, developer metadata associated on intersecting locations is also matched. If left unspecified, this field assumes a default value of INTERSECTING. If this field is specified, a metadataLocation must also be specified.
2731 #[serde(rename = "locationMatchingStrategy")]
2732 pub location_matching_strategy: Option<String>,
2733 /// Limits the selected developer metadata to those entries which are associated with locations of the specified type. For example, when this field is specified as ROW this lookup only considers developer metadata associated on rows. If the field is left unspecified, all location types are considered. This field cannot be specified as SPREADSHEET when the locationMatchingStrategy is specified as INTERSECTING or when the metadataLocation is specified as a non-spreadsheet location: spreadsheet metadata cannot intersect any other developer metadata location. This field also must be left unspecified when the locationMatchingStrategy is specified as EXACT.
2734 #[serde(rename = "locationType")]
2735 pub location_type: Option<String>,
2736 /// Limits the selected developer metadata to that which has a matching DeveloperMetadata.metadata_id.
2737 #[serde(rename = "metadataId")]
2738 pub metadata_id: Option<i32>,
2739 /// Limits the selected developer metadata to that which has a matching DeveloperMetadata.metadata_key.
2740 #[serde(rename = "metadataKey")]
2741 pub metadata_key: Option<String>,
2742 /// Limits the selected developer metadata to those entries associated with the specified location. This field either matches exact locations or all intersecting locations according the specified locationMatchingStrategy.
2743 #[serde(rename = "metadataLocation")]
2744 pub metadata_location: Option<DeveloperMetadataLocation>,
2745 /// Limits the selected developer metadata to that which has a matching DeveloperMetadata.metadata_value.
2746 #[serde(rename = "metadataValue")]
2747 pub metadata_value: Option<String>,
2748 /// Limits the selected developer metadata to that which has a matching DeveloperMetadata.visibility. If left unspecified, all developer metadata visibile to the requesting project is considered.
2749 pub visibility: Option<String>,
2750}
2751
2752impl common::Part for DeveloperMetadataLookup {}
2753
2754/// A group over an interval of rows or columns on a sheet, which can contain or be contained within other groups. A group can be collapsed or expanded as a unit on the sheet.
2755///
2756/// This type is not used in any activity, and only used as *part* of another schema.
2757///
2758#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2759#[serde_with::serde_as]
2760#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2761pub struct DimensionGroup {
2762 /// This field is true if this group is collapsed. A collapsed group remains collapsed if an overlapping group at a shallower depth is expanded. A true value does not imply that all dimensions within the group are hidden, since a dimension's visibility can change independently from this group property. However, when this property is updated, all dimensions within it are set to hidden if this field is true, or set to visible if this field is false.
2763 pub collapsed: Option<bool>,
2764 /// The depth of the group, representing how many groups have a range that wholly contains the range of this group.
2765 pub depth: Option<i32>,
2766 /// The range over which this group exists.
2767 pub range: Option<DimensionRange>,
2768}
2769
2770impl common::Part for DimensionGroup {}
2771
2772/// Properties about a dimension.
2773///
2774/// This type is not used in any activity, and only used as *part* of another schema.
2775///
2776#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2777#[serde_with::serde_as]
2778#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2779pub struct DimensionProperties {
2780 /// Output only. If set, this is a column in a data source sheet.
2781 #[serde(rename = "dataSourceColumnReference")]
2782 pub data_source_column_reference: Option<DataSourceColumnReference>,
2783 /// The developer metadata associated with a single row or column.
2784 #[serde(rename = "developerMetadata")]
2785 pub developer_metadata: Option<Vec<DeveloperMetadata>>,
2786 /// True if this dimension is being filtered. This field is read-only.
2787 #[serde(rename = "hiddenByFilter")]
2788 pub hidden_by_filter: Option<bool>,
2789 /// True if this dimension is explicitly hidden.
2790 #[serde(rename = "hiddenByUser")]
2791 pub hidden_by_user: Option<bool>,
2792 /// The height (if a row) or width (if a column) of the dimension in pixels.
2793 #[serde(rename = "pixelSize")]
2794 pub pixel_size: Option<i32>,
2795}
2796
2797impl common::Part for DimensionProperties {}
2798
2799/// A range along a single dimension on a sheet. All indexes are zero-based. Indexes are half open: the start index is inclusive and the end index is exclusive. Missing indexes indicate the range is unbounded on that side.
2800///
2801/// This type is not used in any activity, and only used as *part* of another schema.
2802///
2803#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2804#[serde_with::serde_as]
2805#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2806pub struct DimensionRange {
2807 /// The dimension of the span.
2808 pub dimension: Option<String>,
2809 /// The end (exclusive) of the span, or not set if unbounded.
2810 #[serde(rename = "endIndex")]
2811 pub end_index: Option<i32>,
2812 /// The sheet this span is on.
2813 #[serde(rename = "sheetId")]
2814 pub sheet_id: Option<i32>,
2815 /// The start (inclusive) of the span, or not set if unbounded.
2816 #[serde(rename = "startIndex")]
2817 pub start_index: Option<i32>,
2818}
2819
2820impl common::Part for DimensionRange {}
2821
2822/// Duplicates a particular filter view.
2823///
2824/// This type is not used in any activity, and only used as *part* of another schema.
2825///
2826#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2827#[serde_with::serde_as]
2828#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2829pub struct DuplicateFilterViewRequest {
2830 /// The ID of the filter being duplicated.
2831 #[serde(rename = "filterId")]
2832 pub filter_id: Option<i32>,
2833}
2834
2835impl common::Part for DuplicateFilterViewRequest {}
2836
2837/// The result of a filter view being duplicated.
2838///
2839/// This type is not used in any activity, and only used as *part* of another schema.
2840///
2841#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2842#[serde_with::serde_as]
2843#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2844pub struct DuplicateFilterViewResponse {
2845 /// The newly created filter.
2846 pub filter: Option<FilterView>,
2847}
2848
2849impl common::Part for DuplicateFilterViewResponse {}
2850
2851/// Duplicates the contents of a sheet.
2852///
2853/// This type is not used in any activity, and only used as *part* of another schema.
2854///
2855#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2856#[serde_with::serde_as]
2857#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2858pub struct DuplicateSheetRequest {
2859 /// The zero-based index where the new sheet should be inserted. The index of all sheets after this are incremented.
2860 #[serde(rename = "insertSheetIndex")]
2861 pub insert_sheet_index: Option<i32>,
2862 /// If set, the ID of the new sheet. If not set, an ID is chosen. If set, the ID must not conflict with any existing sheet ID. If set, it must be non-negative.
2863 #[serde(rename = "newSheetId")]
2864 pub new_sheet_id: Option<i32>,
2865 /// The name of the new sheet. If empty, a new name is chosen for you.
2866 #[serde(rename = "newSheetName")]
2867 pub new_sheet_name: Option<String>,
2868 /// The sheet to duplicate. If the source sheet is of DATA_SOURCE type, its backing DataSource is also duplicated and associated with the new copy of the sheet. No data execution is triggered, the grid data of this sheet is also copied over but only available after the batch request completes.
2869 #[serde(rename = "sourceSheetId")]
2870 pub source_sheet_id: Option<i32>,
2871}
2872
2873impl common::Part for DuplicateSheetRequest {}
2874
2875/// The result of duplicating a sheet.
2876///
2877/// This type is not used in any activity, and only used as *part* of another schema.
2878///
2879#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2880#[serde_with::serde_as]
2881#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2882pub struct DuplicateSheetResponse {
2883 /// The properties of the duplicate sheet.
2884 pub properties: Option<SheetProperties>,
2885}
2886
2887impl common::Part for DuplicateSheetResponse {}
2888
2889/// The editors of a protected range.
2890///
2891/// This type is not used in any activity, and only used as *part* of another schema.
2892///
2893#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2894#[serde_with::serde_as]
2895#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2896pub struct Editors {
2897 /// True if anyone in the document's domain has edit access to the protected range. Domain protection is only supported on documents within a domain.
2898 #[serde(rename = "domainUsersCanEdit")]
2899 pub domain_users_can_edit: Option<bool>,
2900 /// The email addresses of groups with edit access to the protected range.
2901 pub groups: Option<Vec<String>>,
2902 /// The email addresses of users with edit access to the protected range.
2903 pub users: Option<Vec<String>>,
2904}
2905
2906impl common::Part for Editors {}
2907
2908/// A chart embedded in a sheet.
2909///
2910/// This type is not used in any activity, and only used as *part* of another schema.
2911///
2912#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2913#[serde_with::serde_as]
2914#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2915pub struct EmbeddedChart {
2916 /// The border of the chart.
2917 pub border: Option<EmbeddedObjectBorder>,
2918 /// The ID of the chart.
2919 #[serde(rename = "chartId")]
2920 pub chart_id: Option<i32>,
2921 /// The position of the chart.
2922 pub position: Option<EmbeddedObjectPosition>,
2923 /// The specification of the chart.
2924 pub spec: Option<ChartSpec>,
2925}
2926
2927impl common::Part for EmbeddedChart {}
2928
2929/// A border along an embedded object.
2930///
2931/// This type is not used in any activity, and only used as *part* of another schema.
2932///
2933#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2934#[serde_with::serde_as]
2935#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2936pub struct EmbeddedObjectBorder {
2937 /// The color of the border. Deprecated: Use color_style.
2938 pub color: Option<Color>,
2939 /// The color of the border. If color is also set, this field takes precedence.
2940 #[serde(rename = "colorStyle")]
2941 pub color_style: Option<ColorStyle>,
2942}
2943
2944impl common::Part for EmbeddedObjectBorder {}
2945
2946/// The position of an embedded object such as a chart.
2947///
2948/// This type is not used in any activity, and only used as *part* of another schema.
2949///
2950#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2951#[serde_with::serde_as]
2952#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2953pub struct EmbeddedObjectPosition {
2954 /// If true, the embedded object is put on a new sheet whose ID is chosen for you. Used only when writing.
2955 #[serde(rename = "newSheet")]
2956 pub new_sheet: Option<bool>,
2957 /// The position at which the object is overlaid on top of a grid.
2958 #[serde(rename = "overlayPosition")]
2959 pub overlay_position: Option<OverlayPosition>,
2960 /// The sheet this is on. Set only if the embedded object is on its own sheet. Must be non-negative.
2961 #[serde(rename = "sheetId")]
2962 pub sheet_id: Option<i32>,
2963}
2964
2965impl common::Part for EmbeddedObjectPosition {}
2966
2967/// An error in a cell.
2968///
2969/// This type is not used in any activity, and only used as *part* of another schema.
2970///
2971#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2972#[serde_with::serde_as]
2973#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2974pub struct ErrorValue {
2975 /// A message with more information about the error (in the spreadsheet's locale).
2976 pub message: Option<String>,
2977 /// The type of error.
2978 #[serde(rename = "type")]
2979 pub type_: Option<String>,
2980}
2981
2982impl common::Part for ErrorValue {}
2983
2984/// The kinds of value that a cell in a spreadsheet can have.
2985///
2986/// This type is not used in any activity, and only used as *part* of another schema.
2987///
2988#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2989#[serde_with::serde_as]
2990#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2991pub struct ExtendedValue {
2992 /// Represents a boolean value.
2993 #[serde(rename = "boolValue")]
2994 pub bool_value: Option<bool>,
2995 /// Represents an error. This field is read-only.
2996 #[serde(rename = "errorValue")]
2997 pub error_value: Option<ErrorValue>,
2998 /// Represents a formula.
2999 #[serde(rename = "formulaValue")]
3000 pub formula_value: Option<String>,
3001 /// Represents a double value. Note: Dates, Times and DateTimes are represented as doubles in SERIAL_NUMBER format.
3002 #[serde(rename = "numberValue")]
3003 pub number_value: Option<f64>,
3004 /// Represents a string value. Leading single quotes are not included. For example, if the user typed `'123` into the UI, this would be represented as a `stringValue` of `"123"`.
3005 #[serde(rename = "stringValue")]
3006 pub string_value: Option<String>,
3007}
3008
3009impl common::Part for ExtendedValue {}
3010
3011/// Criteria for showing/hiding rows in a filter or filter view.
3012///
3013/// This type is not used in any activity, and only used as *part* of another schema.
3014///
3015#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3016#[serde_with::serde_as]
3017#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3018pub struct FilterCriteria {
3019 /// A condition that must be true for values to be shown. (This does not override hidden_values -- if a value is listed there, it will still be hidden.)
3020 pub condition: Option<BooleanCondition>,
3021 /// Values that should be hidden.
3022 #[serde(rename = "hiddenValues")]
3023 pub hidden_values: Option<Vec<String>>,
3024 /// The background fill color to filter by; only cells with this fill color are shown. Mutually exclusive with visible_foreground_color. Deprecated: Use visible_background_color_style.
3025 #[serde(rename = "visibleBackgroundColor")]
3026 pub visible_background_color: Option<Color>,
3027 /// The background fill color to filter by; only cells with this fill color are shown. This field is mutually exclusive with visible_foreground_color, and must be set to an RGB-type color. If visible_background_color is also set, this field takes precedence.
3028 #[serde(rename = "visibleBackgroundColorStyle")]
3029 pub visible_background_color_style: Option<ColorStyle>,
3030 /// The foreground color to filter by; only cells with this foreground color are shown. Mutually exclusive with visible_background_color. Deprecated: Use visible_foreground_color_style.
3031 #[serde(rename = "visibleForegroundColor")]
3032 pub visible_foreground_color: Option<Color>,
3033 /// The foreground color to filter by; only cells with this foreground color are shown. This field is mutually exclusive with visible_background_color, and must be set to an RGB-type color. If visible_foreground_color is also set, this field takes precedence.
3034 #[serde(rename = "visibleForegroundColorStyle")]
3035 pub visible_foreground_color_style: Option<ColorStyle>,
3036}
3037
3038impl common::Part for FilterCriteria {}
3039
3040/// The filter criteria associated with a specific column.
3041///
3042/// This type is not used in any activity, and only used as *part* of another schema.
3043///
3044#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3045#[serde_with::serde_as]
3046#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3047pub struct FilterSpec {
3048 /// The zero-based column index.
3049 #[serde(rename = "columnIndex")]
3050 pub column_index: Option<i32>,
3051 /// Reference to a data source column.
3052 #[serde(rename = "dataSourceColumnReference")]
3053 pub data_source_column_reference: Option<DataSourceColumnReference>,
3054 /// The criteria for the column.
3055 #[serde(rename = "filterCriteria")]
3056 pub filter_criteria: Option<FilterCriteria>,
3057}
3058
3059impl common::Part for FilterSpec {}
3060
3061/// A filter view.
3062///
3063/// This type is not used in any activity, and only used as *part* of another schema.
3064///
3065#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3066#[serde_with::serde_as]
3067#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3068pub struct FilterView {
3069 /// The criteria for showing/hiding values per column. The map's key is the column index, and the value is the criteria for that column. This field is deprecated in favor of filter_specs.
3070 pub criteria: Option<HashMap<String, FilterCriteria>>,
3071 /// The filter criteria for showing/hiding values per column. Both criteria and filter_specs are populated in responses. If both fields are specified in an update request, this field takes precedence.
3072 #[serde(rename = "filterSpecs")]
3073 pub filter_specs: Option<Vec<FilterSpec>>,
3074 /// The ID of the filter view.
3075 #[serde(rename = "filterViewId")]
3076 pub filter_view_id: Option<i32>,
3077 /// The named range this filter view is backed by, if any. When writing, only one of range or named_range_id may be set.
3078 #[serde(rename = "namedRangeId")]
3079 pub named_range_id: Option<String>,
3080 /// The range this filter view covers. When writing, only one of range or named_range_id may be set.
3081 pub range: Option<GridRange>,
3082 /// The sort order per column. Later specifications are used when values are equal in the earlier specifications.
3083 #[serde(rename = "sortSpecs")]
3084 pub sort_specs: Option<Vec<SortSpec>>,
3085 /// The name of the filter view.
3086 pub title: Option<String>,
3087}
3088
3089impl common::Part for FilterView {}
3090
3091/// Finds and replaces data in cells over a range, sheet, or all sheets.
3092///
3093/// This type is not used in any activity, and only used as *part* of another schema.
3094///
3095#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3096#[serde_with::serde_as]
3097#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3098pub struct FindReplaceRequest {
3099 /// True to find/replace over all sheets.
3100 #[serde(rename = "allSheets")]
3101 pub all_sheets: Option<bool>,
3102 /// The value to search.
3103 pub find: Option<String>,
3104 /// True if the search should include cells with formulas. False to skip cells with formulas.
3105 #[serde(rename = "includeFormulas")]
3106 pub include_formulas: Option<bool>,
3107 /// True if the search is case sensitive.
3108 #[serde(rename = "matchCase")]
3109 pub match_case: Option<bool>,
3110 /// True if the find value should match the entire cell.
3111 #[serde(rename = "matchEntireCell")]
3112 pub match_entire_cell: Option<bool>,
3113 /// The range to find/replace over.
3114 pub range: Option<GridRange>,
3115 /// The value to use as the replacement.
3116 pub replacement: Option<String>,
3117 /// True if the find value is a regex. The regular expression and replacement should follow Java regex rules at https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html. The replacement string is allowed to refer to capturing groups. For example, if one cell has the contents `"Google Sheets"` and another has `"Google Docs"`, then searching for `"o.* (.*)"` with a replacement of `"$1 Rocks"` would change the contents of the cells to `"GSheets Rocks"` and `"GDocs Rocks"` respectively.
3118 #[serde(rename = "searchByRegex")]
3119 pub search_by_regex: Option<bool>,
3120 /// The sheet to find/replace over.
3121 #[serde(rename = "sheetId")]
3122 pub sheet_id: Option<i32>,
3123}
3124
3125impl common::Part for FindReplaceRequest {}
3126
3127/// The result of the find/replace.
3128///
3129/// This type is not used in any activity, and only used as *part* of another schema.
3130///
3131#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3132#[serde_with::serde_as]
3133#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3134pub struct FindReplaceResponse {
3135 /// The number of formula cells changed.
3136 #[serde(rename = "formulasChanged")]
3137 pub formulas_changed: Option<i32>,
3138 /// The number of occurrences (possibly multiple within a cell) changed. For example, if replacing `"e"` with `"o"` in `"Google Sheets"`, this would be `"3"` because `"Google Sheets"` -> `"Googlo Shoots"`.
3139 #[serde(rename = "occurrencesChanged")]
3140 pub occurrences_changed: Option<i32>,
3141 /// The number of rows changed.
3142 #[serde(rename = "rowsChanged")]
3143 pub rows_changed: Option<i32>,
3144 /// The number of sheets changed.
3145 #[serde(rename = "sheetsChanged")]
3146 pub sheets_changed: Option<i32>,
3147 /// The number of non-formula cells changed.
3148 #[serde(rename = "valuesChanged")]
3149 pub values_changed: Option<i32>,
3150}
3151
3152impl common::Part for FindReplaceResponse {}
3153
3154/// The request for retrieving a Spreadsheet.
3155///
3156/// # Activities
3157///
3158/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3159/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3160///
3161/// * [get by data filter spreadsheets](SpreadsheetGetByDataFilterCall) (request)
3162#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3163#[serde_with::serde_as]
3164#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3165pub struct GetSpreadsheetByDataFilterRequest {
3166 /// The DataFilters used to select which ranges to retrieve from the spreadsheet.
3167 #[serde(rename = "dataFilters")]
3168 pub data_filters: Option<Vec<DataFilter>>,
3169 /// True if grid data should be returned. This parameter is ignored if a field mask was set in the request.
3170 #[serde(rename = "includeGridData")]
3171 pub include_grid_data: Option<bool>,
3172}
3173
3174impl common::RequestValue for GetSpreadsheetByDataFilterRequest {}
3175
3176/// A rule that applies a gradient color scale format, based on the interpolation points listed. The format of a cell will vary based on its contents as compared to the values of the interpolation points.
3177///
3178/// This type is not used in any activity, and only used as *part* of another schema.
3179///
3180#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3181#[serde_with::serde_as]
3182#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3183pub struct GradientRule {
3184 /// The final interpolation point.
3185 pub maxpoint: Option<InterpolationPoint>,
3186 /// An optional midway interpolation point.
3187 pub midpoint: Option<InterpolationPoint>,
3188 /// The starting interpolation point.
3189 pub minpoint: Option<InterpolationPoint>,
3190}
3191
3192impl common::Part for GradientRule {}
3193
3194/// A coordinate in a sheet. All indexes are zero-based.
3195///
3196/// This type is not used in any activity, and only used as *part* of another schema.
3197///
3198#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3199#[serde_with::serde_as]
3200#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3201pub struct GridCoordinate {
3202 /// The column index of the coordinate.
3203 #[serde(rename = "columnIndex")]
3204 pub column_index: Option<i32>,
3205 /// The row index of the coordinate.
3206 #[serde(rename = "rowIndex")]
3207 pub row_index: Option<i32>,
3208 /// The sheet this coordinate is on.
3209 #[serde(rename = "sheetId")]
3210 pub sheet_id: Option<i32>,
3211}
3212
3213impl common::Part for GridCoordinate {}
3214
3215/// Data in the grid, as well as metadata about the dimensions.
3216///
3217/// This type is not used in any activity, and only used as *part* of another schema.
3218///
3219#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3220#[serde_with::serde_as]
3221#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3222pub struct GridData {
3223 /// Metadata about the requested columns in the grid, starting with the column in start_column.
3224 #[serde(rename = "columnMetadata")]
3225 pub column_metadata: Option<Vec<DimensionProperties>>,
3226 /// The data in the grid, one entry per row, starting with the row in startRow. The values in RowData will correspond to columns starting at start_column.
3227 #[serde(rename = "rowData")]
3228 pub row_data: Option<Vec<RowData>>,
3229 /// Metadata about the requested rows in the grid, starting with the row in start_row.
3230 #[serde(rename = "rowMetadata")]
3231 pub row_metadata: Option<Vec<DimensionProperties>>,
3232 /// The first column this GridData refers to, zero-based.
3233 #[serde(rename = "startColumn")]
3234 pub start_column: Option<i32>,
3235 /// The first row this GridData refers to, zero-based.
3236 #[serde(rename = "startRow")]
3237 pub start_row: Option<i32>,
3238}
3239
3240impl common::Part for GridData {}
3241
3242/// Properties of a grid.
3243///
3244/// This type is not used in any activity, and only used as *part* of another schema.
3245///
3246#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3247#[serde_with::serde_as]
3248#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3249pub struct GridProperties {
3250 /// The number of columns in the grid.
3251 #[serde(rename = "columnCount")]
3252 pub column_count: Option<i32>,
3253 /// True if the column grouping control toggle is shown after the group.
3254 #[serde(rename = "columnGroupControlAfter")]
3255 pub column_group_control_after: Option<bool>,
3256 /// The number of columns that are frozen in the grid.
3257 #[serde(rename = "frozenColumnCount")]
3258 pub frozen_column_count: Option<i32>,
3259 /// The number of rows that are frozen in the grid.
3260 #[serde(rename = "frozenRowCount")]
3261 pub frozen_row_count: Option<i32>,
3262 /// True if the grid isn't showing gridlines in the UI.
3263 #[serde(rename = "hideGridlines")]
3264 pub hide_gridlines: Option<bool>,
3265 /// The number of rows in the grid.
3266 #[serde(rename = "rowCount")]
3267 pub row_count: Option<i32>,
3268 /// True if the row grouping control toggle is shown after the group.
3269 #[serde(rename = "rowGroupControlAfter")]
3270 pub row_group_control_after: Option<bool>,
3271}
3272
3273impl common::Part for GridProperties {}
3274
3275/// A range on a sheet. All indexes are zero-based. Indexes are half open, i.e. the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side. For example, if `"Sheet1"` is sheet ID 123456, then: `Sheet1!A1:A1 == sheet_id: 123456, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1` `Sheet1!A3:B4 == sheet_id: 123456, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2` `Sheet1!A:B == sheet_id: 123456, start_column_index: 0, end_column_index: 2` `Sheet1!A5:B == sheet_id: 123456, start_row_index: 4, start_column_index: 0, end_column_index: 2` `Sheet1 == sheet_id: 123456` The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as `#REF!`.
3276///
3277/// This type is not used in any activity, and only used as *part* of another schema.
3278///
3279#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3280#[serde_with::serde_as]
3281#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3282pub struct GridRange {
3283 /// The end column (exclusive) of the range, or not set if unbounded.
3284 #[serde(rename = "endColumnIndex")]
3285 pub end_column_index: Option<i32>,
3286 /// The end row (exclusive) of the range, or not set if unbounded.
3287 #[serde(rename = "endRowIndex")]
3288 pub end_row_index: Option<i32>,
3289 /// The sheet this range is on.
3290 #[serde(rename = "sheetId")]
3291 pub sheet_id: Option<i32>,
3292 /// The start column (inclusive) of the range, or not set if unbounded.
3293 #[serde(rename = "startColumnIndex")]
3294 pub start_column_index: Option<i32>,
3295 /// The start row (inclusive) of the range, or not set if unbounded.
3296 #[serde(rename = "startRowIndex")]
3297 pub start_row_index: Option<i32>,
3298}
3299
3300impl common::Part for GridRange {}
3301
3302/// A histogram chart. A histogram chart groups data items into bins, displaying each bin as a column of stacked items. Histograms are used to display the distribution of a dataset. Each column of items represents a range into which those items fall. The number of bins can be chosen automatically or specified explicitly.
3303///
3304/// This type is not used in any activity, and only used as *part* of another schema.
3305///
3306#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3307#[serde_with::serde_as]
3308#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3309pub struct HistogramChartSpec {
3310 /// By default the bucket size (the range of values stacked in a single column) is chosen automatically, but it may be overridden here. E.g., A bucket size of 1.5 results in buckets from 0 - 1.5, 1.5 - 3.0, etc. Cannot be negative. This field is optional.
3311 #[serde(rename = "bucketSize")]
3312 pub bucket_size: Option<f64>,
3313 /// The position of the chart legend.
3314 #[serde(rename = "legendPosition")]
3315 pub legend_position: Option<String>,
3316 /// The outlier percentile is used to ensure that outliers do not adversely affect the calculation of bucket sizes. For example, setting an outlier percentile of 0.05 indicates that the top and bottom 5% of values when calculating buckets. The values are still included in the chart, they will be added to the first or last buckets instead of their own buckets. Must be between 0.0 and 0.5.
3317 #[serde(rename = "outlierPercentile")]
3318 pub outlier_percentile: Option<f64>,
3319 /// The series for a histogram may be either a single series of values to be bucketed or multiple series, each of the same length, containing the name of the series followed by the values to be bucketed for that series.
3320 pub series: Option<Vec<HistogramSeries>>,
3321 /// Whether horizontal divider lines should be displayed between items in each column.
3322 #[serde(rename = "showItemDividers")]
3323 pub show_item_dividers: Option<bool>,
3324}
3325
3326impl common::Part for HistogramChartSpec {}
3327
3328/// Allows you to organize the numeric values in a source data column into buckets of a constant size. All values from HistogramRule.start to HistogramRule.end are placed into groups of size HistogramRule.interval. In addition, all values below HistogramRule.start are placed in one group, and all values above HistogramRule.end are placed in another. Only HistogramRule.interval is required, though if HistogramRule.start and HistogramRule.end are both provided, HistogramRule.start must be less than HistogramRule.end. For example, a pivot table showing average purchase amount by age that has 50+ rows: +-----+-------------------+ | Age | AVERAGE of Amount | +-----+-------------------+ | 16 | $27.13 | | 17 | $5.24 | | 18 | $20.15 | ... +-----+-------------------+ could be turned into a pivot table that looks like the one below by applying a histogram group rule with a HistogramRule.start of 25, an HistogramRule.interval of 20, and an HistogramRule.end of 65. +-------------+-------------------+ | Grouped Age | AVERAGE of Amount | +-------------+-------------------+ | < 25 | $19.34 | | 25-45 | $31.43 | | 45-65 | $35.87 | | > 65 | $27.55 | +-------------+-------------------+ | Grand Total | $29.12 | +-------------+-------------------+
3329///
3330/// This type is not used in any activity, and only used as *part* of another schema.
3331///
3332#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3333#[serde_with::serde_as]
3334#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3335pub struct HistogramRule {
3336 /// The maximum value at which items are placed into buckets of constant size. Values above end are lumped into a single bucket. This field is optional.
3337 pub end: Option<f64>,
3338 /// The size of the buckets that are created. Must be positive.
3339 pub interval: Option<f64>,
3340 /// The minimum value at which items are placed into buckets of constant size. Values below start are lumped into a single bucket. This field is optional.
3341 pub start: Option<f64>,
3342}
3343
3344impl common::Part for HistogramRule {}
3345
3346/// A histogram series containing the series color and data.
3347///
3348/// This type is not used in any activity, and only used as *part* of another schema.
3349///
3350#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3351#[serde_with::serde_as]
3352#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3353pub struct HistogramSeries {
3354 /// The color of the column representing this series in each bucket. This field is optional. Deprecated: Use bar_color_style.
3355 #[serde(rename = "barColor")]
3356 pub bar_color: Option<Color>,
3357 /// The color of the column representing this series in each bucket. This field is optional. If bar_color is also set, this field takes precedence.
3358 #[serde(rename = "barColorStyle")]
3359 pub bar_color_style: Option<ColorStyle>,
3360 /// The data for this histogram series.
3361 pub data: Option<ChartData>,
3362}
3363
3364impl common::Part for HistogramSeries {}
3365
3366/// Inserts rows or columns in a sheet at a particular index.
3367///
3368/// This type is not used in any activity, and only used as *part* of another schema.
3369///
3370#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3371#[serde_with::serde_as]
3372#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3373pub struct InsertDimensionRequest {
3374 /// Whether dimension properties should be extended from the dimensions before or after the newly inserted dimensions. True to inherit from the dimensions before (in which case the start index must be greater than 0), and false to inherit from the dimensions after. For example, if row index 0 has red background and row index 1 has a green background, then inserting 2 rows at index 1 can inherit either the green or red background. If `inheritFromBefore` is true, the two new rows will be red (because the row before the insertion point was red), whereas if `inheritFromBefore` is false, the two new rows will be green (because the row after the insertion point was green).
3375 #[serde(rename = "inheritFromBefore")]
3376 pub inherit_from_before: Option<bool>,
3377 /// The dimensions to insert. Both the start and end indexes must be bounded.
3378 pub range: Option<DimensionRange>,
3379}
3380
3381impl common::Part for InsertDimensionRequest {}
3382
3383/// Inserts cells into a range, shifting the existing cells over or down.
3384///
3385/// This type is not used in any activity, and only used as *part* of another schema.
3386///
3387#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3388#[serde_with::serde_as]
3389#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3390pub struct InsertRangeRequest {
3391 /// The range to insert new cells into.
3392 pub range: Option<GridRange>,
3393 /// The dimension which will be shifted when inserting cells. If ROWS, existing cells will be shifted down. If COLUMNS, existing cells will be shifted right.
3394 #[serde(rename = "shiftDimension")]
3395 pub shift_dimension: Option<String>,
3396}
3397
3398impl common::Part for InsertRangeRequest {}
3399
3400/// A single interpolation point on a gradient conditional format. These pin the gradient color scale according to the color, type and value chosen.
3401///
3402/// This type is not used in any activity, and only used as *part* of another schema.
3403///
3404#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3405#[serde_with::serde_as]
3406#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3407pub struct InterpolationPoint {
3408 /// The color this interpolation point should use. Deprecated: Use color_style.
3409 pub color: Option<Color>,
3410 /// The color this interpolation point should use. If color is also set, this field takes precedence.
3411 #[serde(rename = "colorStyle")]
3412 pub color_style: Option<ColorStyle>,
3413 /// How the value should be interpreted.
3414 #[serde(rename = "type")]
3415 pub type_: Option<String>,
3416 /// The value this interpolation point uses. May be a formula. Unused if type is MIN or MAX.
3417 pub value: Option<String>,
3418}
3419
3420impl common::Part for InterpolationPoint {}
3421
3422/// Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.
3423///
3424/// This type is not used in any activity, and only used as *part* of another schema.
3425///
3426#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3427#[serde_with::serde_as]
3428#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3429pub struct Interval {
3430 /// Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.
3431 #[serde(rename = "endTime")]
3432 pub end_time: Option<chrono::DateTime<chrono::offset::Utc>>,
3433 /// Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.
3434 #[serde(rename = "startTime")]
3435 pub start_time: Option<chrono::DateTime<chrono::offset::Utc>>,
3436}
3437
3438impl common::Part for Interval {}
3439
3440/// Settings to control how circular dependencies are resolved with iterative calculation.
3441///
3442/// This type is not used in any activity, and only used as *part* of another schema.
3443///
3444#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3445#[serde_with::serde_as]
3446#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3447pub struct IterativeCalculationSettings {
3448 /// When iterative calculation is enabled and successive results differ by less than this threshold value, the calculation rounds stop.
3449 #[serde(rename = "convergenceThreshold")]
3450 pub convergence_threshold: Option<f64>,
3451 /// When iterative calculation is enabled, the maximum number of calculation rounds to perform.
3452 #[serde(rename = "maxIterations")]
3453 pub max_iterations: Option<i32>,
3454}
3455
3456impl common::Part for IterativeCalculationSettings {}
3457
3458/// Formatting options for key value.
3459///
3460/// This type is not used in any activity, and only used as *part* of another schema.
3461///
3462#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3463#[serde_with::serde_as]
3464#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3465pub struct KeyValueFormat {
3466 /// Specifies the horizontal text positioning of key value. This field is optional. If not specified, default positioning is used.
3467 pub position: Option<TextPosition>,
3468 /// Text formatting options for key value. The link field is not supported.
3469 #[serde(rename = "textFormat")]
3470 pub text_format: Option<TextFormat>,
3471}
3472
3473impl common::Part for KeyValueFormat {}
3474
3475/// Properties that describe the style of a line.
3476///
3477/// This type is not used in any activity, and only used as *part* of another schema.
3478///
3479#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3480#[serde_with::serde_as]
3481#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3482pub struct LineStyle {
3483 /// The dash type of the line.
3484 #[serde(rename = "type")]
3485 pub type_: Option<String>,
3486 /// The thickness of the line, in px.
3487 pub width: Option<i32>,
3488}
3489
3490impl common::Part for LineStyle {}
3491
3492/// An external or local reference.
3493///
3494/// This type is not used in any activity, and only used as *part* of another schema.
3495///
3496#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3497#[serde_with::serde_as]
3498#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3499pub struct Link {
3500 /// The link identifier.
3501 pub uri: Option<String>,
3502}
3503
3504impl common::Part for Link {}
3505
3506/// Allows you to manually organize the values in a source data column into buckets with names of your choosing. For example, a pivot table that aggregates population by state: +-------+-------------------+ | State | SUM of Population | +-------+-------------------+ | AK | 0.7 | | AL | 4.8 | | AR | 2.9 | ... +-------+-------------------+ could be turned into a pivot table that aggregates population by time zone by providing a list of groups (for example, groupName = 'Central', items = ['AL', 'AR', 'IA', ...]) to a manual group rule. Note that a similar effect could be achieved by adding a time zone column to the source data and adjusting the pivot table. +-----------+-------------------+ | Time Zone | SUM of Population | +-----------+-------------------+ | Central | 106.3 | | Eastern | 151.9 | | Mountain | 17.4 | ... +-----------+-------------------+
3507///
3508/// This type is not used in any activity, and only used as *part* of another schema.
3509///
3510#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3511#[serde_with::serde_as]
3512#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3513pub struct ManualRule {
3514 /// The list of group names and the corresponding items from the source data that map to each group name.
3515 pub groups: Option<Vec<ManualRuleGroup>>,
3516}
3517
3518impl common::Part for ManualRule {}
3519
3520/// A group name and a list of items from the source data that should be placed in the group with this name.
3521///
3522/// This type is not used in any activity, and only used as *part* of another schema.
3523///
3524#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3525#[serde_with::serde_as]
3526#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3527pub struct ManualRuleGroup {
3528 /// The group name, which must be a string. Each group in a given ManualRule must have a unique group name.
3529 #[serde(rename = "groupName")]
3530 pub group_name: Option<ExtendedValue>,
3531 /// The items in the source data that should be placed into this group. Each item may be a string, number, or boolean. Items may appear in at most one group within a given ManualRule. Items that do not appear in any group will appear on their own.
3532 pub items: Option<Vec<ExtendedValue>>,
3533}
3534
3535impl common::Part for ManualRuleGroup {}
3536
3537/// A developer metadata entry and the data filters specified in the original request that matched it.
3538///
3539/// This type is not used in any activity, and only used as *part* of another schema.
3540///
3541#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3542#[serde_with::serde_as]
3543#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3544pub struct MatchedDeveloperMetadata {
3545 /// All filters matching the returned developer metadata.
3546 #[serde(rename = "dataFilters")]
3547 pub data_filters: Option<Vec<DataFilter>>,
3548 /// The developer metadata matching the specified filters.
3549 #[serde(rename = "developerMetadata")]
3550 pub developer_metadata: Option<DeveloperMetadata>,
3551}
3552
3553impl common::Part for MatchedDeveloperMetadata {}
3554
3555/// A value range that was matched by one or more data filers.
3556///
3557/// This type is not used in any activity, and only used as *part* of another schema.
3558///
3559#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3560#[serde_with::serde_as]
3561#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3562pub struct MatchedValueRange {
3563 /// The DataFilters from the request that matched the range of values.
3564 #[serde(rename = "dataFilters")]
3565 pub data_filters: Option<Vec<DataFilter>>,
3566 /// The values matched by the DataFilter.
3567 #[serde(rename = "valueRange")]
3568 pub value_range: Option<ValueRange>,
3569}
3570
3571impl common::Part for MatchedValueRange {}
3572
3573/// Merges all cells in the range.
3574///
3575/// This type is not used in any activity, and only used as *part* of another schema.
3576///
3577#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3578#[serde_with::serde_as]
3579#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3580pub struct MergeCellsRequest {
3581 /// How the cells should be merged.
3582 #[serde(rename = "mergeType")]
3583 pub merge_type: Option<String>,
3584 /// The range of cells to merge.
3585 pub range: Option<GridRange>,
3586}
3587
3588impl common::Part for MergeCellsRequest {}
3589
3590/// Moves one or more rows or columns.
3591///
3592/// This type is not used in any activity, and only used as *part* of another schema.
3593///
3594#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3595#[serde_with::serde_as]
3596#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3597pub struct MoveDimensionRequest {
3598 /// The zero-based start index of where to move the source data to, based on the coordinates *before* the source data is removed from the grid. Existing data will be shifted down or right (depending on the dimension) to make room for the moved dimensions. The source dimensions are removed from the grid, so the the data may end up in a different index than specified. For example, given `A1..A5` of `0, 1, 2, 3, 4` and wanting to move `"1"` and `"2"` to between `"3"` and `"4"`, the source would be `ROWS [1..3)`,and the destination index would be `"4"` (the zero-based index of row 5). The end result would be `A1..A5` of `0, 3, 1, 2, 4`.
3599 #[serde(rename = "destinationIndex")]
3600 pub destination_index: Option<i32>,
3601 /// The source dimensions to move.
3602 pub source: Option<DimensionRange>,
3603}
3604
3605impl common::Part for MoveDimensionRequest {}
3606
3607/// A named range.
3608///
3609/// This type is not used in any activity, and only used as *part* of another schema.
3610///
3611#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3612#[serde_with::serde_as]
3613#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3614pub struct NamedRange {
3615 /// The name of the named range.
3616 pub name: Option<String>,
3617 /// The ID of the named range.
3618 #[serde(rename = "namedRangeId")]
3619 pub named_range_id: Option<String>,
3620 /// The range this represents.
3621 pub range: Option<GridRange>,
3622}
3623
3624impl common::Part for NamedRange {}
3625
3626/// The number format of a cell.
3627///
3628/// This type is not used in any activity, and only used as *part* of another schema.
3629///
3630#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3631#[serde_with::serde_as]
3632#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3633pub struct NumberFormat {
3634 /// Pattern string used for formatting. If not set, a default pattern based on the user’s locale will be used if necessary for the given type. See the [Date and Number Formats guide](https://developers.google.com/sheets/api/guides/formats) for more information about the supported patterns.
3635 pub pattern: Option<String>,
3636 /// The type of the number format. When writing, this field must be set.
3637 #[serde(rename = "type")]
3638 pub type_: Option<String>,
3639}
3640
3641impl common::Part for NumberFormat {}
3642
3643/// An org chart. Org charts require a unique set of labels in labels and may optionally include parent_labels and tooltips. parent_labels contain, for each node, the label identifying the parent node. tooltips contain, for each node, an optional tooltip. For example, to describe an OrgChart with Alice as the CEO, Bob as the President (reporting to Alice) and Cathy as VP of Sales (also reporting to Alice), have labels contain "Alice", "Bob", "Cathy", parent_labels contain "", "Alice", "Alice" and tooltips contain "CEO", "President", "VP Sales".
3644///
3645/// This type is not used in any activity, and only used as *part* of another schema.
3646///
3647#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3648#[serde_with::serde_as]
3649#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3650pub struct OrgChartSpec {
3651 /// The data containing the labels for all the nodes in the chart. Labels must be unique.
3652 pub labels: Option<ChartData>,
3653 /// The color of the org chart nodes. Deprecated: Use node_color_style.
3654 #[serde(rename = "nodeColor")]
3655 pub node_color: Option<Color>,
3656 /// The color of the org chart nodes. If node_color is also set, this field takes precedence.
3657 #[serde(rename = "nodeColorStyle")]
3658 pub node_color_style: Option<ColorStyle>,
3659 /// The size of the org chart nodes.
3660 #[serde(rename = "nodeSize")]
3661 pub node_size: Option<String>,
3662 /// The data containing the label of the parent for the corresponding node. A blank value indicates that the node has no parent and is a top-level node. This field is optional.
3663 #[serde(rename = "parentLabels")]
3664 pub parent_labels: Option<ChartData>,
3665 /// The color of the selected org chart nodes. Deprecated: Use selected_node_color_style.
3666 #[serde(rename = "selectedNodeColor")]
3667 pub selected_node_color: Option<Color>,
3668 /// The color of the selected org chart nodes. If selected_node_color is also set, this field takes precedence.
3669 #[serde(rename = "selectedNodeColorStyle")]
3670 pub selected_node_color_style: Option<ColorStyle>,
3671 /// The data containing the tooltip for the corresponding node. A blank value results in no tooltip being displayed for the node. This field is optional.
3672 pub tooltips: Option<ChartData>,
3673}
3674
3675impl common::Part for OrgChartSpec {}
3676
3677/// The location an object is overlaid on top of a grid.
3678///
3679/// This type is not used in any activity, and only used as *part* of another schema.
3680///
3681#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3682#[serde_with::serde_as]
3683#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3684pub struct OverlayPosition {
3685 /// The cell the object is anchored to.
3686 #[serde(rename = "anchorCell")]
3687 pub anchor_cell: Option<GridCoordinate>,
3688 /// The height of the object, in pixels. Defaults to 371.
3689 #[serde(rename = "heightPixels")]
3690 pub height_pixels: Option<i32>,
3691 /// The horizontal offset, in pixels, that the object is offset from the anchor cell.
3692 #[serde(rename = "offsetXPixels")]
3693 pub offset_x_pixels: Option<i32>,
3694 /// The vertical offset, in pixels, that the object is offset from the anchor cell.
3695 #[serde(rename = "offsetYPixels")]
3696 pub offset_y_pixels: Option<i32>,
3697 /// The width of the object, in pixels. Defaults to 600.
3698 #[serde(rename = "widthPixels")]
3699 pub width_pixels: Option<i32>,
3700}
3701
3702impl common::Part for OverlayPosition {}
3703
3704/// The amount of padding around the cell, in pixels. When updating padding, every field must be specified.
3705///
3706/// This type is not used in any activity, and only used as *part* of another schema.
3707///
3708#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3709#[serde_with::serde_as]
3710#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3711pub struct Padding {
3712 /// The bottom padding of the cell.
3713 pub bottom: Option<i32>,
3714 /// The left padding of the cell.
3715 pub left: Option<i32>,
3716 /// The right padding of the cell.
3717 pub right: Option<i32>,
3718 /// The top padding of the cell.
3719 pub top: Option<i32>,
3720}
3721
3722impl common::Part for Padding {}
3723
3724/// Inserts data into the spreadsheet starting at the specified coordinate.
3725///
3726/// This type is not used in any activity, and only used as *part* of another schema.
3727///
3728#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3729#[serde_with::serde_as]
3730#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3731pub struct PasteDataRequest {
3732 /// The coordinate at which the data should start being inserted.
3733 pub coordinate: Option<GridCoordinate>,
3734 /// The data to insert.
3735 pub data: Option<String>,
3736 /// The delimiter in the data.
3737 pub delimiter: Option<String>,
3738 /// True if the data is HTML.
3739 pub html: Option<bool>,
3740 /// How the data should be pasted.
3741 #[serde(rename = "type")]
3742 pub type_: Option<String>,
3743}
3744
3745impl common::Part for PasteDataRequest {}
3746
3747/// A pie chart.
3748///
3749/// This type is not used in any activity, and only used as *part* of another schema.
3750///
3751#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3752#[serde_with::serde_as]
3753#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3754pub struct PieChartSpec {
3755 /// The data that covers the domain of the pie chart.
3756 pub domain: Option<ChartData>,
3757 /// Where the legend of the pie chart should be drawn.
3758 #[serde(rename = "legendPosition")]
3759 pub legend_position: Option<String>,
3760 /// The size of the hole in the pie chart.
3761 #[serde(rename = "pieHole")]
3762 pub pie_hole: Option<f64>,
3763 /// The data that covers the one and only series of the pie chart.
3764 pub series: Option<ChartData>,
3765 /// True if the pie is three dimensional.
3766 #[serde(rename = "threeDimensional")]
3767 pub three_dimensional: Option<bool>,
3768}
3769
3770impl common::Part for PieChartSpec {}
3771
3772/// Criteria for showing/hiding rows in a pivot table.
3773///
3774/// This type is not used in any activity, and only used as *part* of another schema.
3775///
3776#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3777#[serde_with::serde_as]
3778#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3779pub struct PivotFilterCriteria {
3780 /// A condition that must be true for values to be shown. (`visibleValues` does not override this -- even if a value is listed there, it is still hidden if it does not meet the condition.) Condition values that refer to ranges in A1-notation are evaluated relative to the pivot table sheet. References are treated absolutely, so are not filled down the pivot table. For example, a condition value of `=A1` on "Pivot Table 1" is treated as `'Pivot Table 1'!$A$1`. The source data of the pivot table can be referenced by column header name. For example, if the source data has columns named "Revenue" and "Cost" and a condition is applied to the "Revenue" column with type `NUMBER_GREATER` and value `=Cost`, then only columns where "Revenue" > "Cost" are included.
3781 pub condition: Option<BooleanCondition>,
3782 /// Whether values are visible by default. If true, the visible_values are ignored, all values that meet condition (if specified) are shown. If false, values that are both in visible_values and meet condition are shown.
3783 #[serde(rename = "visibleByDefault")]
3784 pub visible_by_default: Option<bool>,
3785 /// Values that should be included. Values not listed here are excluded.
3786 #[serde(rename = "visibleValues")]
3787 pub visible_values: Option<Vec<String>>,
3788}
3789
3790impl common::Part for PivotFilterCriteria {}
3791
3792/// The pivot table filter criteria associated with a specific source column offset.
3793///
3794/// This type is not used in any activity, and only used as *part* of another schema.
3795///
3796#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3797#[serde_with::serde_as]
3798#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3799pub struct PivotFilterSpec {
3800 /// The zero-based column offset of the source range.
3801 #[serde(rename = "columnOffsetIndex")]
3802 pub column_offset_index: Option<i32>,
3803 /// The reference to the data source column.
3804 #[serde(rename = "dataSourceColumnReference")]
3805 pub data_source_column_reference: Option<DataSourceColumnReference>,
3806 /// The criteria for the column.
3807 #[serde(rename = "filterCriteria")]
3808 pub filter_criteria: Option<PivotFilterCriteria>,
3809}
3810
3811impl common::Part for PivotFilterSpec {}
3812
3813/// A single grouping (either row or column) in a pivot table.
3814///
3815/// This type is not used in any activity, and only used as *part* of another schema.
3816///
3817#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3818#[serde_with::serde_as]
3819#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3820pub struct PivotGroup {
3821 /// The reference to the data source column this grouping is based on.
3822 #[serde(rename = "dataSourceColumnReference")]
3823 pub data_source_column_reference: Option<DataSourceColumnReference>,
3824 /// The count limit on rows or columns to apply to this pivot group.
3825 #[serde(rename = "groupLimit")]
3826 pub group_limit: Option<PivotGroupLimit>,
3827 /// The group rule to apply to this row/column group.
3828 #[serde(rename = "groupRule")]
3829 pub group_rule: Option<PivotGroupRule>,
3830 /// The labels to use for the row/column groups which can be customized. For example, in the following pivot table, the row label is `Region` (which could be renamed to `State`) and the column label is `Product` (which could be renamed `Item`). Pivot tables created before December 2017 do not have header labels. If you'd like to add header labels to an existing pivot table, please delete the existing pivot table and then create a new pivot table with same parameters. +--------------+---------+-------+ | SUM of Units | Product | | | Region | Pen | Paper | +--------------+---------+-------+ | New York | 345 | 98 | | Oregon | 234 | 123 | | Tennessee | 531 | 415 | +--------------+---------+-------+ | Grand Total | 1110 | 636 | +--------------+---------+-------+
3831 pub label: Option<String>,
3832 /// True if the headings in this pivot group should be repeated. This is only valid for row groupings and is ignored by columns. By default, we minimize repetition of headings by not showing higher level headings where they are the same. For example, even though the third row below corresponds to "Q1 Mar", "Q1" is not shown because it is redundant with previous rows. Setting repeat_headings to true would cause "Q1" to be repeated for "Feb" and "Mar". +--------------+ | Q1 | Jan | | | Feb | | | Mar | +--------+-----+ | Q1 Total | +--------------+
3833 #[serde(rename = "repeatHeadings")]
3834 pub repeat_headings: Option<bool>,
3835 /// True if the pivot table should include the totals for this grouping.
3836 #[serde(rename = "showTotals")]
3837 pub show_totals: Option<bool>,
3838 /// The order the values in this group should be sorted.
3839 #[serde(rename = "sortOrder")]
3840 pub sort_order: Option<String>,
3841 /// The column offset of the source range that this grouping is based on. For example, if the source was `C10:E15`, a `sourceColumnOffset` of `0` means this group refers to column `C`, whereas the offset `1` would refer to column `D`.
3842 #[serde(rename = "sourceColumnOffset")]
3843 pub source_column_offset: Option<i32>,
3844 /// The bucket of the opposite pivot group to sort by. If not specified, sorting is alphabetical by this group's values.
3845 #[serde(rename = "valueBucket")]
3846 pub value_bucket: Option<PivotGroupSortValueBucket>,
3847 /// Metadata about values in the grouping.
3848 #[serde(rename = "valueMetadata")]
3849 pub value_metadata: Option<Vec<PivotGroupValueMetadata>>,
3850}
3851
3852impl common::Part for PivotGroup {}
3853
3854/// The count limit on rows or columns in the pivot group.
3855///
3856/// This type is not used in any activity, and only used as *part* of another schema.
3857///
3858#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3859#[serde_with::serde_as]
3860#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3861pub struct PivotGroupLimit {
3862 /// The order in which the group limit is applied to the pivot table. Pivot group limits are applied from lower to higher order number. Order numbers are normalized to consecutive integers from 0. For write request, to fully customize the applying orders, all pivot group limits should have this field set with an unique number. Otherwise, the order is determined by the index in the PivotTable.rows list and then the PivotTable.columns list.
3863 #[serde(rename = "applyOrder")]
3864 pub apply_order: Option<i32>,
3865 /// The count limit.
3866 #[serde(rename = "countLimit")]
3867 pub count_limit: Option<i32>,
3868}
3869
3870impl common::Part for PivotGroupLimit {}
3871
3872/// An optional setting on a PivotGroup that defines buckets for the values in the source data column rather than breaking out each individual value. Only one PivotGroup with a group rule may be added for each column in the source data, though on any given column you may add both a PivotGroup that has a rule and a PivotGroup that does not.
3873///
3874/// This type is not used in any activity, and only used as *part* of another schema.
3875///
3876#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3877#[serde_with::serde_as]
3878#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3879pub struct PivotGroupRule {
3880 /// A DateTimeRule.
3881 #[serde(rename = "dateTimeRule")]
3882 pub date_time_rule: Option<DateTimeRule>,
3883 /// A HistogramRule.
3884 #[serde(rename = "histogramRule")]
3885 pub histogram_rule: Option<HistogramRule>,
3886 /// A ManualRule.
3887 #[serde(rename = "manualRule")]
3888 pub manual_rule: Option<ManualRule>,
3889}
3890
3891impl common::Part for PivotGroupRule {}
3892
3893/// Information about which values in a pivot group should be used for sorting.
3894///
3895/// This type is not used in any activity, and only used as *part* of another schema.
3896///
3897#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3898#[serde_with::serde_as]
3899#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3900pub struct PivotGroupSortValueBucket {
3901 /// Determines the bucket from which values are chosen to sort. For example, in a pivot table with one row group & two column groups, the row group can list up to two values. The first value corresponds to a value within the first column group, and the second value corresponds to a value in the second column group. If no values are listed, this would indicate that the row should be sorted according to the "Grand Total" over the column groups. If a single value is listed, this would correspond to using the "Total" of that bucket.
3902 pub buckets: Option<Vec<ExtendedValue>>,
3903 /// The offset in the PivotTable.values list which the values in this grouping should be sorted by.
3904 #[serde(rename = "valuesIndex")]
3905 pub values_index: Option<i32>,
3906}
3907
3908impl common::Part for PivotGroupSortValueBucket {}
3909
3910/// Metadata about a value in a pivot grouping.
3911///
3912/// This type is not used in any activity, and only used as *part* of another schema.
3913///
3914#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3915#[serde_with::serde_as]
3916#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3917pub struct PivotGroupValueMetadata {
3918 /// True if the data corresponding to the value is collapsed.
3919 pub collapsed: Option<bool>,
3920 /// The calculated value the metadata corresponds to. (Note that formulaValue is not valid, because the values will be calculated.)
3921 pub value: Option<ExtendedValue>,
3922}
3923
3924impl common::Part for PivotGroupValueMetadata {}
3925
3926/// A pivot table.
3927///
3928/// This type is not used in any activity, and only used as *part* of another schema.
3929///
3930#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3931#[serde_with::serde_as]
3932#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3933pub struct PivotTable {
3934 /// Each column grouping in the pivot table.
3935 pub columns: Option<Vec<PivotGroup>>,
3936 /// An optional mapping of filters per source column offset. The filters are applied before aggregating data into the pivot table. The map's key is the column offset of the source range that you want to filter, and the value is the criteria for that column. For example, if the source was `C10:E15`, a key of `0` will have the filter for column `C`, whereas the key `1` is for column `D`. This field is deprecated in favor of filter_specs.
3937 pub criteria: Option<HashMap<String, PivotFilterCriteria>>,
3938 /// Output only. The data execution status for data source pivot tables.
3939 #[serde(rename = "dataExecutionStatus")]
3940 pub data_execution_status: Option<DataExecutionStatus>,
3941 /// The ID of the data source the pivot table is reading data from.
3942 #[serde(rename = "dataSourceId")]
3943 pub data_source_id: Option<String>,
3944 /// The filters applied to the source columns before aggregating data for the pivot table. Both criteria and filter_specs are populated in responses. If both fields are specified in an update request, this field takes precedence.
3945 #[serde(rename = "filterSpecs")]
3946 pub filter_specs: Option<Vec<PivotFilterSpec>>,
3947 /// Each row grouping in the pivot table.
3948 pub rows: Option<Vec<PivotGroup>>,
3949 /// The range the pivot table is reading data from.
3950 pub source: Option<GridRange>,
3951 /// Whether values should be listed horizontally (as columns) or vertically (as rows).
3952 #[serde(rename = "valueLayout")]
3953 pub value_layout: Option<String>,
3954 /// A list of values to include in the pivot table.
3955 pub values: Option<Vec<PivotValue>>,
3956}
3957
3958impl common::Part for PivotTable {}
3959
3960/// The definition of how a value in a pivot table should be calculated.
3961///
3962/// This type is not used in any activity, and only used as *part* of another schema.
3963///
3964#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3965#[serde_with::serde_as]
3966#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3967pub struct PivotValue {
3968 /// If specified, indicates that pivot values should be displayed as the result of a calculation with another pivot value. For example, if calculated_display_type is specified as PERCENT_OF_GRAND_TOTAL, all the pivot values are displayed as the percentage of the grand total. In the Sheets editor, this is referred to as "Show As" in the value section of a pivot table.
3969 #[serde(rename = "calculatedDisplayType")]
3970 pub calculated_display_type: Option<String>,
3971 /// The reference to the data source column that this value reads from.
3972 #[serde(rename = "dataSourceColumnReference")]
3973 pub data_source_column_reference: Option<DataSourceColumnReference>,
3974 /// A custom formula to calculate the value. The formula must start with an `=` character.
3975 pub formula: Option<String>,
3976 /// A name to use for the value.
3977 pub name: Option<String>,
3978 /// The column offset of the source range that this value reads from. For example, if the source was `C10:E15`, a `sourceColumnOffset` of `0` means this value refers to column `C`, whereas the offset `1` would refer to column `D`.
3979 #[serde(rename = "sourceColumnOffset")]
3980 pub source_column_offset: Option<i32>,
3981 /// A function to summarize the value. If formula is set, the only supported values are SUM and CUSTOM. If sourceColumnOffset is set, then `CUSTOM` is not supported.
3982 #[serde(rename = "summarizeFunction")]
3983 pub summarize_function: Option<String>,
3984}
3985
3986impl common::Part for PivotValue {}
3987
3988/// The style of a point on the chart.
3989///
3990/// This type is not used in any activity, and only used as *part* of another schema.
3991///
3992#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3993#[serde_with::serde_as]
3994#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3995pub struct PointStyle {
3996 /// The point shape. If empty or unspecified, a default shape is used.
3997 pub shape: Option<String>,
3998 /// The point size. If empty, a default size is used.
3999 pub size: Option<f64>,
4000}
4001
4002impl common::Part for PointStyle {}
4003
4004/// A protected range.
4005///
4006/// This type is not used in any activity, and only used as *part* of another schema.
4007///
4008#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4009#[serde_with::serde_as]
4010#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4011pub struct ProtectedRange {
4012 /// The description of this protected range.
4013 pub description: Option<String>,
4014 /// The users and groups with edit access to the protected range. This field is only visible to users with edit access to the protected range and the document. Editors are not supported with warning_only protection.
4015 pub editors: Option<Editors>,
4016 /// The named range this protected range is backed by, if any. When writing, only one of range or named_range_id may be set.
4017 #[serde(rename = "namedRangeId")]
4018 pub named_range_id: Option<String>,
4019 /// The ID of the protected range. This field is read-only.
4020 #[serde(rename = "protectedRangeId")]
4021 pub protected_range_id: Option<i32>,
4022 /// The range that is being protected. The range may be fully unbounded, in which case this is considered a protected sheet. When writing, only one of range or named_range_id may be set.
4023 pub range: Option<GridRange>,
4024 /// True if the user who requested this protected range can edit the protected area. This field is read-only.
4025 #[serde(rename = "requestingUserCanEdit")]
4026 pub requesting_user_can_edit: Option<bool>,
4027 /// The list of unprotected ranges within a protected sheet. Unprotected ranges are only supported on protected sheets.
4028 #[serde(rename = "unprotectedRanges")]
4029 pub unprotected_ranges: Option<Vec<GridRange>>,
4030 /// True if this protected range will show a warning when editing. Warning-based protection means that every user can edit data in the protected range, except editing will prompt a warning asking the user to confirm the edit. When writing: if this field is true, then editors are ignored. Additionally, if this field is changed from true to false and the `editors` field is not set (nor included in the field mask), then the editors will be set to all the editors in the document.
4031 #[serde(rename = "warningOnly")]
4032 pub warning_only: Option<bool>,
4033}
4034
4035impl common::Part for ProtectedRange {}
4036
4037/// Randomizes the order of the rows in a range.
4038///
4039/// This type is not used in any activity, and only used as *part* of another schema.
4040///
4041#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4042#[serde_with::serde_as]
4043#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4044pub struct RandomizeRangeRequest {
4045 /// The range to randomize.
4046 pub range: Option<GridRange>,
4047}
4048
4049impl common::Part for RandomizeRangeRequest {}
4050
4051/// The status of a refresh cancellation. You can send a cancel request to explicitly cancel one or multiple data source object refreshes.
4052///
4053/// This type is not used in any activity, and only used as *part* of another schema.
4054///
4055#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4056#[serde_with::serde_as]
4057#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4058pub struct RefreshCancellationStatus {
4059 /// The error code.
4060 #[serde(rename = "errorCode")]
4061 pub error_code: Option<String>,
4062 /// The state of a call to cancel a refresh in Sheets.
4063 pub state: Option<String>,
4064}
4065
4066impl common::Part for RefreshCancellationStatus {}
4067
4068/// The execution status of refreshing one data source object.
4069///
4070/// This type is not used in any activity, and only used as *part* of another schema.
4071///
4072#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4073#[serde_with::serde_as]
4074#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4075pub struct RefreshDataSourceObjectExecutionStatus {
4076 /// The data execution status.
4077 #[serde(rename = "dataExecutionStatus")]
4078 pub data_execution_status: Option<DataExecutionStatus>,
4079 /// Reference to a data source object being refreshed.
4080 pub reference: Option<DataSourceObjectReference>,
4081}
4082
4083impl common::Part for RefreshDataSourceObjectExecutionStatus {}
4084
4085/// Refreshes one or multiple data source objects in the spreadsheet by the specified references. The request requires an additional `bigquery.readonly` OAuth scope. If there are multiple refresh requests referencing the same data source objects in one batch, only the last refresh request is processed, and all those requests will have the same response accordingly.
4086///
4087/// This type is not used in any activity, and only used as *part* of another schema.
4088///
4089#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4090#[serde_with::serde_as]
4091#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4092pub struct RefreshDataSourceRequest {
4093 /// Reference to a DataSource. If specified, refreshes all associated data source objects for the data source.
4094 #[serde(rename = "dataSourceId")]
4095 pub data_source_id: Option<String>,
4096 /// Refreshes the data source objects regardless of the current state. If not set and a referenced data source object was in error state, the refresh will fail immediately.
4097 pub force: Option<bool>,
4098 /// Refreshes all existing data source objects in the spreadsheet.
4099 #[serde(rename = "isAll")]
4100 pub is_all: Option<bool>,
4101 /// References to data source objects to refresh.
4102 pub references: Option<DataSourceObjectReferences>,
4103}
4104
4105impl common::Part for RefreshDataSourceRequest {}
4106
4107/// The response from refreshing one or multiple data source objects.
4108///
4109/// This type is not used in any activity, and only used as *part* of another schema.
4110///
4111#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4112#[serde_with::serde_as]
4113#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4114pub struct RefreshDataSourceResponse {
4115 /// All the refresh status for the data source object references specified in the request. If is_all is specified, the field contains only those in failure status.
4116 pub statuses: Option<Vec<RefreshDataSourceObjectExecutionStatus>>,
4117}
4118
4119impl common::Part for RefreshDataSourceResponse {}
4120
4121/// Updates all cells in the range to the values in the given Cell object. Only the fields listed in the fields field are updated; others are unchanged. If writing a cell with a formula, the formula's ranges will automatically increment for each field in the range. For example, if writing a cell with formula `=A1` into range B2:C4, B2 would be `=A1`, B3 would be `=A2`, B4 would be `=A3`, C2 would be `=B1`, C3 would be `=B2`, C4 would be `=B3`. To keep the formula's ranges static, use the `$` indicator. For example, use the formula `=$A$1` to prevent both the row and the column from incrementing.
4122///
4123/// This type is not used in any activity, and only used as *part* of another schema.
4124///
4125#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4126#[serde_with::serde_as]
4127#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4128pub struct RepeatCellRequest {
4129 /// The data to write.
4130 pub cell: Option<CellData>,
4131 /// The fields that should be updated. At least one field must be specified. The root `cell` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
4132 pub fields: Option<common::FieldMask>,
4133 /// The range to repeat the cell in.
4134 pub range: Option<GridRange>,
4135}
4136
4137impl common::Part for RepeatCellRequest {}
4138
4139/// A single kind of update to apply to a spreadsheet.
4140///
4141/// This type is not used in any activity, and only used as *part* of another schema.
4142///
4143#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4144#[serde_with::serde_as]
4145#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4146pub struct Request {
4147 /// Adds a new banded range
4148 #[serde(rename = "addBanding")]
4149 pub add_banding: Option<AddBandingRequest>,
4150 /// Adds a chart.
4151 #[serde(rename = "addChart")]
4152 pub add_chart: Option<AddChartRequest>,
4153 /// Adds a new conditional format rule.
4154 #[serde(rename = "addConditionalFormatRule")]
4155 pub add_conditional_format_rule: Option<AddConditionalFormatRuleRequest>,
4156 /// Adds a data source.
4157 #[serde(rename = "addDataSource")]
4158 pub add_data_source: Option<AddDataSourceRequest>,
4159 /// Creates a group over the specified range.
4160 #[serde(rename = "addDimensionGroup")]
4161 pub add_dimension_group: Option<AddDimensionGroupRequest>,
4162 /// Adds a filter view.
4163 #[serde(rename = "addFilterView")]
4164 pub add_filter_view: Option<AddFilterViewRequest>,
4165 /// Adds a named range.
4166 #[serde(rename = "addNamedRange")]
4167 pub add_named_range: Option<AddNamedRangeRequest>,
4168 /// Adds a protected range.
4169 #[serde(rename = "addProtectedRange")]
4170 pub add_protected_range: Option<AddProtectedRangeRequest>,
4171 /// Adds a sheet.
4172 #[serde(rename = "addSheet")]
4173 pub add_sheet: Option<AddSheetRequest>,
4174 /// Adds a slicer.
4175 #[serde(rename = "addSlicer")]
4176 pub add_slicer: Option<AddSlicerRequest>,
4177 /// Appends cells after the last row with data in a sheet.
4178 #[serde(rename = "appendCells")]
4179 pub append_cells: Option<AppendCellsRequest>,
4180 /// Appends dimensions to the end of a sheet.
4181 #[serde(rename = "appendDimension")]
4182 pub append_dimension: Option<AppendDimensionRequest>,
4183 /// Automatically fills in more data based on existing data.
4184 #[serde(rename = "autoFill")]
4185 pub auto_fill: Option<AutoFillRequest>,
4186 /// Automatically resizes one or more dimensions based on the contents of the cells in that dimension.
4187 #[serde(rename = "autoResizeDimensions")]
4188 pub auto_resize_dimensions: Option<AutoResizeDimensionsRequest>,
4189 /// Cancels refreshes of one or multiple data sources and associated dbobjects.
4190 #[serde(rename = "cancelDataSourceRefresh")]
4191 pub cancel_data_source_refresh: Option<CancelDataSourceRefreshRequest>,
4192 /// Clears the basic filter on a sheet.
4193 #[serde(rename = "clearBasicFilter")]
4194 pub clear_basic_filter: Option<ClearBasicFilterRequest>,
4195 /// Copies data from one area and pastes it to another.
4196 #[serde(rename = "copyPaste")]
4197 pub copy_paste: Option<CopyPasteRequest>,
4198 /// Creates new developer metadata
4199 #[serde(rename = "createDeveloperMetadata")]
4200 pub create_developer_metadata: Option<CreateDeveloperMetadataRequest>,
4201 /// Cuts data from one area and pastes it to another.
4202 #[serde(rename = "cutPaste")]
4203 pub cut_paste: Option<CutPasteRequest>,
4204 /// Removes a banded range
4205 #[serde(rename = "deleteBanding")]
4206 pub delete_banding: Option<DeleteBandingRequest>,
4207 /// Deletes an existing conditional format rule.
4208 #[serde(rename = "deleteConditionalFormatRule")]
4209 pub delete_conditional_format_rule: Option<DeleteConditionalFormatRuleRequest>,
4210 /// Deletes a data source.
4211 #[serde(rename = "deleteDataSource")]
4212 pub delete_data_source: Option<DeleteDataSourceRequest>,
4213 /// Deletes developer metadata
4214 #[serde(rename = "deleteDeveloperMetadata")]
4215 pub delete_developer_metadata: Option<DeleteDeveloperMetadataRequest>,
4216 /// Deletes rows or columns in a sheet.
4217 #[serde(rename = "deleteDimension")]
4218 pub delete_dimension: Option<DeleteDimensionRequest>,
4219 /// Deletes a group over the specified range.
4220 #[serde(rename = "deleteDimensionGroup")]
4221 pub delete_dimension_group: Option<DeleteDimensionGroupRequest>,
4222 /// Removes rows containing duplicate values in specified columns of a cell range.
4223 #[serde(rename = "deleteDuplicates")]
4224 pub delete_duplicates: Option<DeleteDuplicatesRequest>,
4225 /// Deletes an embedded object (e.g, chart, image) in a sheet.
4226 #[serde(rename = "deleteEmbeddedObject")]
4227 pub delete_embedded_object: Option<DeleteEmbeddedObjectRequest>,
4228 /// Deletes a filter view from a sheet.
4229 #[serde(rename = "deleteFilterView")]
4230 pub delete_filter_view: Option<DeleteFilterViewRequest>,
4231 /// Deletes a named range.
4232 #[serde(rename = "deleteNamedRange")]
4233 pub delete_named_range: Option<DeleteNamedRangeRequest>,
4234 /// Deletes a protected range.
4235 #[serde(rename = "deleteProtectedRange")]
4236 pub delete_protected_range: Option<DeleteProtectedRangeRequest>,
4237 /// Deletes a range of cells from a sheet, shifting the remaining cells.
4238 #[serde(rename = "deleteRange")]
4239 pub delete_range: Option<DeleteRangeRequest>,
4240 /// Deletes a sheet.
4241 #[serde(rename = "deleteSheet")]
4242 pub delete_sheet: Option<DeleteSheetRequest>,
4243 /// Duplicates a filter view.
4244 #[serde(rename = "duplicateFilterView")]
4245 pub duplicate_filter_view: Option<DuplicateFilterViewRequest>,
4246 /// Duplicates a sheet.
4247 #[serde(rename = "duplicateSheet")]
4248 pub duplicate_sheet: Option<DuplicateSheetRequest>,
4249 /// Finds and replaces occurrences of some text with other text.
4250 #[serde(rename = "findReplace")]
4251 pub find_replace: Option<FindReplaceRequest>,
4252 /// Inserts new rows or columns in a sheet.
4253 #[serde(rename = "insertDimension")]
4254 pub insert_dimension: Option<InsertDimensionRequest>,
4255 /// Inserts new cells in a sheet, shifting the existing cells.
4256 #[serde(rename = "insertRange")]
4257 pub insert_range: Option<InsertRangeRequest>,
4258 /// Merges cells together.
4259 #[serde(rename = "mergeCells")]
4260 pub merge_cells: Option<MergeCellsRequest>,
4261 /// Moves rows or columns to another location in a sheet.
4262 #[serde(rename = "moveDimension")]
4263 pub move_dimension: Option<MoveDimensionRequest>,
4264 /// Pastes data (HTML or delimited) into a sheet.
4265 #[serde(rename = "pasteData")]
4266 pub paste_data: Option<PasteDataRequest>,
4267 /// Randomizes the order of the rows in a range.
4268 #[serde(rename = "randomizeRange")]
4269 pub randomize_range: Option<RandomizeRangeRequest>,
4270 /// Refreshes one or multiple data sources and associated dbobjects.
4271 #[serde(rename = "refreshDataSource")]
4272 pub refresh_data_source: Option<RefreshDataSourceRequest>,
4273 /// Repeats a single cell across a range.
4274 #[serde(rename = "repeatCell")]
4275 pub repeat_cell: Option<RepeatCellRequest>,
4276 /// Sets the basic filter on a sheet.
4277 #[serde(rename = "setBasicFilter")]
4278 pub set_basic_filter: Option<SetBasicFilterRequest>,
4279 /// Sets data validation for one or more cells.
4280 #[serde(rename = "setDataValidation")]
4281 pub set_data_validation: Option<SetDataValidationRequest>,
4282 /// Sorts data in a range.
4283 #[serde(rename = "sortRange")]
4284 pub sort_range: Option<SortRangeRequest>,
4285 /// Converts a column of text into many columns of text.
4286 #[serde(rename = "textToColumns")]
4287 pub text_to_columns: Option<TextToColumnsRequest>,
4288 /// Trims cells of whitespace (such as spaces, tabs, or new lines).
4289 #[serde(rename = "trimWhitespace")]
4290 pub trim_whitespace: Option<TrimWhitespaceRequest>,
4291 /// Unmerges merged cells.
4292 #[serde(rename = "unmergeCells")]
4293 pub unmerge_cells: Option<UnmergeCellsRequest>,
4294 /// Updates a banded range
4295 #[serde(rename = "updateBanding")]
4296 pub update_banding: Option<UpdateBandingRequest>,
4297 /// Updates the borders in a range of cells.
4298 #[serde(rename = "updateBorders")]
4299 pub update_borders: Option<UpdateBordersRequest>,
4300 /// Updates many cells at once.
4301 #[serde(rename = "updateCells")]
4302 pub update_cells: Option<UpdateCellsRequest>,
4303 /// Updates a chart's specifications.
4304 #[serde(rename = "updateChartSpec")]
4305 pub update_chart_spec: Option<UpdateChartSpecRequest>,
4306 /// Updates an existing conditional format rule.
4307 #[serde(rename = "updateConditionalFormatRule")]
4308 pub update_conditional_format_rule: Option<UpdateConditionalFormatRuleRequest>,
4309 /// Updates a data source.
4310 #[serde(rename = "updateDataSource")]
4311 pub update_data_source: Option<UpdateDataSourceRequest>,
4312 /// Updates an existing developer metadata entry
4313 #[serde(rename = "updateDeveloperMetadata")]
4314 pub update_developer_metadata: Option<UpdateDeveloperMetadataRequest>,
4315 /// Updates the state of the specified group.
4316 #[serde(rename = "updateDimensionGroup")]
4317 pub update_dimension_group: Option<UpdateDimensionGroupRequest>,
4318 /// Updates dimensions' properties.
4319 #[serde(rename = "updateDimensionProperties")]
4320 pub update_dimension_properties: Option<UpdateDimensionPropertiesRequest>,
4321 /// Updates an embedded object's border.
4322 #[serde(rename = "updateEmbeddedObjectBorder")]
4323 pub update_embedded_object_border: Option<UpdateEmbeddedObjectBorderRequest>,
4324 /// Updates an embedded object's (e.g. chart, image) position.
4325 #[serde(rename = "updateEmbeddedObjectPosition")]
4326 pub update_embedded_object_position: Option<UpdateEmbeddedObjectPositionRequest>,
4327 /// Updates the properties of a filter view.
4328 #[serde(rename = "updateFilterView")]
4329 pub update_filter_view: Option<UpdateFilterViewRequest>,
4330 /// Updates a named range.
4331 #[serde(rename = "updateNamedRange")]
4332 pub update_named_range: Option<UpdateNamedRangeRequest>,
4333 /// Updates a protected range.
4334 #[serde(rename = "updateProtectedRange")]
4335 pub update_protected_range: Option<UpdateProtectedRangeRequest>,
4336 /// Updates a sheet's properties.
4337 #[serde(rename = "updateSheetProperties")]
4338 pub update_sheet_properties: Option<UpdateSheetPropertiesRequest>,
4339 /// Updates a slicer's specifications.
4340 #[serde(rename = "updateSlicerSpec")]
4341 pub update_slicer_spec: Option<UpdateSlicerSpecRequest>,
4342 /// Updates the spreadsheet's properties.
4343 #[serde(rename = "updateSpreadsheetProperties")]
4344 pub update_spreadsheet_properties: Option<UpdateSpreadsheetPropertiesRequest>,
4345}
4346
4347impl common::Part for Request {}
4348
4349/// A single response from an update.
4350///
4351/// This type is not used in any activity, and only used as *part* of another schema.
4352///
4353#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4354#[serde_with::serde_as]
4355#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4356pub struct Response {
4357 /// A reply from adding a banded range.
4358 #[serde(rename = "addBanding")]
4359 pub add_banding: Option<AddBandingResponse>,
4360 /// A reply from adding a chart.
4361 #[serde(rename = "addChart")]
4362 pub add_chart: Option<AddChartResponse>,
4363 /// A reply from adding a data source.
4364 #[serde(rename = "addDataSource")]
4365 pub add_data_source: Option<AddDataSourceResponse>,
4366 /// A reply from adding a dimension group.
4367 #[serde(rename = "addDimensionGroup")]
4368 pub add_dimension_group: Option<AddDimensionGroupResponse>,
4369 /// A reply from adding a filter view.
4370 #[serde(rename = "addFilterView")]
4371 pub add_filter_view: Option<AddFilterViewResponse>,
4372 /// A reply from adding a named range.
4373 #[serde(rename = "addNamedRange")]
4374 pub add_named_range: Option<AddNamedRangeResponse>,
4375 /// A reply from adding a protected range.
4376 #[serde(rename = "addProtectedRange")]
4377 pub add_protected_range: Option<AddProtectedRangeResponse>,
4378 /// A reply from adding a sheet.
4379 #[serde(rename = "addSheet")]
4380 pub add_sheet: Option<AddSheetResponse>,
4381 /// A reply from adding a slicer.
4382 #[serde(rename = "addSlicer")]
4383 pub add_slicer: Option<AddSlicerResponse>,
4384 /// A reply from cancelling data source object refreshes.
4385 #[serde(rename = "cancelDataSourceRefresh")]
4386 pub cancel_data_source_refresh: Option<CancelDataSourceRefreshResponse>,
4387 /// A reply from creating a developer metadata entry.
4388 #[serde(rename = "createDeveloperMetadata")]
4389 pub create_developer_metadata: Option<CreateDeveloperMetadataResponse>,
4390 /// A reply from deleting a conditional format rule.
4391 #[serde(rename = "deleteConditionalFormatRule")]
4392 pub delete_conditional_format_rule: Option<DeleteConditionalFormatRuleResponse>,
4393 /// A reply from deleting a developer metadata entry.
4394 #[serde(rename = "deleteDeveloperMetadata")]
4395 pub delete_developer_metadata: Option<DeleteDeveloperMetadataResponse>,
4396 /// A reply from deleting a dimension group.
4397 #[serde(rename = "deleteDimensionGroup")]
4398 pub delete_dimension_group: Option<DeleteDimensionGroupResponse>,
4399 /// A reply from removing rows containing duplicate values.
4400 #[serde(rename = "deleteDuplicates")]
4401 pub delete_duplicates: Option<DeleteDuplicatesResponse>,
4402 /// A reply from duplicating a filter view.
4403 #[serde(rename = "duplicateFilterView")]
4404 pub duplicate_filter_view: Option<DuplicateFilterViewResponse>,
4405 /// A reply from duplicating a sheet.
4406 #[serde(rename = "duplicateSheet")]
4407 pub duplicate_sheet: Option<DuplicateSheetResponse>,
4408 /// A reply from doing a find/replace.
4409 #[serde(rename = "findReplace")]
4410 pub find_replace: Option<FindReplaceResponse>,
4411 /// A reply from refreshing data source objects.
4412 #[serde(rename = "refreshDataSource")]
4413 pub refresh_data_source: Option<RefreshDataSourceResponse>,
4414 /// A reply from trimming whitespace.
4415 #[serde(rename = "trimWhitespace")]
4416 pub trim_whitespace: Option<TrimWhitespaceResponse>,
4417 /// A reply from updating a conditional format rule.
4418 #[serde(rename = "updateConditionalFormatRule")]
4419 pub update_conditional_format_rule: Option<UpdateConditionalFormatRuleResponse>,
4420 /// A reply from updating a data source.
4421 #[serde(rename = "updateDataSource")]
4422 pub update_data_source: Option<UpdateDataSourceResponse>,
4423 /// A reply from updating a developer metadata entry.
4424 #[serde(rename = "updateDeveloperMetadata")]
4425 pub update_developer_metadata: Option<UpdateDeveloperMetadataResponse>,
4426 /// A reply from updating an embedded object's position.
4427 #[serde(rename = "updateEmbeddedObjectPosition")]
4428 pub update_embedded_object_position: Option<UpdateEmbeddedObjectPositionResponse>,
4429}
4430
4431impl common::Part for Response {}
4432
4433/// Data about each cell in a row.
4434///
4435/// This type is not used in any activity, and only used as *part* of another schema.
4436///
4437#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4438#[serde_with::serde_as]
4439#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4440pub struct RowData {
4441 /// The values in the row, one per column.
4442 pub values: Option<Vec<CellData>>,
4443}
4444
4445impl common::Part for RowData {}
4446
4447/// A scorecard chart. Scorecard charts are used to highlight key performance indicators, known as KPIs, on the spreadsheet. A scorecard chart can represent things like total sales, average cost, or a top selling item. You can specify a single data value, or aggregate over a range of data. Percentage or absolute difference from a baseline value can be highlighted, like changes over time.
4448///
4449/// This type is not used in any activity, and only used as *part* of another schema.
4450///
4451#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4452#[serde_with::serde_as]
4453#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4454pub struct ScorecardChartSpec {
4455 /// The aggregation type for key and baseline chart data in scorecard chart. This field is not supported for data source charts. Use the ChartData.aggregateType field of the key_value_data or baseline_value_data instead for data source charts. This field is optional.
4456 #[serde(rename = "aggregateType")]
4457 pub aggregate_type: Option<String>,
4458 /// The data for scorecard baseline value. This field is optional.
4459 #[serde(rename = "baselineValueData")]
4460 pub baseline_value_data: Option<ChartData>,
4461 /// Formatting options for baseline value. This field is needed only if baseline_value_data is specified.
4462 #[serde(rename = "baselineValueFormat")]
4463 pub baseline_value_format: Option<BaselineValueFormat>,
4464 /// Custom formatting options for numeric key/baseline values in scorecard chart. This field is used only when number_format_source is set to CUSTOM. This field is optional.
4465 #[serde(rename = "customFormatOptions")]
4466 pub custom_format_options: Option<ChartCustomNumberFormatOptions>,
4467 /// The data for scorecard key value.
4468 #[serde(rename = "keyValueData")]
4469 pub key_value_data: Option<ChartData>,
4470 /// Formatting options for key value.
4471 #[serde(rename = "keyValueFormat")]
4472 pub key_value_format: Option<KeyValueFormat>,
4473 /// The number format source used in the scorecard chart. This field is optional.
4474 #[serde(rename = "numberFormatSource")]
4475 pub number_format_source: Option<String>,
4476 /// Value to scale scorecard key and baseline value. For example, a factor of 10 can be used to divide all values in the chart by 10. This field is optional.
4477 #[serde(rename = "scaleFactor")]
4478 pub scale_factor: Option<f64>,
4479}
4480
4481impl common::Part for ScorecardChartSpec {}
4482
4483/// A request to retrieve all developer metadata matching the set of specified criteria.
4484///
4485/// # Activities
4486///
4487/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
4488/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
4489///
4490/// * [developer metadata search spreadsheets](SpreadsheetDeveloperMetadataSearchCall) (request)
4491#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4492#[serde_with::serde_as]
4493#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4494pub struct SearchDeveloperMetadataRequest {
4495 /// The data filters describing the criteria used to determine which DeveloperMetadata entries to return. DeveloperMetadata matching any of the specified filters are included in the response.
4496 #[serde(rename = "dataFilters")]
4497 pub data_filters: Option<Vec<DataFilter>>,
4498}
4499
4500impl common::RequestValue for SearchDeveloperMetadataRequest {}
4501
4502/// A reply to a developer metadata search request.
4503///
4504/// # Activities
4505///
4506/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
4507/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
4508///
4509/// * [developer metadata search spreadsheets](SpreadsheetDeveloperMetadataSearchCall) (response)
4510#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4511#[serde_with::serde_as]
4512#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4513pub struct SearchDeveloperMetadataResponse {
4514 /// The metadata matching the criteria of the search request.
4515 #[serde(rename = "matchedDeveloperMetadata")]
4516 pub matched_developer_metadata: Option<Vec<MatchedDeveloperMetadata>>,
4517}
4518
4519impl common::ResponseResult for SearchDeveloperMetadataResponse {}
4520
4521/// Sets the basic filter associated with a sheet.
4522///
4523/// This type is not used in any activity, and only used as *part* of another schema.
4524///
4525#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4526#[serde_with::serde_as]
4527#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4528pub struct SetBasicFilterRequest {
4529 /// The filter to set.
4530 pub filter: Option<BasicFilter>,
4531}
4532
4533impl common::Part for SetBasicFilterRequest {}
4534
4535/// Sets a data validation rule to every cell in the range. To clear validation in a range, call this with no rule specified.
4536///
4537/// This type is not used in any activity, and only used as *part* of another schema.
4538///
4539#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4540#[serde_with::serde_as]
4541#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4542pub struct SetDataValidationRequest {
4543 /// The range the data validation rule should apply to.
4544 pub range: Option<GridRange>,
4545 /// The data validation rule to set on each cell in the range, or empty to clear the data validation in the range.
4546 pub rule: Option<DataValidationRule>,
4547}
4548
4549impl common::Part for SetDataValidationRequest {}
4550
4551/// A sheet in a spreadsheet.
4552///
4553/// This type is not used in any activity, and only used as *part* of another schema.
4554///
4555#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4556#[serde_with::serde_as]
4557#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4558pub struct Sheet {
4559 /// The banded (alternating colors) ranges on this sheet.
4560 #[serde(rename = "bandedRanges")]
4561 pub banded_ranges: Option<Vec<BandedRange>>,
4562 /// The filter on this sheet, if any.
4563 #[serde(rename = "basicFilter")]
4564 pub basic_filter: Option<BasicFilter>,
4565 /// The specifications of every chart on this sheet.
4566 pub charts: Option<Vec<EmbeddedChart>>,
4567 /// All column groups on this sheet, ordered by increasing range start index, then by group depth.
4568 #[serde(rename = "columnGroups")]
4569 pub column_groups: Option<Vec<DimensionGroup>>,
4570 /// The conditional format rules in this sheet.
4571 #[serde(rename = "conditionalFormats")]
4572 pub conditional_formats: Option<Vec<ConditionalFormatRule>>,
4573 /// Data in the grid, if this is a grid sheet. The number of GridData objects returned is dependent on the number of ranges requested on this sheet. For example, if this is representing `Sheet1`, and the spreadsheet was requested with ranges `Sheet1!A1:C10` and `Sheet1!D15:E20`, then the first GridData will have a startRow/startColumn of `0`, while the second one will have `startRow 14` (zero-based row 15), and `startColumn 3` (zero-based column D). For a DATA_SOURCE sheet, you can not request a specific range, the GridData contains all the values.
4574 pub data: Option<Vec<GridData>>,
4575 /// The developer metadata associated with a sheet.
4576 #[serde(rename = "developerMetadata")]
4577 pub developer_metadata: Option<Vec<DeveloperMetadata>>,
4578 /// The filter views in this sheet.
4579 #[serde(rename = "filterViews")]
4580 pub filter_views: Option<Vec<FilterView>>,
4581 /// The ranges that are merged together.
4582 pub merges: Option<Vec<GridRange>>,
4583 /// The properties of the sheet.
4584 pub properties: Option<SheetProperties>,
4585 /// The protected ranges in this sheet.
4586 #[serde(rename = "protectedRanges")]
4587 pub protected_ranges: Option<Vec<ProtectedRange>>,
4588 /// All row groups on this sheet, ordered by increasing range start index, then by group depth.
4589 #[serde(rename = "rowGroups")]
4590 pub row_groups: Option<Vec<DimensionGroup>>,
4591 /// The slicers on this sheet.
4592 pub slicers: Option<Vec<Slicer>>,
4593}
4594
4595impl common::Part for Sheet {}
4596
4597/// Properties of a sheet.
4598///
4599/// # Activities
4600///
4601/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
4602/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
4603///
4604/// * [sheets copy to spreadsheets](SpreadsheetSheetCopyToCall) (response)
4605#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4606#[serde_with::serde_as]
4607#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4608pub struct SheetProperties {
4609 /// Output only. If present, the field contains DATA_SOURCE sheet specific properties.
4610 #[serde(rename = "dataSourceSheetProperties")]
4611 pub data_source_sheet_properties: Option<DataSourceSheetProperties>,
4612 /// Additional properties of the sheet if this sheet is a grid. (If the sheet is an object sheet, containing a chart or image, then this field will be absent.) When writing it is an error to set any grid properties on non-grid sheets. If this sheet is a DATA_SOURCE sheet, this field is output only but contains the properties that reflect how a data source sheet is rendered in the UI, e.g. row_count.
4613 #[serde(rename = "gridProperties")]
4614 pub grid_properties: Option<GridProperties>,
4615 /// True if the sheet is hidden in the UI, false if it's visible.
4616 pub hidden: Option<bool>,
4617 /// The index of the sheet within the spreadsheet. When adding or updating sheet properties, if this field is excluded then the sheet is added or moved to the end of the sheet list. When updating sheet indices or inserting sheets, movement is considered in "before the move" indexes. For example, if there were three sheets (S1, S2, S3) in order to move S1 ahead of S2 the index would have to be set to 2. A sheet index update request is ignored if the requested index is identical to the sheets current index or if the requested new index is equal to the current sheet index + 1.
4618 pub index: Option<i32>,
4619 /// True if the sheet is an RTL sheet instead of an LTR sheet.
4620 #[serde(rename = "rightToLeft")]
4621 pub right_to_left: Option<bool>,
4622 /// The ID of the sheet. Must be non-negative. This field cannot be changed once set.
4623 #[serde(rename = "sheetId")]
4624 pub sheet_id: Option<i32>,
4625 /// The type of sheet. Defaults to GRID. This field cannot be changed once set.
4626 #[serde(rename = "sheetType")]
4627 pub sheet_type: Option<String>,
4628 /// The color of the tab in the UI. Deprecated: Use tab_color_style.
4629 #[serde(rename = "tabColor")]
4630 pub tab_color: Option<Color>,
4631 /// The color of the tab in the UI. If tab_color is also set, this field takes precedence.
4632 #[serde(rename = "tabColorStyle")]
4633 pub tab_color_style: Option<ColorStyle>,
4634 /// The name of the sheet.
4635 pub title: Option<String>,
4636}
4637
4638impl common::ResponseResult for SheetProperties {}
4639
4640/// A slicer in a sheet.
4641///
4642/// This type is not used in any activity, and only used as *part* of another schema.
4643///
4644#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4645#[serde_with::serde_as]
4646#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4647pub struct Slicer {
4648 /// The position of the slicer. Note that slicer can be positioned only on existing sheet. Also, width and height of slicer can be automatically adjusted to keep it within permitted limits.
4649 pub position: Option<EmbeddedObjectPosition>,
4650 /// The ID of the slicer.
4651 #[serde(rename = "slicerId")]
4652 pub slicer_id: Option<i32>,
4653 /// The specification of the slicer.
4654 pub spec: Option<SlicerSpec>,
4655}
4656
4657impl common::Part for Slicer {}
4658
4659/// The specifications of a slicer.
4660///
4661/// This type is not used in any activity, and only used as *part* of another schema.
4662///
4663#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4664#[serde_with::serde_as]
4665#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4666pub struct SlicerSpec {
4667 /// True if the filter should apply to pivot tables. If not set, default to `True`.
4668 #[serde(rename = "applyToPivotTables")]
4669 pub apply_to_pivot_tables: Option<bool>,
4670 /// The background color of the slicer. Deprecated: Use background_color_style.
4671 #[serde(rename = "backgroundColor")]
4672 pub background_color: Option<Color>,
4673 /// The background color of the slicer. If background_color is also set, this field takes precedence.
4674 #[serde(rename = "backgroundColorStyle")]
4675 pub background_color_style: Option<ColorStyle>,
4676 /// The zero-based column index in the data table on which the filter is applied to.
4677 #[serde(rename = "columnIndex")]
4678 pub column_index: Option<i32>,
4679 /// The data range of the slicer.
4680 #[serde(rename = "dataRange")]
4681 pub data_range: Option<GridRange>,
4682 /// The filtering criteria of the slicer.
4683 #[serde(rename = "filterCriteria")]
4684 pub filter_criteria: Option<FilterCriteria>,
4685 /// The horizontal alignment of title in the slicer. If unspecified, defaults to `LEFT`
4686 #[serde(rename = "horizontalAlignment")]
4687 pub horizontal_alignment: Option<String>,
4688 /// The text format of title in the slicer. The link field is not supported.
4689 #[serde(rename = "textFormat")]
4690 pub text_format: Option<TextFormat>,
4691 /// The title of the slicer.
4692 pub title: Option<String>,
4693}
4694
4695impl common::Part for SlicerSpec {}
4696
4697/// Sorts data in rows based on a sort order per column.
4698///
4699/// This type is not used in any activity, and only used as *part* of another schema.
4700///
4701#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4702#[serde_with::serde_as]
4703#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4704pub struct SortRangeRequest {
4705 /// The range to sort.
4706 pub range: Option<GridRange>,
4707 /// The sort order per column. Later specifications are used when values are equal in the earlier specifications.
4708 #[serde(rename = "sortSpecs")]
4709 pub sort_specs: Option<Vec<SortSpec>>,
4710}
4711
4712impl common::Part for SortRangeRequest {}
4713
4714/// A sort order associated with a specific column or row.
4715///
4716/// This type is not used in any activity, and only used as *part* of another schema.
4717///
4718#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4719#[serde_with::serde_as]
4720#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4721pub struct SortSpec {
4722 /// The background fill color to sort by; cells with this fill color are sorted to the top. Mutually exclusive with foreground_color. Deprecated: Use background_color_style.
4723 #[serde(rename = "backgroundColor")]
4724 pub background_color: Option<Color>,
4725 /// The background fill color to sort by; cells with this fill color are sorted to the top. Mutually exclusive with foreground_color, and must be an RGB-type color. If background_color is also set, this field takes precedence.
4726 #[serde(rename = "backgroundColorStyle")]
4727 pub background_color_style: Option<ColorStyle>,
4728 /// Reference to a data source column.
4729 #[serde(rename = "dataSourceColumnReference")]
4730 pub data_source_column_reference: Option<DataSourceColumnReference>,
4731 /// The dimension the sort should be applied to.
4732 #[serde(rename = "dimensionIndex")]
4733 pub dimension_index: Option<i32>,
4734 /// The foreground color to sort by; cells with this foreground color are sorted to the top. Mutually exclusive with background_color. Deprecated: Use foreground_color_style.
4735 #[serde(rename = "foregroundColor")]
4736 pub foreground_color: Option<Color>,
4737 /// The foreground color to sort by; cells with this foreground color are sorted to the top. Mutually exclusive with background_color, and must be an RGB-type color. If foreground_color is also set, this field takes precedence.
4738 #[serde(rename = "foregroundColorStyle")]
4739 pub foreground_color_style: Option<ColorStyle>,
4740 /// The order data should be sorted.
4741 #[serde(rename = "sortOrder")]
4742 pub sort_order: Option<String>,
4743}
4744
4745impl common::Part for SortSpec {}
4746
4747/// A combination of a source range and how to extend that source.
4748///
4749/// This type is not used in any activity, and only used as *part* of another schema.
4750///
4751#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4752#[serde_with::serde_as]
4753#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4754pub struct SourceAndDestination {
4755 /// The dimension that data should be filled into.
4756 pub dimension: Option<String>,
4757 /// The number of rows or columns that data should be filled into. Positive numbers expand beyond the last row or last column of the source. Negative numbers expand before the first row or first column of the source.
4758 #[serde(rename = "fillLength")]
4759 pub fill_length: Option<i32>,
4760 /// The location of the data to use as the source of the autofill.
4761 pub source: Option<GridRange>,
4762}
4763
4764impl common::Part for SourceAndDestination {}
4765
4766/// Resource that represents a spreadsheet.
4767///
4768/// # Activities
4769///
4770/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
4771/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
4772///
4773/// * [developer metadata get spreadsheets](SpreadsheetDeveloperMetadataGetCall) (none)
4774/// * [developer metadata search spreadsheets](SpreadsheetDeveloperMetadataSearchCall) (none)
4775/// * [sheets copy to spreadsheets](SpreadsheetSheetCopyToCall) (none)
4776/// * [values append spreadsheets](SpreadsheetValueAppendCall) (none)
4777/// * [values batch clear spreadsheets](SpreadsheetValueBatchClearCall) (none)
4778/// * [values batch clear by data filter spreadsheets](SpreadsheetValueBatchClearByDataFilterCall) (none)
4779/// * [values batch get spreadsheets](SpreadsheetValueBatchGetCall) (none)
4780/// * [values batch get by data filter spreadsheets](SpreadsheetValueBatchGetByDataFilterCall) (none)
4781/// * [values batch update spreadsheets](SpreadsheetValueBatchUpdateCall) (none)
4782/// * [values batch update by data filter spreadsheets](SpreadsheetValueBatchUpdateByDataFilterCall) (none)
4783/// * [values clear spreadsheets](SpreadsheetValueClearCall) (none)
4784/// * [values get spreadsheets](SpreadsheetValueGetCall) (none)
4785/// * [values update spreadsheets](SpreadsheetValueUpdateCall) (none)
4786/// * [batch update spreadsheets](SpreadsheetBatchUpdateCall) (none)
4787/// * [create spreadsheets](SpreadsheetCreateCall) (request|response)
4788/// * [get spreadsheets](SpreadsheetGetCall) (response)
4789/// * [get by data filter spreadsheets](SpreadsheetGetByDataFilterCall) (response)
4790#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4791#[serde_with::serde_as]
4792#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4793pub struct Spreadsheet {
4794 /// Output only. A list of data source refresh schedules.
4795 #[serde(rename = "dataSourceSchedules")]
4796 pub data_source_schedules: Option<Vec<DataSourceRefreshSchedule>>,
4797 /// A list of external data sources connected with the spreadsheet.
4798 #[serde(rename = "dataSources")]
4799 pub data_sources: Option<Vec<DataSource>>,
4800 /// The developer metadata associated with a spreadsheet.
4801 #[serde(rename = "developerMetadata")]
4802 pub developer_metadata: Option<Vec<DeveloperMetadata>>,
4803 /// The named ranges defined in a spreadsheet.
4804 #[serde(rename = "namedRanges")]
4805 pub named_ranges: Option<Vec<NamedRange>>,
4806 /// Overall properties of a spreadsheet.
4807 pub properties: Option<SpreadsheetProperties>,
4808 /// The sheets that are part of a spreadsheet.
4809 pub sheets: Option<Vec<Sheet>>,
4810 /// The ID of the spreadsheet. This field is read-only.
4811 #[serde(rename = "spreadsheetId")]
4812 pub spreadsheet_id: Option<String>,
4813 /// The url of the spreadsheet. This field is read-only.
4814 #[serde(rename = "spreadsheetUrl")]
4815 pub spreadsheet_url: Option<String>,
4816}
4817
4818impl common::RequestValue for Spreadsheet {}
4819impl common::Resource for Spreadsheet {}
4820impl common::ResponseResult for Spreadsheet {}
4821
4822/// Properties of a spreadsheet.
4823///
4824/// This type is not used in any activity, and only used as *part* of another schema.
4825///
4826#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4827#[serde_with::serde_as]
4828#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4829pub struct SpreadsheetProperties {
4830 /// The amount of time to wait before volatile functions are recalculated.
4831 #[serde(rename = "autoRecalc")]
4832 pub auto_recalc: Option<String>,
4833 /// The default format of all cells in the spreadsheet. CellData.effectiveFormat will not be set if the cell's format is equal to this default format. This field is read-only.
4834 #[serde(rename = "defaultFormat")]
4835 pub default_format: Option<CellFormat>,
4836 /// Whether to allow external URL access for image and import functions. Read only when true. When false, you can set to true.
4837 #[serde(rename = "importFunctionsExternalUrlAccessAllowed")]
4838 pub import_functions_external_url_access_allowed: Option<bool>,
4839 /// Determines whether and how circular references are resolved with iterative calculation. Absence of this field means that circular references result in calculation errors.
4840 #[serde(rename = "iterativeCalculationSettings")]
4841 pub iterative_calculation_settings: Option<IterativeCalculationSettings>,
4842 /// The locale of the spreadsheet in one of the following formats: * an ISO 639-1 language code such as `en` * an ISO 639-2 language code such as `fil`, if no 639-1 code exists * a combination of the ISO language code and country code, such as `en_US` Note: when updating this field, not all locales/languages are supported.
4843 pub locale: Option<String>,
4844 /// Theme applied to the spreadsheet.
4845 #[serde(rename = "spreadsheetTheme")]
4846 pub spreadsheet_theme: Option<SpreadsheetTheme>,
4847 /// The time zone of the spreadsheet, in CLDR format such as `America/New_York`. If the time zone isn't recognized, this may be a custom time zone such as `GMT-07:00`.
4848 #[serde(rename = "timeZone")]
4849 pub time_zone: Option<String>,
4850 /// The title of the spreadsheet.
4851 pub title: Option<String>,
4852}
4853
4854impl common::Part for SpreadsheetProperties {}
4855
4856/// Represents spreadsheet theme
4857///
4858/// This type is not used in any activity, and only used as *part* of another schema.
4859///
4860#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4861#[serde_with::serde_as]
4862#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4863pub struct SpreadsheetTheme {
4864 /// Name of the primary font family.
4865 #[serde(rename = "primaryFontFamily")]
4866 pub primary_font_family: Option<String>,
4867 /// The spreadsheet theme color pairs. To update you must provide all theme color pairs.
4868 #[serde(rename = "themeColors")]
4869 pub theme_colors: Option<Vec<ThemeColorPair>>,
4870}
4871
4872impl common::Part for SpreadsheetTheme {}
4873
4874/// The format of a run of text in a cell. Absent values indicate that the field isn't specified.
4875///
4876/// This type is not used in any activity, and only used as *part* of another schema.
4877///
4878#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4879#[serde_with::serde_as]
4880#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4881pub struct TextFormat {
4882 /// True if the text is bold.
4883 pub bold: Option<bool>,
4884 /// The font family.
4885 #[serde(rename = "fontFamily")]
4886 pub font_family: Option<String>,
4887 /// The size of the font.
4888 #[serde(rename = "fontSize")]
4889 pub font_size: Option<i32>,
4890 /// The foreground color of the text. Deprecated: Use foreground_color_style.
4891 #[serde(rename = "foregroundColor")]
4892 pub foreground_color: Option<Color>,
4893 /// The foreground color of the text. If foreground_color is also set, this field takes precedence.
4894 #[serde(rename = "foregroundColorStyle")]
4895 pub foreground_color_style: Option<ColorStyle>,
4896 /// True if the text is italicized.
4897 pub italic: Option<bool>,
4898 /// The link destination of the text, if any. Setting the link field in a TextFormatRun will clear the cell's existing links or a cell-level link set in the same request. When a link is set, the text foreground color will be set to the default link color and the text will be underlined. If these fields are modified in the same request, those values will be used instead of the link defaults.
4899 pub link: Option<Link>,
4900 /// True if the text has a strikethrough.
4901 pub strikethrough: Option<bool>,
4902 /// True if the text is underlined.
4903 pub underline: Option<bool>,
4904}
4905
4906impl common::Part for TextFormat {}
4907
4908/// A run of a text format. The format of this run continues until the start index of the next run. When updating, all fields must be set.
4909///
4910/// This type is not used in any activity, and only used as *part* of another schema.
4911///
4912#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4913#[serde_with::serde_as]
4914#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4915pub struct TextFormatRun {
4916 /// The format of this run. Absent values inherit the cell's format.
4917 pub format: Option<TextFormat>,
4918 /// The zero-based character index where this run starts, in UTF-16 code units.
4919 #[serde(rename = "startIndex")]
4920 pub start_index: Option<i32>,
4921}
4922
4923impl common::Part for TextFormatRun {}
4924
4925/// Position settings for text.
4926///
4927/// This type is not used in any activity, and only used as *part* of another schema.
4928///
4929#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4930#[serde_with::serde_as]
4931#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4932pub struct TextPosition {
4933 /// Horizontal alignment setting for the piece of text.
4934 #[serde(rename = "horizontalAlignment")]
4935 pub horizontal_alignment: Option<String>,
4936}
4937
4938impl common::Part for TextPosition {}
4939
4940/// The rotation applied to text in a cell.
4941///
4942/// This type is not used in any activity, and only used as *part* of another schema.
4943///
4944#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4945#[serde_with::serde_as]
4946#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4947pub struct TextRotation {
4948 /// The angle between the standard orientation and the desired orientation. Measured in degrees. Valid values are between -90 and 90. Positive angles are angled upwards, negative are angled downwards. Note: For LTR text direction positive angles are in the counterclockwise direction, whereas for RTL they are in the clockwise direction
4949 pub angle: Option<i32>,
4950 /// If true, text reads top to bottom, but the orientation of individual characters is unchanged. For example: | V | | e | | r | | t | | i | | c | | a | | l |
4951 pub vertical: Option<bool>,
4952}
4953
4954impl common::Part for TextRotation {}
4955
4956/// Splits a column of text into multiple columns, based on a delimiter in each cell.
4957///
4958/// This type is not used in any activity, and only used as *part* of another schema.
4959///
4960#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4961#[serde_with::serde_as]
4962#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4963pub struct TextToColumnsRequest {
4964 /// The delimiter to use. Used only if delimiterType is CUSTOM.
4965 pub delimiter: Option<String>,
4966 /// The delimiter type to use.
4967 #[serde(rename = "delimiterType")]
4968 pub delimiter_type: Option<String>,
4969 /// The source data range. This must span exactly one column.
4970 pub source: Option<GridRange>,
4971}
4972
4973impl common::Part for TextToColumnsRequest {}
4974
4975/// A pair mapping a spreadsheet theme color type to the concrete color it represents.
4976///
4977/// This type is not used in any activity, and only used as *part* of another schema.
4978///
4979#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4980#[serde_with::serde_as]
4981#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4982pub struct ThemeColorPair {
4983 /// The concrete color corresponding to the theme color type.
4984 pub color: Option<ColorStyle>,
4985 /// The type of the spreadsheet theme color.
4986 #[serde(rename = "colorType")]
4987 pub color_type: Option<String>,
4988}
4989
4990impl common::Part for ThemeColorPair {}
4991
4992/// Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.
4993///
4994/// This type is not used in any activity, and only used as *part* of another schema.
4995///
4996#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
4997#[serde_with::serde_as]
4998#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
4999pub struct TimeOfDay {
5000 /// Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.
5001 pub hours: Option<i32>,
5002 /// Minutes of hour of day. Must be from 0 to 59.
5003 pub minutes: Option<i32>,
5004 /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
5005 pub nanos: Option<i32>,
5006 /// Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.
5007 pub seconds: Option<i32>,
5008}
5009
5010impl common::Part for TimeOfDay {}
5011
5012/// A color scale for a treemap chart.
5013///
5014/// This type is not used in any activity, and only used as *part* of another schema.
5015///
5016#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5017#[serde_with::serde_as]
5018#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5019pub struct TreemapChartColorScale {
5020 /// The background color for cells with a color value greater than or equal to maxValue. Defaults to #109618 if not specified. Deprecated: Use max_value_color_style.
5021 #[serde(rename = "maxValueColor")]
5022 pub max_value_color: Option<Color>,
5023 /// The background color for cells with a color value greater than or equal to maxValue. Defaults to #109618 if not specified. If max_value_color is also set, this field takes precedence.
5024 #[serde(rename = "maxValueColorStyle")]
5025 pub max_value_color_style: Option<ColorStyle>,
5026 /// The background color for cells with a color value at the midpoint between minValue and maxValue. Defaults to #efe6dc if not specified. Deprecated: Use mid_value_color_style.
5027 #[serde(rename = "midValueColor")]
5028 pub mid_value_color: Option<Color>,
5029 /// The background color for cells with a color value at the midpoint between minValue and maxValue. Defaults to #efe6dc if not specified. If mid_value_color is also set, this field takes precedence.
5030 #[serde(rename = "midValueColorStyle")]
5031 pub mid_value_color_style: Option<ColorStyle>,
5032 /// The background color for cells with a color value less than or equal to minValue. Defaults to #dc3912 if not specified. Deprecated: Use min_value_color_style.
5033 #[serde(rename = "minValueColor")]
5034 pub min_value_color: Option<Color>,
5035 /// The background color for cells with a color value less than or equal to minValue. Defaults to #dc3912 if not specified. If min_value_color is also set, this field takes precedence.
5036 #[serde(rename = "minValueColorStyle")]
5037 pub min_value_color_style: Option<ColorStyle>,
5038 /// The background color for cells that have no color data associated with them. Defaults to #000000 if not specified. Deprecated: Use no_data_color_style.
5039 #[serde(rename = "noDataColor")]
5040 pub no_data_color: Option<Color>,
5041 /// The background color for cells that have no color data associated with them. Defaults to #000000 if not specified. If no_data_color is also set, this field takes precedence.
5042 #[serde(rename = "noDataColorStyle")]
5043 pub no_data_color_style: Option<ColorStyle>,
5044}
5045
5046impl common::Part for TreemapChartColorScale {}
5047
5048/// A Treemap chart.
5049///
5050/// This type is not used in any activity, and only used as *part* of another schema.
5051///
5052#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5053#[serde_with::serde_as]
5054#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5055pub struct TreemapChartSpec {
5056 /// The data that determines the background color of each treemap data cell. This field is optional. If not specified, size_data is used to determine background colors. If specified, the data is expected to be numeric. color_scale will determine how the values in this data map to data cell background colors.
5057 #[serde(rename = "colorData")]
5058 pub color_data: Option<ChartData>,
5059 /// The color scale for data cells in the treemap chart. Data cells are assigned colors based on their color values. These color values come from color_data, or from size_data if color_data is not specified. Cells with color values less than or equal to min_value will have minValueColor as their background color. Cells with color values greater than or equal to max_value will have maxValueColor as their background color. Cells with color values between min_value and max_value will have background colors on a gradient between minValueColor and maxValueColor, the midpoint of the gradient being midValueColor. Cells with missing or non-numeric color values will have noDataColor as their background color.
5060 #[serde(rename = "colorScale")]
5061 pub color_scale: Option<TreemapChartColorScale>,
5062 /// The background color for header cells. Deprecated: Use header_color_style.
5063 #[serde(rename = "headerColor")]
5064 pub header_color: Option<Color>,
5065 /// The background color for header cells. If header_color is also set, this field takes precedence.
5066 #[serde(rename = "headerColorStyle")]
5067 pub header_color_style: Option<ColorStyle>,
5068 /// True to hide tooltips.
5069 #[serde(rename = "hideTooltips")]
5070 pub hide_tooltips: Option<bool>,
5071 /// The number of additional data levels beyond the labeled levels to be shown on the treemap chart. These levels are not interactive and are shown without their labels. Defaults to 0 if not specified.
5072 #[serde(rename = "hintedLevels")]
5073 pub hinted_levels: Option<i32>,
5074 /// The data that contains the treemap cell labels.
5075 pub labels: Option<ChartData>,
5076 /// The number of data levels to show on the treemap chart. These levels are interactive and are shown with their labels. Defaults to 2 if not specified.
5077 pub levels: Option<i32>,
5078 /// The maximum possible data value. Cells with values greater than this will have the same color as cells with this value. If not specified, defaults to the actual maximum value from color_data, or the maximum value from size_data if color_data is not specified.
5079 #[serde(rename = "maxValue")]
5080 pub max_value: Option<f64>,
5081 /// The minimum possible data value. Cells with values less than this will have the same color as cells with this value. If not specified, defaults to the actual minimum value from color_data, or the minimum value from size_data if color_data is not specified.
5082 #[serde(rename = "minValue")]
5083 pub min_value: Option<f64>,
5084 /// The data the contains the treemap cells' parent labels.
5085 #[serde(rename = "parentLabels")]
5086 pub parent_labels: Option<ChartData>,
5087 /// The data that determines the size of each treemap data cell. This data is expected to be numeric. The cells corresponding to non-numeric or missing data will not be rendered. If color_data is not specified, this data is used to determine data cell background colors as well.
5088 #[serde(rename = "sizeData")]
5089 pub size_data: Option<ChartData>,
5090 /// The text format for all labels on the chart. The link field is not supported.
5091 #[serde(rename = "textFormat")]
5092 pub text_format: Option<TextFormat>,
5093}
5094
5095impl common::Part for TreemapChartSpec {}
5096
5097/// Trims the whitespace (such as spaces, tabs, or new lines) in every cell in the specified range. This request removes all whitespace from the start and end of each cell's text, and reduces any subsequence of remaining whitespace characters to a single space. If the resulting trimmed text starts with a '+' or '=' character, the text remains as a string value and isn't interpreted as a formula.
5098///
5099/// This type is not used in any activity, and only used as *part* of another schema.
5100///
5101#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5102#[serde_with::serde_as]
5103#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5104pub struct TrimWhitespaceRequest {
5105 /// The range whose cells to trim.
5106 pub range: Option<GridRange>,
5107}
5108
5109impl common::Part for TrimWhitespaceRequest {}
5110
5111/// The result of trimming whitespace in cells.
5112///
5113/// This type is not used in any activity, and only used as *part* of another schema.
5114///
5115#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5116#[serde_with::serde_as]
5117#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5118pub struct TrimWhitespaceResponse {
5119 /// The number of cells that were trimmed of whitespace.
5120 #[serde(rename = "cellsChangedCount")]
5121 pub cells_changed_count: Option<i32>,
5122}
5123
5124impl common::Part for TrimWhitespaceResponse {}
5125
5126/// Unmerges cells in the given range.
5127///
5128/// This type is not used in any activity, and only used as *part* of another schema.
5129///
5130#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5131#[serde_with::serde_as]
5132#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5133pub struct UnmergeCellsRequest {
5134 /// The range within which all cells should be unmerged. If the range spans multiple merges, all will be unmerged. The range must not partially span any merge.
5135 pub range: Option<GridRange>,
5136}
5137
5138impl common::Part for UnmergeCellsRequest {}
5139
5140/// Updates properties of the supplied banded range.
5141///
5142/// This type is not used in any activity, and only used as *part* of another schema.
5143///
5144#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5145#[serde_with::serde_as]
5146#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5147pub struct UpdateBandingRequest {
5148 /// The banded range to update with the new properties.
5149 #[serde(rename = "bandedRange")]
5150 pub banded_range: Option<BandedRange>,
5151 /// The fields that should be updated. At least one field must be specified. The root `bandedRange` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5152 pub fields: Option<common::FieldMask>,
5153}
5154
5155impl common::Part for UpdateBandingRequest {}
5156
5157/// Updates the borders of a range. If a field is not set in the request, that means the border remains as-is. For example, with two subsequent UpdateBordersRequest: 1. range: A1:A5 `{ top: RED, bottom: WHITE }` 2. range: A1:A5 `{ left: BLUE }` That would result in A1:A5 having a borders of `{ top: RED, bottom: WHITE, left: BLUE }`. If you want to clear a border, explicitly set the style to NONE.
5158///
5159/// This type is not used in any activity, and only used as *part* of another schema.
5160///
5161#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5162#[serde_with::serde_as]
5163#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5164pub struct UpdateBordersRequest {
5165 /// The border to put at the bottom of the range.
5166 pub bottom: Option<Border>,
5167 /// The horizontal border to put within the range.
5168 #[serde(rename = "innerHorizontal")]
5169 pub inner_horizontal: Option<Border>,
5170 /// The vertical border to put within the range.
5171 #[serde(rename = "innerVertical")]
5172 pub inner_vertical: Option<Border>,
5173 /// The border to put at the left of the range.
5174 pub left: Option<Border>,
5175 /// The range whose borders should be updated.
5176 pub range: Option<GridRange>,
5177 /// The border to put at the right of the range.
5178 pub right: Option<Border>,
5179 /// The border to put at the top of the range.
5180 pub top: Option<Border>,
5181}
5182
5183impl common::Part for UpdateBordersRequest {}
5184
5185/// Updates all cells in a range with new data.
5186///
5187/// This type is not used in any activity, and only used as *part* of another schema.
5188///
5189#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5190#[serde_with::serde_as]
5191#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5192pub struct UpdateCellsRequest {
5193 /// 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.
5194 pub fields: Option<common::FieldMask>,
5195 /// The range to write data to. If the data in rows does not cover the entire requested range, the fields matching those set in fields will be cleared.
5196 pub range: Option<GridRange>,
5197 /// The data to write.
5198 pub rows: Option<Vec<RowData>>,
5199 /// The coordinate to start writing data at. Any number of rows and columns (including a different number of columns per row) may be written.
5200 pub start: Option<GridCoordinate>,
5201}
5202
5203impl common::Part for UpdateCellsRequest {}
5204
5205/// Updates a chart's specifications. (This does not move or resize a chart. To move or resize a chart, use UpdateEmbeddedObjectPositionRequest.)
5206///
5207/// This type is not used in any activity, and only used as *part* of another schema.
5208///
5209#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5210#[serde_with::serde_as]
5211#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5212pub struct UpdateChartSpecRequest {
5213 /// The ID of the chart to update.
5214 #[serde(rename = "chartId")]
5215 pub chart_id: Option<i32>,
5216 /// The specification to apply to the chart.
5217 pub spec: Option<ChartSpec>,
5218}
5219
5220impl common::Part for UpdateChartSpecRequest {}
5221
5222/// Updates a conditional format rule at the given index, or moves a conditional format rule to another index.
5223///
5224/// This type is not used in any activity, and only used as *part* of another schema.
5225///
5226#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5227#[serde_with::serde_as]
5228#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5229pub struct UpdateConditionalFormatRuleRequest {
5230 /// The zero-based index of the rule that should be replaced or moved.
5231 pub index: Option<i32>,
5232 /// The zero-based new index the rule should end up at.
5233 #[serde(rename = "newIndex")]
5234 pub new_index: Option<i32>,
5235 /// The rule that should replace the rule at the given index.
5236 pub rule: Option<ConditionalFormatRule>,
5237 /// The sheet of the rule to move. Required if new_index is set, unused otherwise.
5238 #[serde(rename = "sheetId")]
5239 pub sheet_id: Option<i32>,
5240}
5241
5242impl common::Part for UpdateConditionalFormatRuleRequest {}
5243
5244/// The result of updating a conditional format rule.
5245///
5246/// This type is not used in any activity, and only used as *part* of another schema.
5247///
5248#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5249#[serde_with::serde_as]
5250#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5251pub struct UpdateConditionalFormatRuleResponse {
5252 /// The index of the new rule.
5253 #[serde(rename = "newIndex")]
5254 pub new_index: Option<i32>,
5255 /// The new rule that replaced the old rule (if replacing), or the rule that was moved (if moved)
5256 #[serde(rename = "newRule")]
5257 pub new_rule: Option<ConditionalFormatRule>,
5258 /// The old index of the rule. Not set if a rule was replaced (because it is the same as new_index).
5259 #[serde(rename = "oldIndex")]
5260 pub old_index: Option<i32>,
5261 /// The old (deleted) rule. Not set if a rule was moved (because it is the same as new_rule).
5262 #[serde(rename = "oldRule")]
5263 pub old_rule: Option<ConditionalFormatRule>,
5264}
5265
5266impl common::Part for UpdateConditionalFormatRuleResponse {}
5267
5268/// Updates a data source. After the data source is updated successfully, an execution is triggered to refresh the associated DATA_SOURCE sheet to read data from the updated data source. The request requires an additional `bigquery.readonly` OAuth scope.
5269///
5270/// This type is not used in any activity, and only used as *part* of another schema.
5271///
5272#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5273#[serde_with::serde_as]
5274#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5275pub struct UpdateDataSourceRequest {
5276 /// The data source to update.
5277 #[serde(rename = "dataSource")]
5278 pub data_source: Option<DataSource>,
5279 /// The fields that should be updated. At least one field must be specified. The root `dataSource` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5280 pub fields: Option<common::FieldMask>,
5281}
5282
5283impl common::Part for UpdateDataSourceRequest {}
5284
5285/// The response from updating data source.
5286///
5287/// This type is not used in any activity, and only used as *part* of another schema.
5288///
5289#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5290#[serde_with::serde_as]
5291#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5292pub struct UpdateDataSourceResponse {
5293 /// The data execution status.
5294 #[serde(rename = "dataExecutionStatus")]
5295 pub data_execution_status: Option<DataExecutionStatus>,
5296 /// The updated data source.
5297 #[serde(rename = "dataSource")]
5298 pub data_source: Option<DataSource>,
5299}
5300
5301impl common::Part for UpdateDataSourceResponse {}
5302
5303/// A request to update properties of developer metadata. Updates the properties of the developer metadata selected by the filters to the values provided in the DeveloperMetadata resource. Callers must specify the properties they wish to update in the fields parameter, as well as specify at least one DataFilter matching the metadata they wish to update.
5304///
5305/// This type is not used in any activity, and only used as *part* of another schema.
5306///
5307#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5308#[serde_with::serde_as]
5309#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5310pub struct UpdateDeveloperMetadataRequest {
5311 /// The filters matching the developer metadata entries to update.
5312 #[serde(rename = "dataFilters")]
5313 pub data_filters: Option<Vec<DataFilter>>,
5314 /// The value that all metadata matched by the data filters will be updated to.
5315 #[serde(rename = "developerMetadata")]
5316 pub developer_metadata: Option<DeveloperMetadata>,
5317 /// The fields that should be updated. At least one field must be specified. The root `developerMetadata` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5318 pub fields: Option<common::FieldMask>,
5319}
5320
5321impl common::Part for UpdateDeveloperMetadataRequest {}
5322
5323/// The response from updating developer metadata.
5324///
5325/// This type is not used in any activity, and only used as *part* of another schema.
5326///
5327#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5328#[serde_with::serde_as]
5329#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5330pub struct UpdateDeveloperMetadataResponse {
5331 /// The updated developer metadata.
5332 #[serde(rename = "developerMetadata")]
5333 pub developer_metadata: Option<Vec<DeveloperMetadata>>,
5334}
5335
5336impl common::Part for UpdateDeveloperMetadataResponse {}
5337
5338/// Updates the state of the specified group.
5339///
5340/// This type is not used in any activity, and only used as *part* of another schema.
5341///
5342#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5343#[serde_with::serde_as]
5344#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5345pub struct UpdateDimensionGroupRequest {
5346 /// The group whose state should be updated. The range and depth of the group should specify a valid group on the sheet, and all other fields updated.
5347 #[serde(rename = "dimensionGroup")]
5348 pub dimension_group: Option<DimensionGroup>,
5349 /// The fields that should be updated. At least one field must be specified. The root `dimensionGroup` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5350 pub fields: Option<common::FieldMask>,
5351}
5352
5353impl common::Part for UpdateDimensionGroupRequest {}
5354
5355/// Updates properties of dimensions within the specified range.
5356///
5357/// This type is not used in any activity, and only used as *part* of another schema.
5358///
5359#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5360#[serde_with::serde_as]
5361#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5362pub struct UpdateDimensionPropertiesRequest {
5363 /// The columns on a data source sheet to update.
5364 #[serde(rename = "dataSourceSheetRange")]
5365 pub data_source_sheet_range: Option<DataSourceSheetDimensionRange>,
5366 /// The fields that should be updated. At least one field must be specified. The root `properties` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5367 pub fields: Option<common::FieldMask>,
5368 /// Properties to update.
5369 pub properties: Option<DimensionProperties>,
5370 /// The rows or columns to update.
5371 pub range: Option<DimensionRange>,
5372}
5373
5374impl common::Part for UpdateDimensionPropertiesRequest {}
5375
5376/// Updates an embedded object's border property.
5377///
5378/// This type is not used in any activity, and only used as *part* of another schema.
5379///
5380#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5381#[serde_with::serde_as]
5382#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5383pub struct UpdateEmbeddedObjectBorderRequest {
5384 /// The border that applies to the embedded object.
5385 pub border: Option<EmbeddedObjectBorder>,
5386 /// The fields that should be updated. At least one field must be specified. The root `border` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5387 pub fields: Option<common::FieldMask>,
5388 /// The ID of the embedded object to update.
5389 #[serde(rename = "objectId")]
5390 pub object_id: Option<i32>,
5391}
5392
5393impl common::Part for UpdateEmbeddedObjectBorderRequest {}
5394
5395/// Update an embedded object's position (such as a moving or resizing a chart or image).
5396///
5397/// This type is not used in any activity, and only used as *part* of another schema.
5398///
5399#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5400#[serde_with::serde_as]
5401#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5402pub struct UpdateEmbeddedObjectPositionRequest {
5403 /// The fields of OverlayPosition that should be updated when setting a new position. Used only if newPosition.overlayPosition is set, in which case at least one field must be specified. The root `newPosition.overlayPosition` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5404 pub fields: Option<common::FieldMask>,
5405 /// An explicit position to move the embedded object to. If newPosition.sheetId is set, a new sheet with that ID will be created. If newPosition.newSheet is set to true, a new sheet will be created with an ID that will be chosen for you.
5406 #[serde(rename = "newPosition")]
5407 pub new_position: Option<EmbeddedObjectPosition>,
5408 /// The ID of the object to moved.
5409 #[serde(rename = "objectId")]
5410 pub object_id: Option<i32>,
5411}
5412
5413impl common::Part for UpdateEmbeddedObjectPositionRequest {}
5414
5415/// The result of updating an embedded object's position.
5416///
5417/// This type is not used in any activity, and only used as *part* of another schema.
5418///
5419#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5420#[serde_with::serde_as]
5421#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5422pub struct UpdateEmbeddedObjectPositionResponse {
5423 /// The new position of the embedded object.
5424 pub position: Option<EmbeddedObjectPosition>,
5425}
5426
5427impl common::Part for UpdateEmbeddedObjectPositionResponse {}
5428
5429/// Updates properties of the filter view.
5430///
5431/// This type is not used in any activity, and only used as *part* of another schema.
5432///
5433#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5434#[serde_with::serde_as]
5435#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5436pub struct UpdateFilterViewRequest {
5437 /// The fields that should be updated. At least one field must be specified. The root `filter` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5438 pub fields: Option<common::FieldMask>,
5439 /// The new properties of the filter view.
5440 pub filter: Option<FilterView>,
5441}
5442
5443impl common::Part for UpdateFilterViewRequest {}
5444
5445/// Updates properties of the named range with the specified namedRangeId.
5446///
5447/// This type is not used in any activity, and only used as *part* of another schema.
5448///
5449#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5450#[serde_with::serde_as]
5451#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5452pub struct UpdateNamedRangeRequest {
5453 /// The fields that should be updated. At least one field must be specified. The root `namedRange` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5454 pub fields: Option<common::FieldMask>,
5455 /// The named range to update with the new properties.
5456 #[serde(rename = "namedRange")]
5457 pub named_range: Option<NamedRange>,
5458}
5459
5460impl common::Part for UpdateNamedRangeRequest {}
5461
5462/// Updates an existing protected range with the specified protectedRangeId.
5463///
5464/// This type is not used in any activity, and only used as *part* of another schema.
5465///
5466#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5467#[serde_with::serde_as]
5468#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5469pub struct UpdateProtectedRangeRequest {
5470 /// The fields that should be updated. At least one field must be specified. The root `protectedRange` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5471 pub fields: Option<common::FieldMask>,
5472 /// The protected range to update with the new properties.
5473 #[serde(rename = "protectedRange")]
5474 pub protected_range: Option<ProtectedRange>,
5475}
5476
5477impl common::Part for UpdateProtectedRangeRequest {}
5478
5479/// Updates properties of the sheet with the specified sheetId.
5480///
5481/// This type is not used in any activity, and only used as *part* of another schema.
5482///
5483#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5484#[serde_with::serde_as]
5485#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5486pub struct UpdateSheetPropertiesRequest {
5487 /// The fields that should be updated. At least one field must be specified. The root `properties` is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5488 pub fields: Option<common::FieldMask>,
5489 /// The properties to update.
5490 pub properties: Option<SheetProperties>,
5491}
5492
5493impl common::Part for UpdateSheetPropertiesRequest {}
5494
5495/// Updates a slicer's specifications. (This does not move or resize a slicer. To move or resize a slicer use UpdateEmbeddedObjectPositionRequest.
5496///
5497/// This type is not used in any activity, and only used as *part* of another schema.
5498///
5499#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5500#[serde_with::serde_as]
5501#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5502pub struct UpdateSlicerSpecRequest {
5503 /// The fields that should be updated. At least one field must be specified. The root `SlicerSpec` is implied and should not be specified. A single "*"` can be used as short-hand for listing every field.
5504 pub fields: Option<common::FieldMask>,
5505 /// The id of the slicer to update.
5506 #[serde(rename = "slicerId")]
5507 pub slicer_id: Option<i32>,
5508 /// The specification to apply to the slicer.
5509 pub spec: Option<SlicerSpec>,
5510}
5511
5512impl common::Part for UpdateSlicerSpecRequest {}
5513
5514/// Updates properties of a spreadsheet.
5515///
5516/// This type is not used in any activity, and only used as *part* of another schema.
5517///
5518#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5519#[serde_with::serde_as]
5520#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5521pub struct UpdateSpreadsheetPropertiesRequest {
5522 /// The fields that should be updated. At least one field must be specified. The root 'properties' is implied and should not be specified. A single `"*"` can be used as short-hand for listing every field.
5523 pub fields: Option<common::FieldMask>,
5524 /// The properties to update.
5525 pub properties: Option<SpreadsheetProperties>,
5526}
5527
5528impl common::Part for UpdateSpreadsheetPropertiesRequest {}
5529
5530/// The response when updating a range of values by a data filter in a spreadsheet.
5531///
5532/// This type is not used in any activity, and only used as *part* of another schema.
5533///
5534#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5535#[serde_with::serde_as]
5536#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5537pub struct UpdateValuesByDataFilterResponse {
5538 /// The data filter that selected the range that was updated.
5539 #[serde(rename = "dataFilter")]
5540 pub data_filter: Option<DataFilter>,
5541 /// The number of cells updated.
5542 #[serde(rename = "updatedCells")]
5543 pub updated_cells: Option<i32>,
5544 /// The number of columns where at least one cell in the column was updated.
5545 #[serde(rename = "updatedColumns")]
5546 pub updated_columns: Option<i32>,
5547 /// The values of the cells in the range matched by the dataFilter after all updates were applied. This is only included if the request's `includeValuesInResponse` field was `true`.
5548 #[serde(rename = "updatedData")]
5549 pub updated_data: Option<ValueRange>,
5550 /// The range (in [A1 notation](https://developers.google.com/sheets/api/guides/concepts#cell)) that updates were applied to.
5551 #[serde(rename = "updatedRange")]
5552 pub updated_range: Option<String>,
5553 /// The number of rows where at least one cell in the row was updated.
5554 #[serde(rename = "updatedRows")]
5555 pub updated_rows: Option<i32>,
5556}
5557
5558impl common::Part for UpdateValuesByDataFilterResponse {}
5559
5560/// The response when updating a range of values in a spreadsheet.
5561///
5562/// # Activities
5563///
5564/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
5565/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
5566///
5567/// * [values update spreadsheets](SpreadsheetValueUpdateCall) (response)
5568#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5569#[serde_with::serde_as]
5570#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5571pub struct UpdateValuesResponse {
5572 /// The spreadsheet the updates were applied to.
5573 #[serde(rename = "spreadsheetId")]
5574 pub spreadsheet_id: Option<String>,
5575 /// The number of cells updated.
5576 #[serde(rename = "updatedCells")]
5577 pub updated_cells: Option<i32>,
5578 /// The number of columns where at least one cell in the column was updated.
5579 #[serde(rename = "updatedColumns")]
5580 pub updated_columns: Option<i32>,
5581 /// The values of the cells after updates were applied. This is only included if the request's `includeValuesInResponse` field was `true`.
5582 #[serde(rename = "updatedData")]
5583 pub updated_data: Option<ValueRange>,
5584 /// The range (in A1 notation) that updates were applied to.
5585 #[serde(rename = "updatedRange")]
5586 pub updated_range: Option<String>,
5587 /// The number of rows where at least one cell in the row was updated.
5588 #[serde(rename = "updatedRows")]
5589 pub updated_rows: Option<i32>,
5590}
5591
5592impl common::ResponseResult for UpdateValuesResponse {}
5593
5594/// Data within a range of the spreadsheet.
5595///
5596/// # Activities
5597///
5598/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
5599/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
5600///
5601/// * [values append spreadsheets](SpreadsheetValueAppendCall) (request)
5602/// * [values get spreadsheets](SpreadsheetValueGetCall) (response)
5603/// * [values update spreadsheets](SpreadsheetValueUpdateCall) (request)
5604#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5605#[serde_with::serde_as]
5606#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5607pub struct ValueRange {
5608 /// The major dimension of the values. For output, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` will return `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` will return `[[1,3],[2,4]]`. For input, with `range=A1:B2,majorDimension=ROWS` then `[[1,2],[3,4]]` will set `A1=1,B1=2,A2=3,B2=4`. With `range=A1:B2,majorDimension=COLUMNS` then `[[1,2],[3,4]]` will set `A1=1,B1=3,A2=2,B2=4`. When writing, if this field is not set, it defaults to ROWS.
5609 #[serde(rename = "majorDimension")]
5610 pub major_dimension: Option<String>,
5611 /// The range the values cover, in [A1 notation](https://developers.google.com/sheets/api/guides/concepts#cell). For output, this range indicates the entire requested range, even though the values will exclude trailing rows and columns. When appending values, this field represents the range to search for a table, after which values will be appended.
5612 pub range: Option<String>,
5613 /// The data that was read or to be written. This is an array of arrays, the outer array representing all the data and each inner array representing a major dimension. Each item in the inner array corresponds with one cell. For output, empty trailing rows and columns will not be included. For input, supported value types are: bool, string, and double. Null values will be skipped. To set a cell to an empty value, set the string value to an empty string.
5614 pub values: Option<Vec<Vec<serde_json::Value>>>,
5615}
5616
5617impl common::RequestValue for ValueRange {}
5618impl common::ResponseResult for ValueRange {}
5619
5620/// Styles for a waterfall chart column.
5621///
5622/// This type is not used in any activity, and only used as *part* of another schema.
5623///
5624#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5625#[serde_with::serde_as]
5626#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5627pub struct WaterfallChartColumnStyle {
5628 /// The color of the column. Deprecated: Use color_style.
5629 pub color: Option<Color>,
5630 /// The color of the column. If color is also set, this field takes precedence.
5631 #[serde(rename = "colorStyle")]
5632 pub color_style: Option<ColorStyle>,
5633 /// The label of the column's legend.
5634 pub label: Option<String>,
5635}
5636
5637impl common::Part for WaterfallChartColumnStyle {}
5638
5639/// A custom subtotal column for a waterfall chart series.
5640///
5641/// This type is not used in any activity, and only used as *part* of another schema.
5642///
5643#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5644#[serde_with::serde_as]
5645#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5646pub struct WaterfallChartCustomSubtotal {
5647 /// True if the data point at subtotal_index is the subtotal. If false, the subtotal will be computed and appear after the data point.
5648 #[serde(rename = "dataIsSubtotal")]
5649 pub data_is_subtotal: Option<bool>,
5650 /// A label for the subtotal column.
5651 pub label: Option<String>,
5652 /// The zero-based index of a data point within the series. If data_is_subtotal is true, the data point at this index is the subtotal. Otherwise, the subtotal appears after the data point with this index. A series can have multiple subtotals at arbitrary indices, but subtotals do not affect the indices of the data points. For example, if a series has three data points, their indices will always be 0, 1, and 2, regardless of how many subtotals exist on the series or what data points they are associated with.
5653 #[serde(rename = "subtotalIndex")]
5654 pub subtotal_index: Option<i32>,
5655}
5656
5657impl common::Part for WaterfallChartCustomSubtotal {}
5658
5659/// The domain of a waterfall chart.
5660///
5661/// This type is not used in any activity, and only used as *part* of another schema.
5662///
5663#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5664#[serde_with::serde_as]
5665#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5666pub struct WaterfallChartDomain {
5667 /// The data of the WaterfallChartDomain.
5668 pub data: Option<ChartData>,
5669 /// True to reverse the order of the domain values (horizontal axis).
5670 pub reversed: Option<bool>,
5671}
5672
5673impl common::Part for WaterfallChartDomain {}
5674
5675/// A single series of data for a waterfall chart.
5676///
5677/// This type is not used in any activity, and only used as *part* of another schema.
5678///
5679#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5680#[serde_with::serde_as]
5681#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5682pub struct WaterfallChartSeries {
5683 /// Custom subtotal columns appearing in this series. The order in which subtotals are defined is not significant. Only one subtotal may be defined for each data point.
5684 #[serde(rename = "customSubtotals")]
5685 pub custom_subtotals: Option<Vec<WaterfallChartCustomSubtotal>>,
5686 /// The data being visualized in this series.
5687 pub data: Option<ChartData>,
5688 /// Information about the data labels for this series.
5689 #[serde(rename = "dataLabel")]
5690 pub data_label: Option<DataLabel>,
5691 /// True to hide the subtotal column from the end of the series. By default, a subtotal column will appear at the end of each series. Setting this field to true will hide that subtotal column for this series.
5692 #[serde(rename = "hideTrailingSubtotal")]
5693 pub hide_trailing_subtotal: Option<bool>,
5694 /// Styles for all columns in this series with negative values.
5695 #[serde(rename = "negativeColumnsStyle")]
5696 pub negative_columns_style: Option<WaterfallChartColumnStyle>,
5697 /// Styles for all columns in this series with positive values.
5698 #[serde(rename = "positiveColumnsStyle")]
5699 pub positive_columns_style: Option<WaterfallChartColumnStyle>,
5700 /// Styles for all subtotal columns in this series.
5701 #[serde(rename = "subtotalColumnsStyle")]
5702 pub subtotal_columns_style: Option<WaterfallChartColumnStyle>,
5703}
5704
5705impl common::Part for WaterfallChartSeries {}
5706
5707/// A waterfall chart.
5708///
5709/// This type is not used in any activity, and only used as *part* of another schema.
5710///
5711#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
5712#[serde_with::serde_as]
5713#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5714pub struct WaterfallChartSpec {
5715 /// The line style for the connector lines.
5716 #[serde(rename = "connectorLineStyle")]
5717 pub connector_line_style: Option<LineStyle>,
5718 /// The domain data (horizontal axis) for the waterfall chart.
5719 pub domain: Option<WaterfallChartDomain>,
5720 /// True to interpret the first value as a total.
5721 #[serde(rename = "firstValueIsTotal")]
5722 pub first_value_is_total: Option<bool>,
5723 /// True to hide connector lines between columns.
5724 #[serde(rename = "hideConnectorLines")]
5725 pub hide_connector_lines: Option<bool>,
5726 /// The data this waterfall chart is visualizing.
5727 pub series: Option<Vec<WaterfallChartSeries>>,
5728 /// The stacked type.
5729 #[serde(rename = "stackedType")]
5730 pub stacked_type: Option<String>,
5731 /// Controls whether to display additional data labels on stacked charts which sum the total value of all stacked values at each value along the domain axis. stacked_type must be STACKED and neither CUSTOM nor placement can be set on the total_data_label.
5732 #[serde(rename = "totalDataLabel")]
5733 pub total_data_label: Option<DataLabel>,
5734}
5735
5736impl common::Part for WaterfallChartSpec {}
5737
5738// ###################
5739// MethodBuilders ###
5740// #################
5741
5742/// A builder providing access to all methods supported on *spreadsheet* resources.
5743/// It is not used directly, but through the [`Sheets`] hub.
5744///
5745/// # Example
5746///
5747/// Instantiate a resource builder
5748///
5749/// ```test_harness,no_run
5750/// extern crate hyper;
5751/// extern crate hyper_rustls;
5752/// extern crate google_sheets4 as sheets4;
5753///
5754/// # async fn dox() {
5755/// use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5756///
5757/// let secret: yup_oauth2::ApplicationSecret = Default::default();
5758/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
5759/// secret,
5760/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5761/// ).build().await.unwrap();
5762///
5763/// let client = hyper_util::client::legacy::Client::builder(
5764/// hyper_util::rt::TokioExecutor::new()
5765/// )
5766/// .build(
5767/// hyper_rustls::HttpsConnectorBuilder::new()
5768/// .with_native_roots()
5769/// .unwrap()
5770/// .https_or_http()
5771/// .enable_http1()
5772/// .build()
5773/// );
5774/// let mut hub = Sheets::new(client, auth);
5775/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
5776/// // like `batch_update(...)`, `create(...)`, `developer_metadata_get(...)`, `developer_metadata_search(...)`, `get(...)`, `get_by_data_filter(...)`, `sheets_copy_to(...)`, `values_append(...)`, `values_batch_clear(...)`, `values_batch_clear_by_data_filter(...)`, `values_batch_get(...)`, `values_batch_get_by_data_filter(...)`, `values_batch_update(...)`, `values_batch_update_by_data_filter(...)`, `values_clear(...)`, `values_get(...)` and `values_update(...)`
5777/// // to build up your call.
5778/// let rb = hub.spreadsheets();
5779/// # }
5780/// ```
5781pub struct SpreadsheetMethods<'a, C>
5782where
5783 C: 'a,
5784{
5785 hub: &'a Sheets<C>,
5786}
5787
5788impl<'a, C> common::MethodsBuilder for SpreadsheetMethods<'a, C> {}
5789
5790impl<'a, C> SpreadsheetMethods<'a, C> {
5791 /// Create a builder to help you perform the following task:
5792 ///
5793 /// Returns the developer metadata with the specified ID. The caller must specify the spreadsheet ID and the developer metadata's unique metadataId.
5794 ///
5795 /// # Arguments
5796 ///
5797 /// * `spreadsheetId` - The ID of the spreadsheet to retrieve metadata from.
5798 /// * `metadataId` - The ID of the developer metadata to retrieve.
5799 pub fn developer_metadata_get(
5800 &self,
5801 spreadsheet_id: &str,
5802 metadata_id: i32,
5803 ) -> SpreadsheetDeveloperMetadataGetCall<'a, C> {
5804 SpreadsheetDeveloperMetadataGetCall {
5805 hub: self.hub,
5806 _spreadsheet_id: spreadsheet_id.to_string(),
5807 _metadata_id: metadata_id,
5808 _delegate: Default::default(),
5809 _additional_params: Default::default(),
5810 _scopes: Default::default(),
5811 }
5812 }
5813
5814 /// Create a builder to help you perform the following task:
5815 ///
5816 /// 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.
5817 ///
5818 /// # Arguments
5819 ///
5820 /// * `request` - No description provided.
5821 /// * `spreadsheetId` - The ID of the spreadsheet to retrieve metadata from.
5822 pub fn developer_metadata_search(
5823 &self,
5824 request: SearchDeveloperMetadataRequest,
5825 spreadsheet_id: &str,
5826 ) -> SpreadsheetDeveloperMetadataSearchCall<'a, C> {
5827 SpreadsheetDeveloperMetadataSearchCall {
5828 hub: self.hub,
5829 _request: request,
5830 _spreadsheet_id: spreadsheet_id.to_string(),
5831 _delegate: Default::default(),
5832 _additional_params: Default::default(),
5833 _scopes: Default::default(),
5834 }
5835 }
5836
5837 /// Create a builder to help you perform the following task:
5838 ///
5839 /// Copies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.
5840 ///
5841 /// # Arguments
5842 ///
5843 /// * `request` - No description provided.
5844 /// * `spreadsheetId` - The ID of the spreadsheet containing the sheet to copy.
5845 /// * `sheetId` - The ID of the sheet to copy.
5846 pub fn sheets_copy_to(
5847 &self,
5848 request: CopySheetToAnotherSpreadsheetRequest,
5849 spreadsheet_id: &str,
5850 sheet_id: i32,
5851 ) -> SpreadsheetSheetCopyToCall<'a, C> {
5852 SpreadsheetSheetCopyToCall {
5853 hub: self.hub,
5854 _request: request,
5855 _spreadsheet_id: spreadsheet_id.to_string(),
5856 _sheet_id: sheet_id,
5857 _delegate: Default::default(),
5858 _additional_params: Default::default(),
5859 _scopes: Default::default(),
5860 }
5861 }
5862
5863 /// Create a builder to help you perform the following task:
5864 ///
5865 /// 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/sheets/api/guides/values#appending_values) and [sample code](https://developers.google.com/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.
5866 ///
5867 /// # Arguments
5868 ///
5869 /// * `request` - No description provided.
5870 /// * `spreadsheetId` - The ID of the spreadsheet to update.
5871 /// * `range` - The [A1 notation](https://developers.google.com/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.
5872 pub fn values_append(
5873 &self,
5874 request: ValueRange,
5875 spreadsheet_id: &str,
5876 range: &str,
5877 ) -> SpreadsheetValueAppendCall<'a, C> {
5878 SpreadsheetValueAppendCall {
5879 hub: self.hub,
5880 _request: request,
5881 _spreadsheet_id: spreadsheet_id.to_string(),
5882 _range: range.to_string(),
5883 _value_input_option: Default::default(),
5884 _response_value_render_option: Default::default(),
5885 _response_date_time_render_option: Default::default(),
5886 _insert_data_option: Default::default(),
5887 _include_values_in_response: Default::default(),
5888 _delegate: Default::default(),
5889 _additional_params: Default::default(),
5890 _scopes: Default::default(),
5891 }
5892 }
5893
5894 /// Create a builder to help you perform the following task:
5895 ///
5896 /// 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.
5897 ///
5898 /// # Arguments
5899 ///
5900 /// * `request` - No description provided.
5901 /// * `spreadsheetId` - The ID of the spreadsheet to update.
5902 pub fn values_batch_clear(
5903 &self,
5904 request: BatchClearValuesRequest,
5905 spreadsheet_id: &str,
5906 ) -> SpreadsheetValueBatchClearCall<'a, C> {
5907 SpreadsheetValueBatchClearCall {
5908 hub: self.hub,
5909 _request: request,
5910 _spreadsheet_id: spreadsheet_id.to_string(),
5911 _delegate: Default::default(),
5912 _additional_params: Default::default(),
5913 _scopes: Default::default(),
5914 }
5915 }
5916
5917 /// Create a builder to help you perform the following task:
5918 ///
5919 /// 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.
5920 ///
5921 /// # Arguments
5922 ///
5923 /// * `request` - No description provided.
5924 /// * `spreadsheetId` - The ID of the spreadsheet to update.
5925 pub fn values_batch_clear_by_data_filter(
5926 &self,
5927 request: BatchClearValuesByDataFilterRequest,
5928 spreadsheet_id: &str,
5929 ) -> SpreadsheetValueBatchClearByDataFilterCall<'a, C> {
5930 SpreadsheetValueBatchClearByDataFilterCall {
5931 hub: self.hub,
5932 _request: request,
5933 _spreadsheet_id: spreadsheet_id.to_string(),
5934 _delegate: Default::default(),
5935 _additional_params: Default::default(),
5936 _scopes: Default::default(),
5937 }
5938 }
5939
5940 /// Create a builder to help you perform the following task:
5941 ///
5942 /// Returns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges.
5943 ///
5944 /// # Arguments
5945 ///
5946 /// * `spreadsheetId` - The ID of the spreadsheet to retrieve data from.
5947 pub fn values_batch_get(&self, spreadsheet_id: &str) -> SpreadsheetValueBatchGetCall<'a, C> {
5948 SpreadsheetValueBatchGetCall {
5949 hub: self.hub,
5950 _spreadsheet_id: spreadsheet_id.to_string(),
5951 _value_render_option: Default::default(),
5952 _ranges: Default::default(),
5953 _major_dimension: Default::default(),
5954 _date_time_render_option: Default::default(),
5955 _delegate: Default::default(),
5956 _additional_params: Default::default(),
5957 _scopes: Default::default(),
5958 }
5959 }
5960
5961 /// Create a builder to help you perform the following task:
5962 ///
5963 /// 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.
5964 ///
5965 /// # Arguments
5966 ///
5967 /// * `request` - No description provided.
5968 /// * `spreadsheetId` - The ID of the spreadsheet to retrieve data from.
5969 pub fn values_batch_get_by_data_filter(
5970 &self,
5971 request: BatchGetValuesByDataFilterRequest,
5972 spreadsheet_id: &str,
5973 ) -> SpreadsheetValueBatchGetByDataFilterCall<'a, C> {
5974 SpreadsheetValueBatchGetByDataFilterCall {
5975 hub: self.hub,
5976 _request: request,
5977 _spreadsheet_id: spreadsheet_id.to_string(),
5978 _delegate: Default::default(),
5979 _additional_params: Default::default(),
5980 _scopes: Default::default(),
5981 }
5982 }
5983
5984 /// Create a builder to help you perform the following task:
5985 ///
5986 /// Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.
5987 ///
5988 /// # Arguments
5989 ///
5990 /// * `request` - No description provided.
5991 /// * `spreadsheetId` - The ID of the spreadsheet to update.
5992 pub fn values_batch_update(
5993 &self,
5994 request: BatchUpdateValuesRequest,
5995 spreadsheet_id: &str,
5996 ) -> SpreadsheetValueBatchUpdateCall<'a, C> {
5997 SpreadsheetValueBatchUpdateCall {
5998 hub: self.hub,
5999 _request: request,
6000 _spreadsheet_id: spreadsheet_id.to_string(),
6001 _delegate: Default::default(),
6002 _additional_params: Default::default(),
6003 _scopes: Default::default(),
6004 }
6005 }
6006
6007 /// Create a builder to help you perform the following task:
6008 ///
6009 /// Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more DataFilterValueRanges.
6010 ///
6011 /// # Arguments
6012 ///
6013 /// * `request` - No description provided.
6014 /// * `spreadsheetId` - The ID of the spreadsheet to update.
6015 pub fn values_batch_update_by_data_filter(
6016 &self,
6017 request: BatchUpdateValuesByDataFilterRequest,
6018 spreadsheet_id: &str,
6019 ) -> SpreadsheetValueBatchUpdateByDataFilterCall<'a, C> {
6020 SpreadsheetValueBatchUpdateByDataFilterCall {
6021 hub: self.hub,
6022 _request: request,
6023 _spreadsheet_id: spreadsheet_id.to_string(),
6024 _delegate: Default::default(),
6025 _additional_params: Default::default(),
6026 _scopes: Default::default(),
6027 }
6028 }
6029
6030 /// Create a builder to help you perform the following task:
6031 ///
6032 /// 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.
6033 ///
6034 /// # Arguments
6035 ///
6036 /// * `request` - No description provided.
6037 /// * `spreadsheetId` - The ID of the spreadsheet to update.
6038 /// * `range` - The [A1 notation or R1C1 notation](https://developers.google.com/sheets/api/guides/concepts#cell) of the values to clear.
6039 pub fn values_clear(
6040 &self,
6041 request: ClearValuesRequest,
6042 spreadsheet_id: &str,
6043 range: &str,
6044 ) -> SpreadsheetValueClearCall<'a, C> {
6045 SpreadsheetValueClearCall {
6046 hub: self.hub,
6047 _request: request,
6048 _spreadsheet_id: spreadsheet_id.to_string(),
6049 _range: range.to_string(),
6050 _delegate: Default::default(),
6051 _additional_params: Default::default(),
6052 _scopes: Default::default(),
6053 }
6054 }
6055
6056 /// Create a builder to help you perform the following task:
6057 ///
6058 /// Returns a range of values from a spreadsheet. The caller must specify the spreadsheet ID and a range.
6059 ///
6060 /// # Arguments
6061 ///
6062 /// * `spreadsheetId` - The ID of the spreadsheet to retrieve data from.
6063 /// * `range` - The [A1 notation or R1C1 notation](https://developers.google.com/sheets/api/guides/concepts#cell) of the range to retrieve values from.
6064 pub fn values_get(&self, spreadsheet_id: &str, range: &str) -> SpreadsheetValueGetCall<'a, C> {
6065 SpreadsheetValueGetCall {
6066 hub: self.hub,
6067 _spreadsheet_id: spreadsheet_id.to_string(),
6068 _range: range.to_string(),
6069 _value_render_option: Default::default(),
6070 _major_dimension: Default::default(),
6071 _date_time_render_option: Default::default(),
6072 _delegate: Default::default(),
6073 _additional_params: Default::default(),
6074 _scopes: Default::default(),
6075 }
6076 }
6077
6078 /// Create a builder to help you perform the following task:
6079 ///
6080 /// Sets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a valueInputOption.
6081 ///
6082 /// # Arguments
6083 ///
6084 /// * `request` - No description provided.
6085 /// * `spreadsheetId` - The ID of the spreadsheet to update.
6086 /// * `range` - The [A1 notation](https://developers.google.com/sheets/api/guides/concepts#cell) of the values to update.
6087 pub fn values_update(
6088 &self,
6089 request: ValueRange,
6090 spreadsheet_id: &str,
6091 range: &str,
6092 ) -> SpreadsheetValueUpdateCall<'a, C> {
6093 SpreadsheetValueUpdateCall {
6094 hub: self.hub,
6095 _request: request,
6096 _spreadsheet_id: spreadsheet_id.to_string(),
6097 _range: range.to_string(),
6098 _value_input_option: Default::default(),
6099 _response_value_render_option: Default::default(),
6100 _response_date_time_render_option: Default::default(),
6101 _include_values_in_response: Default::default(),
6102 _delegate: Default::default(),
6103 _additional_params: Default::default(),
6104 _scopes: Default::default(),
6105 }
6106 }
6107
6108 /// Create a builder to help you perform the following task:
6109 ///
6110 /// 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.
6111 ///
6112 /// # Arguments
6113 ///
6114 /// * `request` - No description provided.
6115 /// * `spreadsheetId` - The spreadsheet to apply the updates to.
6116 pub fn batch_update(
6117 &self,
6118 request: BatchUpdateSpreadsheetRequest,
6119 spreadsheet_id: &str,
6120 ) -> SpreadsheetBatchUpdateCall<'a, C> {
6121 SpreadsheetBatchUpdateCall {
6122 hub: self.hub,
6123 _request: request,
6124 _spreadsheet_id: spreadsheet_id.to_string(),
6125 _delegate: Default::default(),
6126 _additional_params: Default::default(),
6127 _scopes: Default::default(),
6128 }
6129 }
6130
6131 /// Create a builder to help you perform the following task:
6132 ///
6133 /// Creates a spreadsheet, returning the newly created spreadsheet.
6134 ///
6135 /// # Arguments
6136 ///
6137 /// * `request` - No description provided.
6138 pub fn create(&self, request: Spreadsheet) -> SpreadsheetCreateCall<'a, C> {
6139 SpreadsheetCreateCall {
6140 hub: self.hub,
6141 _request: request,
6142 _delegate: Default::default(),
6143 _additional_params: Default::default(),
6144 _scopes: Default::default(),
6145 }
6146 }
6147
6148 /// Create a builder to help you perform the following task:
6149 ///
6150 /// 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/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/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.
6151 ///
6152 /// # Arguments
6153 ///
6154 /// * `spreadsheetId` - The spreadsheet to request.
6155 pub fn get(&self, spreadsheet_id: &str) -> SpreadsheetGetCall<'a, C> {
6156 SpreadsheetGetCall {
6157 hub: self.hub,
6158 _spreadsheet_id: spreadsheet_id.to_string(),
6159 _ranges: Default::default(),
6160 _include_grid_data: Default::default(),
6161 _delegate: Default::default(),
6162 _additional_params: Default::default(),
6163 _scopes: Default::default(),
6164 }
6165 }
6166
6167 /// Create a builder to help you perform the following task:
6168 ///
6169 /// 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/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.
6170 ///
6171 /// # Arguments
6172 ///
6173 /// * `request` - No description provided.
6174 /// * `spreadsheetId` - The spreadsheet to request.
6175 pub fn get_by_data_filter(
6176 &self,
6177 request: GetSpreadsheetByDataFilterRequest,
6178 spreadsheet_id: &str,
6179 ) -> SpreadsheetGetByDataFilterCall<'a, C> {
6180 SpreadsheetGetByDataFilterCall {
6181 hub: self.hub,
6182 _request: request,
6183 _spreadsheet_id: spreadsheet_id.to_string(),
6184 _delegate: Default::default(),
6185 _additional_params: Default::default(),
6186 _scopes: Default::default(),
6187 }
6188 }
6189}
6190
6191// ###################
6192// CallBuilders ###
6193// #################
6194
6195/// Returns the developer metadata with the specified ID. The caller must specify the spreadsheet ID and the developer metadata's unique metadataId.
6196///
6197/// A builder for the *developerMetadata.get* method supported by a *spreadsheet* resource.
6198/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
6199///
6200/// # Example
6201///
6202/// Instantiate a resource method builder
6203///
6204/// ```test_harness,no_run
6205/// # extern crate hyper;
6206/// # extern crate hyper_rustls;
6207/// # extern crate google_sheets4 as sheets4;
6208/// # async fn dox() {
6209/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6210///
6211/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6212/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
6213/// # secret,
6214/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6215/// # ).build().await.unwrap();
6216///
6217/// # let client = hyper_util::client::legacy::Client::builder(
6218/// # hyper_util::rt::TokioExecutor::new()
6219/// # )
6220/// # .build(
6221/// # hyper_rustls::HttpsConnectorBuilder::new()
6222/// # .with_native_roots()
6223/// # .unwrap()
6224/// # .https_or_http()
6225/// # .enable_http1()
6226/// # .build()
6227/// # );
6228/// # let mut hub = Sheets::new(client, auth);
6229/// // You can configure optional parameters by calling the respective setters at will, and
6230/// // execute the final call using `doit()`.
6231/// // Values shown here are possibly random and not representative !
6232/// let result = hub.spreadsheets().developer_metadata_get("spreadsheetId", -50)
6233/// .doit().await;
6234/// # }
6235/// ```
6236pub struct SpreadsheetDeveloperMetadataGetCall<'a, C>
6237where
6238 C: 'a,
6239{
6240 hub: &'a Sheets<C>,
6241 _spreadsheet_id: String,
6242 _metadata_id: i32,
6243 _delegate: Option<&'a mut dyn common::Delegate>,
6244 _additional_params: HashMap<String, String>,
6245 _scopes: BTreeSet<String>,
6246}
6247
6248impl<'a, C> common::CallBuilder for SpreadsheetDeveloperMetadataGetCall<'a, C> {}
6249
6250impl<'a, C> SpreadsheetDeveloperMetadataGetCall<'a, C>
6251where
6252 C: common::Connector,
6253{
6254 /// Perform the operation you have build so far.
6255 pub async fn doit(mut self) -> common::Result<(common::Response, DeveloperMetadata)> {
6256 use std::borrow::Cow;
6257 use std::io::{Read, Seek};
6258
6259 use common::{url::Params, ToParts};
6260 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6261
6262 let mut dd = common::DefaultDelegate;
6263 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6264 dlg.begin(common::MethodInfo {
6265 id: "sheets.spreadsheets.developerMetadata.get",
6266 http_method: hyper::Method::GET,
6267 });
6268
6269 for &field in ["alt", "spreadsheetId", "metadataId"].iter() {
6270 if self._additional_params.contains_key(field) {
6271 dlg.finished(false);
6272 return Err(common::Error::FieldClash(field));
6273 }
6274 }
6275
6276 let mut params = Params::with_capacity(4 + self._additional_params.len());
6277 params.push("spreadsheetId", self._spreadsheet_id);
6278 params.push("metadataId", self._metadata_id.to_string());
6279
6280 params.extend(self._additional_params.iter());
6281
6282 params.push("alt", "json");
6283 let mut url = self.hub._base_url.clone()
6284 + "v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}";
6285 if self._scopes.is_empty() {
6286 self._scopes.insert(Scope::Drive.as_ref().to_string());
6287 }
6288
6289 #[allow(clippy::single_element_loop)]
6290 for &(find_this, param_name) in [
6291 ("{spreadsheetId}", "spreadsheetId"),
6292 ("{metadataId}", "metadataId"),
6293 ]
6294 .iter()
6295 {
6296 url = params.uri_replacement(url, param_name, find_this, false);
6297 }
6298 {
6299 let to_remove = ["metadataId", "spreadsheetId"];
6300 params.remove_params(&to_remove);
6301 }
6302
6303 let url = params.parse_with_url(&url);
6304
6305 loop {
6306 let token = match self
6307 .hub
6308 .auth
6309 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6310 .await
6311 {
6312 Ok(token) => token,
6313 Err(e) => match dlg.token(e) {
6314 Ok(token) => token,
6315 Err(e) => {
6316 dlg.finished(false);
6317 return Err(common::Error::MissingToken(e));
6318 }
6319 },
6320 };
6321 let mut req_result = {
6322 let client = &self.hub.client;
6323 dlg.pre_request();
6324 let mut req_builder = hyper::Request::builder()
6325 .method(hyper::Method::GET)
6326 .uri(url.as_str())
6327 .header(USER_AGENT, self.hub._user_agent.clone());
6328
6329 if let Some(token) = token.as_ref() {
6330 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6331 }
6332
6333 let request = req_builder
6334 .header(CONTENT_LENGTH, 0_u64)
6335 .body(common::to_body::<String>(None));
6336
6337 client.request(request.unwrap()).await
6338 };
6339
6340 match req_result {
6341 Err(err) => {
6342 if let common::Retry::After(d) = dlg.http_error(&err) {
6343 sleep(d).await;
6344 continue;
6345 }
6346 dlg.finished(false);
6347 return Err(common::Error::HttpError(err));
6348 }
6349 Ok(res) => {
6350 let (mut parts, body) = res.into_parts();
6351 let mut body = common::Body::new(body);
6352 if !parts.status.is_success() {
6353 let bytes = common::to_bytes(body).await.unwrap_or_default();
6354 let error = serde_json::from_str(&common::to_string(&bytes));
6355 let response = common::to_response(parts, bytes.into());
6356
6357 if let common::Retry::After(d) =
6358 dlg.http_failure(&response, error.as_ref().ok())
6359 {
6360 sleep(d).await;
6361 continue;
6362 }
6363
6364 dlg.finished(false);
6365
6366 return Err(match error {
6367 Ok(value) => common::Error::BadRequest(value),
6368 _ => common::Error::Failure(response),
6369 });
6370 }
6371 let response = {
6372 let bytes = common::to_bytes(body).await.unwrap_or_default();
6373 let encoded = common::to_string(&bytes);
6374 match serde_json::from_str(&encoded) {
6375 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6376 Err(error) => {
6377 dlg.response_json_decode_error(&encoded, &error);
6378 return Err(common::Error::JsonDecodeError(
6379 encoded.to_string(),
6380 error,
6381 ));
6382 }
6383 }
6384 };
6385
6386 dlg.finished(true);
6387 return Ok(response);
6388 }
6389 }
6390 }
6391 }
6392
6393 /// The ID of the spreadsheet to retrieve metadata from.
6394 ///
6395 /// Sets the *spreadsheet id* path property to the given value.
6396 ///
6397 /// Even though the property as already been set when instantiating this call,
6398 /// we provide this method for API completeness.
6399 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetDeveloperMetadataGetCall<'a, C> {
6400 self._spreadsheet_id = new_value.to_string();
6401 self
6402 }
6403 /// The ID of the developer metadata to retrieve.
6404 ///
6405 /// Sets the *metadata id* path property to the given value.
6406 ///
6407 /// Even though the property as already been set when instantiating this call,
6408 /// we provide this method for API completeness.
6409 pub fn metadata_id(mut self, new_value: i32) -> SpreadsheetDeveloperMetadataGetCall<'a, C> {
6410 self._metadata_id = new_value;
6411 self
6412 }
6413 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6414 /// while executing the actual API request.
6415 ///
6416 /// ````text
6417 /// It should be used to handle progress information, and to implement a certain level of resilience.
6418 /// ````
6419 ///
6420 /// Sets the *delegate* property to the given value.
6421 pub fn delegate(
6422 mut self,
6423 new_value: &'a mut dyn common::Delegate,
6424 ) -> SpreadsheetDeveloperMetadataGetCall<'a, C> {
6425 self._delegate = Some(new_value);
6426 self
6427 }
6428
6429 /// Set any additional parameter of the query string used in the request.
6430 /// It should be used to set parameters which are not yet available through their own
6431 /// setters.
6432 ///
6433 /// Please note that this method must not be used to set any of the known parameters
6434 /// which have their own setter method. If done anyway, the request will fail.
6435 ///
6436 /// # Additional Parameters
6437 ///
6438 /// * *$.xgafv* (query-string) - V1 error format.
6439 /// * *access_token* (query-string) - OAuth access token.
6440 /// * *alt* (query-string) - Data format for response.
6441 /// * *callback* (query-string) - JSONP
6442 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6443 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6444 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6445 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6446 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6447 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6448 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6449 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetDeveloperMetadataGetCall<'a, C>
6450 where
6451 T: AsRef<str>,
6452 {
6453 self._additional_params
6454 .insert(name.as_ref().to_string(), value.as_ref().to_string());
6455 self
6456 }
6457
6458 /// Identifies the authorization scope for the method you are building.
6459 ///
6460 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6461 /// [`Scope::Drive`].
6462 ///
6463 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6464 /// tokens for more than one scope.
6465 ///
6466 /// Usually there is more than one suitable scope to authorize an operation, some of which may
6467 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6468 /// sufficient, a read-write scope will do as well.
6469 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetDeveloperMetadataGetCall<'a, C>
6470 where
6471 St: AsRef<str>,
6472 {
6473 self._scopes.insert(String::from(scope.as_ref()));
6474 self
6475 }
6476 /// Identifies the authorization scope(s) for the method you are building.
6477 ///
6478 /// See [`Self::add_scope()`] for details.
6479 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetDeveloperMetadataGetCall<'a, C>
6480 where
6481 I: IntoIterator<Item = St>,
6482 St: AsRef<str>,
6483 {
6484 self._scopes
6485 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6486 self
6487 }
6488
6489 /// Removes all scopes, and no default scope will be used either.
6490 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6491 /// for details).
6492 pub fn clear_scopes(mut self) -> SpreadsheetDeveloperMetadataGetCall<'a, C> {
6493 self._scopes.clear();
6494 self
6495 }
6496}
6497
6498/// 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.
6499///
6500/// A builder for the *developerMetadata.search* method supported by a *spreadsheet* resource.
6501/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
6502///
6503/// # Example
6504///
6505/// Instantiate a resource method builder
6506///
6507/// ```test_harness,no_run
6508/// # extern crate hyper;
6509/// # extern crate hyper_rustls;
6510/// # extern crate google_sheets4 as sheets4;
6511/// use sheets4::api::SearchDeveloperMetadataRequest;
6512/// # async fn dox() {
6513/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6514///
6515/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6516/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
6517/// # secret,
6518/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6519/// # ).build().await.unwrap();
6520///
6521/// # let client = hyper_util::client::legacy::Client::builder(
6522/// # hyper_util::rt::TokioExecutor::new()
6523/// # )
6524/// # .build(
6525/// # hyper_rustls::HttpsConnectorBuilder::new()
6526/// # .with_native_roots()
6527/// # .unwrap()
6528/// # .https_or_http()
6529/// # .enable_http1()
6530/// # .build()
6531/// # );
6532/// # let mut hub = Sheets::new(client, auth);
6533/// // As the method needs a request, you would usually fill it with the desired information
6534/// // into the respective structure. Some of the parts shown here might not be applicable !
6535/// // Values shown here are possibly random and not representative !
6536/// let mut req = SearchDeveloperMetadataRequest::default();
6537///
6538/// // You can configure optional parameters by calling the respective setters at will, and
6539/// // execute the final call using `doit()`.
6540/// // Values shown here are possibly random and not representative !
6541/// let result = hub.spreadsheets().developer_metadata_search(req, "spreadsheetId")
6542/// .doit().await;
6543/// # }
6544/// ```
6545pub struct SpreadsheetDeveloperMetadataSearchCall<'a, C>
6546where
6547 C: 'a,
6548{
6549 hub: &'a Sheets<C>,
6550 _request: SearchDeveloperMetadataRequest,
6551 _spreadsheet_id: String,
6552 _delegate: Option<&'a mut dyn common::Delegate>,
6553 _additional_params: HashMap<String, String>,
6554 _scopes: BTreeSet<String>,
6555}
6556
6557impl<'a, C> common::CallBuilder for SpreadsheetDeveloperMetadataSearchCall<'a, C> {}
6558
6559impl<'a, C> SpreadsheetDeveloperMetadataSearchCall<'a, C>
6560where
6561 C: common::Connector,
6562{
6563 /// Perform the operation you have build so far.
6564 pub async fn doit(
6565 mut self,
6566 ) -> common::Result<(common::Response, SearchDeveloperMetadataResponse)> {
6567 use std::borrow::Cow;
6568 use std::io::{Read, Seek};
6569
6570 use common::{url::Params, ToParts};
6571 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6572
6573 let mut dd = common::DefaultDelegate;
6574 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6575 dlg.begin(common::MethodInfo {
6576 id: "sheets.spreadsheets.developerMetadata.search",
6577 http_method: hyper::Method::POST,
6578 });
6579
6580 for &field in ["alt", "spreadsheetId"].iter() {
6581 if self._additional_params.contains_key(field) {
6582 dlg.finished(false);
6583 return Err(common::Error::FieldClash(field));
6584 }
6585 }
6586
6587 let mut params = Params::with_capacity(4 + self._additional_params.len());
6588 params.push("spreadsheetId", self._spreadsheet_id);
6589
6590 params.extend(self._additional_params.iter());
6591
6592 params.push("alt", "json");
6593 let mut url =
6594 self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}/developerMetadata:search";
6595 if self._scopes.is_empty() {
6596 self._scopes.insert(Scope::Drive.as_ref().to_string());
6597 }
6598
6599 #[allow(clippy::single_element_loop)]
6600 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
6601 url = params.uri_replacement(url, param_name, find_this, false);
6602 }
6603 {
6604 let to_remove = ["spreadsheetId"];
6605 params.remove_params(&to_remove);
6606 }
6607
6608 let url = params.parse_with_url(&url);
6609
6610 let mut json_mime_type = mime::APPLICATION_JSON;
6611 let mut request_value_reader = {
6612 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
6613 common::remove_json_null_values(&mut value);
6614 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
6615 serde_json::to_writer(&mut dst, &value).unwrap();
6616 dst
6617 };
6618 let request_size = request_value_reader
6619 .seek(std::io::SeekFrom::End(0))
6620 .unwrap();
6621 request_value_reader
6622 .seek(std::io::SeekFrom::Start(0))
6623 .unwrap();
6624
6625 loop {
6626 let token = match self
6627 .hub
6628 .auth
6629 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6630 .await
6631 {
6632 Ok(token) => token,
6633 Err(e) => match dlg.token(e) {
6634 Ok(token) => token,
6635 Err(e) => {
6636 dlg.finished(false);
6637 return Err(common::Error::MissingToken(e));
6638 }
6639 },
6640 };
6641 request_value_reader
6642 .seek(std::io::SeekFrom::Start(0))
6643 .unwrap();
6644 let mut req_result = {
6645 let client = &self.hub.client;
6646 dlg.pre_request();
6647 let mut req_builder = hyper::Request::builder()
6648 .method(hyper::Method::POST)
6649 .uri(url.as_str())
6650 .header(USER_AGENT, self.hub._user_agent.clone());
6651
6652 if let Some(token) = token.as_ref() {
6653 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6654 }
6655
6656 let request = req_builder
6657 .header(CONTENT_TYPE, json_mime_type.to_string())
6658 .header(CONTENT_LENGTH, request_size as u64)
6659 .body(common::to_body(
6660 request_value_reader.get_ref().clone().into(),
6661 ));
6662
6663 client.request(request.unwrap()).await
6664 };
6665
6666 match req_result {
6667 Err(err) => {
6668 if let common::Retry::After(d) = dlg.http_error(&err) {
6669 sleep(d).await;
6670 continue;
6671 }
6672 dlg.finished(false);
6673 return Err(common::Error::HttpError(err));
6674 }
6675 Ok(res) => {
6676 let (mut parts, body) = res.into_parts();
6677 let mut body = common::Body::new(body);
6678 if !parts.status.is_success() {
6679 let bytes = common::to_bytes(body).await.unwrap_or_default();
6680 let error = serde_json::from_str(&common::to_string(&bytes));
6681 let response = common::to_response(parts, bytes.into());
6682
6683 if let common::Retry::After(d) =
6684 dlg.http_failure(&response, error.as_ref().ok())
6685 {
6686 sleep(d).await;
6687 continue;
6688 }
6689
6690 dlg.finished(false);
6691
6692 return Err(match error {
6693 Ok(value) => common::Error::BadRequest(value),
6694 _ => common::Error::Failure(response),
6695 });
6696 }
6697 let response = {
6698 let bytes = common::to_bytes(body).await.unwrap_or_default();
6699 let encoded = common::to_string(&bytes);
6700 match serde_json::from_str(&encoded) {
6701 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6702 Err(error) => {
6703 dlg.response_json_decode_error(&encoded, &error);
6704 return Err(common::Error::JsonDecodeError(
6705 encoded.to_string(),
6706 error,
6707 ));
6708 }
6709 }
6710 };
6711
6712 dlg.finished(true);
6713 return Ok(response);
6714 }
6715 }
6716 }
6717 }
6718
6719 ///
6720 /// Sets the *request* property to the given value.
6721 ///
6722 /// Even though the property as already been set when instantiating this call,
6723 /// we provide this method for API completeness.
6724 pub fn request(
6725 mut self,
6726 new_value: SearchDeveloperMetadataRequest,
6727 ) -> SpreadsheetDeveloperMetadataSearchCall<'a, C> {
6728 self._request = new_value;
6729 self
6730 }
6731 /// The ID of the spreadsheet to retrieve metadata from.
6732 ///
6733 /// Sets the *spreadsheet id* path property to the given value.
6734 ///
6735 /// Even though the property as already been set when instantiating this call,
6736 /// we provide this method for API completeness.
6737 pub fn spreadsheet_id(
6738 mut self,
6739 new_value: &str,
6740 ) -> SpreadsheetDeveloperMetadataSearchCall<'a, C> {
6741 self._spreadsheet_id = new_value.to_string();
6742 self
6743 }
6744 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6745 /// while executing the actual API request.
6746 ///
6747 /// ````text
6748 /// It should be used to handle progress information, and to implement a certain level of resilience.
6749 /// ````
6750 ///
6751 /// Sets the *delegate* property to the given value.
6752 pub fn delegate(
6753 mut self,
6754 new_value: &'a mut dyn common::Delegate,
6755 ) -> SpreadsheetDeveloperMetadataSearchCall<'a, C> {
6756 self._delegate = Some(new_value);
6757 self
6758 }
6759
6760 /// Set any additional parameter of the query string used in the request.
6761 /// It should be used to set parameters which are not yet available through their own
6762 /// setters.
6763 ///
6764 /// Please note that this method must not be used to set any of the known parameters
6765 /// which have their own setter method. If done anyway, the request will fail.
6766 ///
6767 /// # Additional Parameters
6768 ///
6769 /// * *$.xgafv* (query-string) - V1 error format.
6770 /// * *access_token* (query-string) - OAuth access token.
6771 /// * *alt* (query-string) - Data format for response.
6772 /// * *callback* (query-string) - JSONP
6773 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6774 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6775 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6776 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6777 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6778 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6779 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6780 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetDeveloperMetadataSearchCall<'a, C>
6781 where
6782 T: AsRef<str>,
6783 {
6784 self._additional_params
6785 .insert(name.as_ref().to_string(), value.as_ref().to_string());
6786 self
6787 }
6788
6789 /// Identifies the authorization scope for the method you are building.
6790 ///
6791 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6792 /// [`Scope::Drive`].
6793 ///
6794 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6795 /// tokens for more than one scope.
6796 ///
6797 /// Usually there is more than one suitable scope to authorize an operation, some of which may
6798 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6799 /// sufficient, a read-write scope will do as well.
6800 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetDeveloperMetadataSearchCall<'a, C>
6801 where
6802 St: AsRef<str>,
6803 {
6804 self._scopes.insert(String::from(scope.as_ref()));
6805 self
6806 }
6807 /// Identifies the authorization scope(s) for the method you are building.
6808 ///
6809 /// See [`Self::add_scope()`] for details.
6810 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetDeveloperMetadataSearchCall<'a, C>
6811 where
6812 I: IntoIterator<Item = St>,
6813 St: AsRef<str>,
6814 {
6815 self._scopes
6816 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6817 self
6818 }
6819
6820 /// Removes all scopes, and no default scope will be used either.
6821 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6822 /// for details).
6823 pub fn clear_scopes(mut self) -> SpreadsheetDeveloperMetadataSearchCall<'a, C> {
6824 self._scopes.clear();
6825 self
6826 }
6827}
6828
6829/// Copies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.
6830///
6831/// A builder for the *sheets.copyTo* method supported by a *spreadsheet* resource.
6832/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
6833///
6834/// # Example
6835///
6836/// Instantiate a resource method builder
6837///
6838/// ```test_harness,no_run
6839/// # extern crate hyper;
6840/// # extern crate hyper_rustls;
6841/// # extern crate google_sheets4 as sheets4;
6842/// use sheets4::api::CopySheetToAnotherSpreadsheetRequest;
6843/// # async fn dox() {
6844/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6845///
6846/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6847/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
6848/// # secret,
6849/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6850/// # ).build().await.unwrap();
6851///
6852/// # let client = hyper_util::client::legacy::Client::builder(
6853/// # hyper_util::rt::TokioExecutor::new()
6854/// # )
6855/// # .build(
6856/// # hyper_rustls::HttpsConnectorBuilder::new()
6857/// # .with_native_roots()
6858/// # .unwrap()
6859/// # .https_or_http()
6860/// # .enable_http1()
6861/// # .build()
6862/// # );
6863/// # let mut hub = Sheets::new(client, auth);
6864/// // As the method needs a request, you would usually fill it with the desired information
6865/// // into the respective structure. Some of the parts shown here might not be applicable !
6866/// // Values shown here are possibly random and not representative !
6867/// let mut req = CopySheetToAnotherSpreadsheetRequest::default();
6868///
6869/// // You can configure optional parameters by calling the respective setters at will, and
6870/// // execute the final call using `doit()`.
6871/// // Values shown here are possibly random and not representative !
6872/// let result = hub.spreadsheets().sheets_copy_to(req, "spreadsheetId", -12)
6873/// .doit().await;
6874/// # }
6875/// ```
6876pub struct SpreadsheetSheetCopyToCall<'a, C>
6877where
6878 C: 'a,
6879{
6880 hub: &'a Sheets<C>,
6881 _request: CopySheetToAnotherSpreadsheetRequest,
6882 _spreadsheet_id: String,
6883 _sheet_id: i32,
6884 _delegate: Option<&'a mut dyn common::Delegate>,
6885 _additional_params: HashMap<String, String>,
6886 _scopes: BTreeSet<String>,
6887}
6888
6889impl<'a, C> common::CallBuilder for SpreadsheetSheetCopyToCall<'a, C> {}
6890
6891impl<'a, C> SpreadsheetSheetCopyToCall<'a, C>
6892where
6893 C: common::Connector,
6894{
6895 /// Perform the operation you have build so far.
6896 pub async fn doit(mut self) -> common::Result<(common::Response, SheetProperties)> {
6897 use std::borrow::Cow;
6898 use std::io::{Read, Seek};
6899
6900 use common::{url::Params, ToParts};
6901 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6902
6903 let mut dd = common::DefaultDelegate;
6904 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6905 dlg.begin(common::MethodInfo {
6906 id: "sheets.spreadsheets.sheets.copyTo",
6907 http_method: hyper::Method::POST,
6908 });
6909
6910 for &field in ["alt", "spreadsheetId", "sheetId"].iter() {
6911 if self._additional_params.contains_key(field) {
6912 dlg.finished(false);
6913 return Err(common::Error::FieldClash(field));
6914 }
6915 }
6916
6917 let mut params = Params::with_capacity(5 + self._additional_params.len());
6918 params.push("spreadsheetId", self._spreadsheet_id);
6919 params.push("sheetId", self._sheet_id.to_string());
6920
6921 params.extend(self._additional_params.iter());
6922
6923 params.push("alt", "json");
6924 let mut url =
6925 self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo";
6926 if self._scopes.is_empty() {
6927 self._scopes.insert(Scope::Drive.as_ref().to_string());
6928 }
6929
6930 #[allow(clippy::single_element_loop)]
6931 for &(find_this, param_name) in [
6932 ("{spreadsheetId}", "spreadsheetId"),
6933 ("{sheetId}", "sheetId"),
6934 ]
6935 .iter()
6936 {
6937 url = params.uri_replacement(url, param_name, find_this, false);
6938 }
6939 {
6940 let to_remove = ["sheetId", "spreadsheetId"];
6941 params.remove_params(&to_remove);
6942 }
6943
6944 let url = params.parse_with_url(&url);
6945
6946 let mut json_mime_type = mime::APPLICATION_JSON;
6947 let mut request_value_reader = {
6948 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
6949 common::remove_json_null_values(&mut value);
6950 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
6951 serde_json::to_writer(&mut dst, &value).unwrap();
6952 dst
6953 };
6954 let request_size = request_value_reader
6955 .seek(std::io::SeekFrom::End(0))
6956 .unwrap();
6957 request_value_reader
6958 .seek(std::io::SeekFrom::Start(0))
6959 .unwrap();
6960
6961 loop {
6962 let token = match self
6963 .hub
6964 .auth
6965 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6966 .await
6967 {
6968 Ok(token) => token,
6969 Err(e) => match dlg.token(e) {
6970 Ok(token) => token,
6971 Err(e) => {
6972 dlg.finished(false);
6973 return Err(common::Error::MissingToken(e));
6974 }
6975 },
6976 };
6977 request_value_reader
6978 .seek(std::io::SeekFrom::Start(0))
6979 .unwrap();
6980 let mut req_result = {
6981 let client = &self.hub.client;
6982 dlg.pre_request();
6983 let mut req_builder = hyper::Request::builder()
6984 .method(hyper::Method::POST)
6985 .uri(url.as_str())
6986 .header(USER_AGENT, self.hub._user_agent.clone());
6987
6988 if let Some(token) = token.as_ref() {
6989 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6990 }
6991
6992 let request = req_builder
6993 .header(CONTENT_TYPE, json_mime_type.to_string())
6994 .header(CONTENT_LENGTH, request_size as u64)
6995 .body(common::to_body(
6996 request_value_reader.get_ref().clone().into(),
6997 ));
6998
6999 client.request(request.unwrap()).await
7000 };
7001
7002 match req_result {
7003 Err(err) => {
7004 if let common::Retry::After(d) = dlg.http_error(&err) {
7005 sleep(d).await;
7006 continue;
7007 }
7008 dlg.finished(false);
7009 return Err(common::Error::HttpError(err));
7010 }
7011 Ok(res) => {
7012 let (mut parts, body) = res.into_parts();
7013 let mut body = common::Body::new(body);
7014 if !parts.status.is_success() {
7015 let bytes = common::to_bytes(body).await.unwrap_or_default();
7016 let error = serde_json::from_str(&common::to_string(&bytes));
7017 let response = common::to_response(parts, bytes.into());
7018
7019 if let common::Retry::After(d) =
7020 dlg.http_failure(&response, error.as_ref().ok())
7021 {
7022 sleep(d).await;
7023 continue;
7024 }
7025
7026 dlg.finished(false);
7027
7028 return Err(match error {
7029 Ok(value) => common::Error::BadRequest(value),
7030 _ => common::Error::Failure(response),
7031 });
7032 }
7033 let response = {
7034 let bytes = common::to_bytes(body).await.unwrap_or_default();
7035 let encoded = common::to_string(&bytes);
7036 match serde_json::from_str(&encoded) {
7037 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7038 Err(error) => {
7039 dlg.response_json_decode_error(&encoded, &error);
7040 return Err(common::Error::JsonDecodeError(
7041 encoded.to_string(),
7042 error,
7043 ));
7044 }
7045 }
7046 };
7047
7048 dlg.finished(true);
7049 return Ok(response);
7050 }
7051 }
7052 }
7053 }
7054
7055 ///
7056 /// Sets the *request* property to the given value.
7057 ///
7058 /// Even though the property as already been set when instantiating this call,
7059 /// we provide this method for API completeness.
7060 pub fn request(
7061 mut self,
7062 new_value: CopySheetToAnotherSpreadsheetRequest,
7063 ) -> SpreadsheetSheetCopyToCall<'a, C> {
7064 self._request = new_value;
7065 self
7066 }
7067 /// The ID of the spreadsheet containing the sheet to copy.
7068 ///
7069 /// Sets the *spreadsheet id* path property to the given value.
7070 ///
7071 /// Even though the property as already been set when instantiating this call,
7072 /// we provide this method for API completeness.
7073 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetSheetCopyToCall<'a, C> {
7074 self._spreadsheet_id = new_value.to_string();
7075 self
7076 }
7077 /// The ID of the sheet to copy.
7078 ///
7079 /// Sets the *sheet id* path property to the given value.
7080 ///
7081 /// Even though the property as already been set when instantiating this call,
7082 /// we provide this method for API completeness.
7083 pub fn sheet_id(mut self, new_value: i32) -> SpreadsheetSheetCopyToCall<'a, C> {
7084 self._sheet_id = new_value;
7085 self
7086 }
7087 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7088 /// while executing the actual API request.
7089 ///
7090 /// ````text
7091 /// It should be used to handle progress information, and to implement a certain level of resilience.
7092 /// ````
7093 ///
7094 /// Sets the *delegate* property to the given value.
7095 pub fn delegate(
7096 mut self,
7097 new_value: &'a mut dyn common::Delegate,
7098 ) -> SpreadsheetSheetCopyToCall<'a, C> {
7099 self._delegate = Some(new_value);
7100 self
7101 }
7102
7103 /// Set any additional parameter of the query string used in the request.
7104 /// It should be used to set parameters which are not yet available through their own
7105 /// setters.
7106 ///
7107 /// Please note that this method must not be used to set any of the known parameters
7108 /// which have their own setter method. If done anyway, the request will fail.
7109 ///
7110 /// # Additional Parameters
7111 ///
7112 /// * *$.xgafv* (query-string) - V1 error format.
7113 /// * *access_token* (query-string) - OAuth access token.
7114 /// * *alt* (query-string) - Data format for response.
7115 /// * *callback* (query-string) - JSONP
7116 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7117 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7118 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7119 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7120 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7121 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7122 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7123 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetSheetCopyToCall<'a, C>
7124 where
7125 T: AsRef<str>,
7126 {
7127 self._additional_params
7128 .insert(name.as_ref().to_string(), value.as_ref().to_string());
7129 self
7130 }
7131
7132 /// Identifies the authorization scope for the method you are building.
7133 ///
7134 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7135 /// [`Scope::Drive`].
7136 ///
7137 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7138 /// tokens for more than one scope.
7139 ///
7140 /// Usually there is more than one suitable scope to authorize an operation, some of which may
7141 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7142 /// sufficient, a read-write scope will do as well.
7143 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetSheetCopyToCall<'a, C>
7144 where
7145 St: AsRef<str>,
7146 {
7147 self._scopes.insert(String::from(scope.as_ref()));
7148 self
7149 }
7150 /// Identifies the authorization scope(s) for the method you are building.
7151 ///
7152 /// See [`Self::add_scope()`] for details.
7153 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetSheetCopyToCall<'a, C>
7154 where
7155 I: IntoIterator<Item = St>,
7156 St: AsRef<str>,
7157 {
7158 self._scopes
7159 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7160 self
7161 }
7162
7163 /// Removes all scopes, and no default scope will be used either.
7164 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7165 /// for details).
7166 pub fn clear_scopes(mut self) -> SpreadsheetSheetCopyToCall<'a, C> {
7167 self._scopes.clear();
7168 self
7169 }
7170}
7171
7172/// 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/sheets/api/guides/values#appending_values) and [sample code](https://developers.google.com/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.
7173///
7174/// A builder for the *values.append* method supported by a *spreadsheet* resource.
7175/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
7176///
7177/// # Example
7178///
7179/// Instantiate a resource method builder
7180///
7181/// ```test_harness,no_run
7182/// # extern crate hyper;
7183/// # extern crate hyper_rustls;
7184/// # extern crate google_sheets4 as sheets4;
7185/// use sheets4::api::ValueRange;
7186/// # async fn dox() {
7187/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7188///
7189/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7190/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
7191/// # secret,
7192/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7193/// # ).build().await.unwrap();
7194///
7195/// # let client = hyper_util::client::legacy::Client::builder(
7196/// # hyper_util::rt::TokioExecutor::new()
7197/// # )
7198/// # .build(
7199/// # hyper_rustls::HttpsConnectorBuilder::new()
7200/// # .with_native_roots()
7201/// # .unwrap()
7202/// # .https_or_http()
7203/// # .enable_http1()
7204/// # .build()
7205/// # );
7206/// # let mut hub = Sheets::new(client, auth);
7207/// // As the method needs a request, you would usually fill it with the desired information
7208/// // into the respective structure. Some of the parts shown here might not be applicable !
7209/// // Values shown here are possibly random and not representative !
7210/// let mut req = ValueRange::default();
7211///
7212/// // You can configure optional parameters by calling the respective setters at will, and
7213/// // execute the final call using `doit()`.
7214/// // Values shown here are possibly random and not representative !
7215/// let result = hub.spreadsheets().values_append(req, "spreadsheetId", "range")
7216/// .value_input_option("ipsum")
7217/// .response_value_render_option("ipsum")
7218/// .response_date_time_render_option("est")
7219/// .insert_data_option("gubergren")
7220/// .include_values_in_response(false)
7221/// .doit().await;
7222/// # }
7223/// ```
7224pub struct SpreadsheetValueAppendCall<'a, C>
7225where
7226 C: 'a,
7227{
7228 hub: &'a Sheets<C>,
7229 _request: ValueRange,
7230 _spreadsheet_id: String,
7231 _range: String,
7232 _value_input_option: Option<String>,
7233 _response_value_render_option: Option<String>,
7234 _response_date_time_render_option: Option<String>,
7235 _insert_data_option: Option<String>,
7236 _include_values_in_response: Option<bool>,
7237 _delegate: Option<&'a mut dyn common::Delegate>,
7238 _additional_params: HashMap<String, String>,
7239 _scopes: BTreeSet<String>,
7240}
7241
7242impl<'a, C> common::CallBuilder for SpreadsheetValueAppendCall<'a, C> {}
7243
7244impl<'a, C> SpreadsheetValueAppendCall<'a, C>
7245where
7246 C: common::Connector,
7247{
7248 /// Perform the operation you have build so far.
7249 pub async fn doit(mut self) -> common::Result<(common::Response, AppendValuesResponse)> {
7250 use std::borrow::Cow;
7251 use std::io::{Read, Seek};
7252
7253 use common::{url::Params, ToParts};
7254 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7255
7256 let mut dd = common::DefaultDelegate;
7257 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7258 dlg.begin(common::MethodInfo {
7259 id: "sheets.spreadsheets.values.append",
7260 http_method: hyper::Method::POST,
7261 });
7262
7263 for &field in [
7264 "alt",
7265 "spreadsheetId",
7266 "range",
7267 "valueInputOption",
7268 "responseValueRenderOption",
7269 "responseDateTimeRenderOption",
7270 "insertDataOption",
7271 "includeValuesInResponse",
7272 ]
7273 .iter()
7274 {
7275 if self._additional_params.contains_key(field) {
7276 dlg.finished(false);
7277 return Err(common::Error::FieldClash(field));
7278 }
7279 }
7280
7281 let mut params = Params::with_capacity(10 + self._additional_params.len());
7282 params.push("spreadsheetId", self._spreadsheet_id);
7283 params.push("range", self._range);
7284 if let Some(value) = self._value_input_option.as_ref() {
7285 params.push("valueInputOption", value);
7286 }
7287 if let Some(value) = self._response_value_render_option.as_ref() {
7288 params.push("responseValueRenderOption", value);
7289 }
7290 if let Some(value) = self._response_date_time_render_option.as_ref() {
7291 params.push("responseDateTimeRenderOption", value);
7292 }
7293 if let Some(value) = self._insert_data_option.as_ref() {
7294 params.push("insertDataOption", value);
7295 }
7296 if let Some(value) = self._include_values_in_response.as_ref() {
7297 params.push("includeValuesInResponse", value.to_string());
7298 }
7299
7300 params.extend(self._additional_params.iter());
7301
7302 params.push("alt", "json");
7303 let mut url =
7304 self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}/values/{range}:append";
7305 if self._scopes.is_empty() {
7306 self._scopes.insert(Scope::Drive.as_ref().to_string());
7307 }
7308
7309 #[allow(clippy::single_element_loop)]
7310 for &(find_this, param_name) in
7311 [("{spreadsheetId}", "spreadsheetId"), ("{range}", "range")].iter()
7312 {
7313 url = params.uri_replacement(url, param_name, find_this, false);
7314 }
7315 {
7316 let to_remove = ["range", "spreadsheetId"];
7317 params.remove_params(&to_remove);
7318 }
7319
7320 let url = params.parse_with_url(&url);
7321
7322 let mut json_mime_type = mime::APPLICATION_JSON;
7323 let mut request_value_reader = {
7324 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
7325 common::remove_json_null_values(&mut value);
7326 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
7327 serde_json::to_writer(&mut dst, &value).unwrap();
7328 dst
7329 };
7330 let request_size = request_value_reader
7331 .seek(std::io::SeekFrom::End(0))
7332 .unwrap();
7333 request_value_reader
7334 .seek(std::io::SeekFrom::Start(0))
7335 .unwrap();
7336
7337 loop {
7338 let token = match self
7339 .hub
7340 .auth
7341 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
7342 .await
7343 {
7344 Ok(token) => token,
7345 Err(e) => match dlg.token(e) {
7346 Ok(token) => token,
7347 Err(e) => {
7348 dlg.finished(false);
7349 return Err(common::Error::MissingToken(e));
7350 }
7351 },
7352 };
7353 request_value_reader
7354 .seek(std::io::SeekFrom::Start(0))
7355 .unwrap();
7356 let mut req_result = {
7357 let client = &self.hub.client;
7358 dlg.pre_request();
7359 let mut req_builder = hyper::Request::builder()
7360 .method(hyper::Method::POST)
7361 .uri(url.as_str())
7362 .header(USER_AGENT, self.hub._user_agent.clone());
7363
7364 if let Some(token) = token.as_ref() {
7365 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7366 }
7367
7368 let request = req_builder
7369 .header(CONTENT_TYPE, json_mime_type.to_string())
7370 .header(CONTENT_LENGTH, request_size as u64)
7371 .body(common::to_body(
7372 request_value_reader.get_ref().clone().into(),
7373 ));
7374
7375 client.request(request.unwrap()).await
7376 };
7377
7378 match req_result {
7379 Err(err) => {
7380 if let common::Retry::After(d) = dlg.http_error(&err) {
7381 sleep(d).await;
7382 continue;
7383 }
7384 dlg.finished(false);
7385 return Err(common::Error::HttpError(err));
7386 }
7387 Ok(res) => {
7388 let (mut parts, body) = res.into_parts();
7389 let mut body = common::Body::new(body);
7390 if !parts.status.is_success() {
7391 let bytes = common::to_bytes(body).await.unwrap_or_default();
7392 let error = serde_json::from_str(&common::to_string(&bytes));
7393 let response = common::to_response(parts, bytes.into());
7394
7395 if let common::Retry::After(d) =
7396 dlg.http_failure(&response, error.as_ref().ok())
7397 {
7398 sleep(d).await;
7399 continue;
7400 }
7401
7402 dlg.finished(false);
7403
7404 return Err(match error {
7405 Ok(value) => common::Error::BadRequest(value),
7406 _ => common::Error::Failure(response),
7407 });
7408 }
7409 let response = {
7410 let bytes = common::to_bytes(body).await.unwrap_or_default();
7411 let encoded = common::to_string(&bytes);
7412 match serde_json::from_str(&encoded) {
7413 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7414 Err(error) => {
7415 dlg.response_json_decode_error(&encoded, &error);
7416 return Err(common::Error::JsonDecodeError(
7417 encoded.to_string(),
7418 error,
7419 ));
7420 }
7421 }
7422 };
7423
7424 dlg.finished(true);
7425 return Ok(response);
7426 }
7427 }
7428 }
7429 }
7430
7431 ///
7432 /// Sets the *request* property to the given value.
7433 ///
7434 /// Even though the property as already been set when instantiating this call,
7435 /// we provide this method for API completeness.
7436 pub fn request(mut self, new_value: ValueRange) -> SpreadsheetValueAppendCall<'a, C> {
7437 self._request = new_value;
7438 self
7439 }
7440 /// The ID of the spreadsheet to update.
7441 ///
7442 /// Sets the *spreadsheet id* path property to the given value.
7443 ///
7444 /// Even though the property as already been set when instantiating this call,
7445 /// we provide this method for API completeness.
7446 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetValueAppendCall<'a, C> {
7447 self._spreadsheet_id = new_value.to_string();
7448 self
7449 }
7450 /// The [A1 notation](https://developers.google.com/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.
7451 ///
7452 /// Sets the *range* path property to the given value.
7453 ///
7454 /// Even though the property as already been set when instantiating this call,
7455 /// we provide this method for API completeness.
7456 pub fn range(mut self, new_value: &str) -> SpreadsheetValueAppendCall<'a, C> {
7457 self._range = new_value.to_string();
7458 self
7459 }
7460 /// How the input data should be interpreted.
7461 ///
7462 /// Sets the *value input option* query property to the given value.
7463 pub fn value_input_option(mut self, new_value: &str) -> SpreadsheetValueAppendCall<'a, C> {
7464 self._value_input_option = Some(new_value.to_string());
7465 self
7466 }
7467 /// Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
7468 ///
7469 /// Sets the *response value render option* query property to the given value.
7470 pub fn response_value_render_option(
7471 mut self,
7472 new_value: &str,
7473 ) -> SpreadsheetValueAppendCall<'a, C> {
7474 self._response_value_render_option = Some(new_value.to_string());
7475 self
7476 }
7477 /// 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.
7478 ///
7479 /// Sets the *response date time render option* query property to the given value.
7480 pub fn response_date_time_render_option(
7481 mut self,
7482 new_value: &str,
7483 ) -> SpreadsheetValueAppendCall<'a, C> {
7484 self._response_date_time_render_option = Some(new_value.to_string());
7485 self
7486 }
7487 /// How the input data should be inserted.
7488 ///
7489 /// Sets the *insert data option* query property to the given value.
7490 pub fn insert_data_option(mut self, new_value: &str) -> SpreadsheetValueAppendCall<'a, C> {
7491 self._insert_data_option = Some(new_value.to_string());
7492 self
7493 }
7494 /// Determines if the update response should include the values of the cells that were appended. By default, responses do not include the updated values.
7495 ///
7496 /// Sets the *include values in response* query property to the given value.
7497 pub fn include_values_in_response(
7498 mut self,
7499 new_value: bool,
7500 ) -> SpreadsheetValueAppendCall<'a, C> {
7501 self._include_values_in_response = Some(new_value);
7502 self
7503 }
7504 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7505 /// while executing the actual API request.
7506 ///
7507 /// ````text
7508 /// It should be used to handle progress information, and to implement a certain level of resilience.
7509 /// ````
7510 ///
7511 /// Sets the *delegate* property to the given value.
7512 pub fn delegate(
7513 mut self,
7514 new_value: &'a mut dyn common::Delegate,
7515 ) -> SpreadsheetValueAppendCall<'a, C> {
7516 self._delegate = Some(new_value);
7517 self
7518 }
7519
7520 /// Set any additional parameter of the query string used in the request.
7521 /// It should be used to set parameters which are not yet available through their own
7522 /// setters.
7523 ///
7524 /// Please note that this method must not be used to set any of the known parameters
7525 /// which have their own setter method. If done anyway, the request will fail.
7526 ///
7527 /// # Additional Parameters
7528 ///
7529 /// * *$.xgafv* (query-string) - V1 error format.
7530 /// * *access_token* (query-string) - OAuth access token.
7531 /// * *alt* (query-string) - Data format for response.
7532 /// * *callback* (query-string) - JSONP
7533 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7534 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7535 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7536 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7537 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7538 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7539 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7540 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetValueAppendCall<'a, C>
7541 where
7542 T: AsRef<str>,
7543 {
7544 self._additional_params
7545 .insert(name.as_ref().to_string(), value.as_ref().to_string());
7546 self
7547 }
7548
7549 /// Identifies the authorization scope for the method you are building.
7550 ///
7551 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7552 /// [`Scope::Drive`].
7553 ///
7554 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7555 /// tokens for more than one scope.
7556 ///
7557 /// Usually there is more than one suitable scope to authorize an operation, some of which may
7558 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7559 /// sufficient, a read-write scope will do as well.
7560 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueAppendCall<'a, C>
7561 where
7562 St: AsRef<str>,
7563 {
7564 self._scopes.insert(String::from(scope.as_ref()));
7565 self
7566 }
7567 /// Identifies the authorization scope(s) for the method you are building.
7568 ///
7569 /// See [`Self::add_scope()`] for details.
7570 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetValueAppendCall<'a, C>
7571 where
7572 I: IntoIterator<Item = St>,
7573 St: AsRef<str>,
7574 {
7575 self._scopes
7576 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7577 self
7578 }
7579
7580 /// Removes all scopes, and no default scope will be used either.
7581 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7582 /// for details).
7583 pub fn clear_scopes(mut self) -> SpreadsheetValueAppendCall<'a, C> {
7584 self._scopes.clear();
7585 self
7586 }
7587}
7588
7589/// 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.
7590///
7591/// A builder for the *values.batchClear* method supported by a *spreadsheet* resource.
7592/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
7593///
7594/// # Example
7595///
7596/// Instantiate a resource method builder
7597///
7598/// ```test_harness,no_run
7599/// # extern crate hyper;
7600/// # extern crate hyper_rustls;
7601/// # extern crate google_sheets4 as sheets4;
7602/// use sheets4::api::BatchClearValuesRequest;
7603/// # async fn dox() {
7604/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7605///
7606/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7607/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
7608/// # secret,
7609/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7610/// # ).build().await.unwrap();
7611///
7612/// # let client = hyper_util::client::legacy::Client::builder(
7613/// # hyper_util::rt::TokioExecutor::new()
7614/// # )
7615/// # .build(
7616/// # hyper_rustls::HttpsConnectorBuilder::new()
7617/// # .with_native_roots()
7618/// # .unwrap()
7619/// # .https_or_http()
7620/// # .enable_http1()
7621/// # .build()
7622/// # );
7623/// # let mut hub = Sheets::new(client, auth);
7624/// // As the method needs a request, you would usually fill it with the desired information
7625/// // into the respective structure. Some of the parts shown here might not be applicable !
7626/// // Values shown here are possibly random and not representative !
7627/// let mut req = BatchClearValuesRequest::default();
7628///
7629/// // You can configure optional parameters by calling the respective setters at will, and
7630/// // execute the final call using `doit()`.
7631/// // Values shown here are possibly random and not representative !
7632/// let result = hub.spreadsheets().values_batch_clear(req, "spreadsheetId")
7633/// .doit().await;
7634/// # }
7635/// ```
7636pub struct SpreadsheetValueBatchClearCall<'a, C>
7637where
7638 C: 'a,
7639{
7640 hub: &'a Sheets<C>,
7641 _request: BatchClearValuesRequest,
7642 _spreadsheet_id: String,
7643 _delegate: Option<&'a mut dyn common::Delegate>,
7644 _additional_params: HashMap<String, String>,
7645 _scopes: BTreeSet<String>,
7646}
7647
7648impl<'a, C> common::CallBuilder for SpreadsheetValueBatchClearCall<'a, C> {}
7649
7650impl<'a, C> SpreadsheetValueBatchClearCall<'a, C>
7651where
7652 C: common::Connector,
7653{
7654 /// Perform the operation you have build so far.
7655 pub async fn doit(mut self) -> common::Result<(common::Response, BatchClearValuesResponse)> {
7656 use std::borrow::Cow;
7657 use std::io::{Read, Seek};
7658
7659 use common::{url::Params, ToParts};
7660 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7661
7662 let mut dd = common::DefaultDelegate;
7663 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7664 dlg.begin(common::MethodInfo {
7665 id: "sheets.spreadsheets.values.batchClear",
7666 http_method: hyper::Method::POST,
7667 });
7668
7669 for &field in ["alt", "spreadsheetId"].iter() {
7670 if self._additional_params.contains_key(field) {
7671 dlg.finished(false);
7672 return Err(common::Error::FieldClash(field));
7673 }
7674 }
7675
7676 let mut params = Params::with_capacity(4 + self._additional_params.len());
7677 params.push("spreadsheetId", self._spreadsheet_id);
7678
7679 params.extend(self._additional_params.iter());
7680
7681 params.push("alt", "json");
7682 let mut url =
7683 self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}/values:batchClear";
7684 if self._scopes.is_empty() {
7685 self._scopes.insert(Scope::Drive.as_ref().to_string());
7686 }
7687
7688 #[allow(clippy::single_element_loop)]
7689 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
7690 url = params.uri_replacement(url, param_name, find_this, false);
7691 }
7692 {
7693 let to_remove = ["spreadsheetId"];
7694 params.remove_params(&to_remove);
7695 }
7696
7697 let url = params.parse_with_url(&url);
7698
7699 let mut json_mime_type = mime::APPLICATION_JSON;
7700 let mut request_value_reader = {
7701 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
7702 common::remove_json_null_values(&mut value);
7703 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
7704 serde_json::to_writer(&mut dst, &value).unwrap();
7705 dst
7706 };
7707 let request_size = request_value_reader
7708 .seek(std::io::SeekFrom::End(0))
7709 .unwrap();
7710 request_value_reader
7711 .seek(std::io::SeekFrom::Start(0))
7712 .unwrap();
7713
7714 loop {
7715 let token = match self
7716 .hub
7717 .auth
7718 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
7719 .await
7720 {
7721 Ok(token) => token,
7722 Err(e) => match dlg.token(e) {
7723 Ok(token) => token,
7724 Err(e) => {
7725 dlg.finished(false);
7726 return Err(common::Error::MissingToken(e));
7727 }
7728 },
7729 };
7730 request_value_reader
7731 .seek(std::io::SeekFrom::Start(0))
7732 .unwrap();
7733 let mut req_result = {
7734 let client = &self.hub.client;
7735 dlg.pre_request();
7736 let mut req_builder = hyper::Request::builder()
7737 .method(hyper::Method::POST)
7738 .uri(url.as_str())
7739 .header(USER_AGENT, self.hub._user_agent.clone());
7740
7741 if let Some(token) = token.as_ref() {
7742 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7743 }
7744
7745 let request = req_builder
7746 .header(CONTENT_TYPE, json_mime_type.to_string())
7747 .header(CONTENT_LENGTH, request_size as u64)
7748 .body(common::to_body(
7749 request_value_reader.get_ref().clone().into(),
7750 ));
7751
7752 client.request(request.unwrap()).await
7753 };
7754
7755 match req_result {
7756 Err(err) => {
7757 if let common::Retry::After(d) = dlg.http_error(&err) {
7758 sleep(d).await;
7759 continue;
7760 }
7761 dlg.finished(false);
7762 return Err(common::Error::HttpError(err));
7763 }
7764 Ok(res) => {
7765 let (mut parts, body) = res.into_parts();
7766 let mut body = common::Body::new(body);
7767 if !parts.status.is_success() {
7768 let bytes = common::to_bytes(body).await.unwrap_or_default();
7769 let error = serde_json::from_str(&common::to_string(&bytes));
7770 let response = common::to_response(parts, bytes.into());
7771
7772 if let common::Retry::After(d) =
7773 dlg.http_failure(&response, error.as_ref().ok())
7774 {
7775 sleep(d).await;
7776 continue;
7777 }
7778
7779 dlg.finished(false);
7780
7781 return Err(match error {
7782 Ok(value) => common::Error::BadRequest(value),
7783 _ => common::Error::Failure(response),
7784 });
7785 }
7786 let response = {
7787 let bytes = common::to_bytes(body).await.unwrap_or_default();
7788 let encoded = common::to_string(&bytes);
7789 match serde_json::from_str(&encoded) {
7790 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7791 Err(error) => {
7792 dlg.response_json_decode_error(&encoded, &error);
7793 return Err(common::Error::JsonDecodeError(
7794 encoded.to_string(),
7795 error,
7796 ));
7797 }
7798 }
7799 };
7800
7801 dlg.finished(true);
7802 return Ok(response);
7803 }
7804 }
7805 }
7806 }
7807
7808 ///
7809 /// Sets the *request* property to the given value.
7810 ///
7811 /// Even though the property as already been set when instantiating this call,
7812 /// we provide this method for API completeness.
7813 pub fn request(
7814 mut self,
7815 new_value: BatchClearValuesRequest,
7816 ) -> SpreadsheetValueBatchClearCall<'a, C> {
7817 self._request = new_value;
7818 self
7819 }
7820 /// The ID of the spreadsheet to update.
7821 ///
7822 /// Sets the *spreadsheet id* path property to the given value.
7823 ///
7824 /// Even though the property as already been set when instantiating this call,
7825 /// we provide this method for API completeness.
7826 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetValueBatchClearCall<'a, C> {
7827 self._spreadsheet_id = new_value.to_string();
7828 self
7829 }
7830 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7831 /// while executing the actual API request.
7832 ///
7833 /// ````text
7834 /// It should be used to handle progress information, and to implement a certain level of resilience.
7835 /// ````
7836 ///
7837 /// Sets the *delegate* property to the given value.
7838 pub fn delegate(
7839 mut self,
7840 new_value: &'a mut dyn common::Delegate,
7841 ) -> SpreadsheetValueBatchClearCall<'a, C> {
7842 self._delegate = Some(new_value);
7843 self
7844 }
7845
7846 /// Set any additional parameter of the query string used in the request.
7847 /// It should be used to set parameters which are not yet available through their own
7848 /// setters.
7849 ///
7850 /// Please note that this method must not be used to set any of the known parameters
7851 /// which have their own setter method. If done anyway, the request will fail.
7852 ///
7853 /// # Additional Parameters
7854 ///
7855 /// * *$.xgafv* (query-string) - V1 error format.
7856 /// * *access_token* (query-string) - OAuth access token.
7857 /// * *alt* (query-string) - Data format for response.
7858 /// * *callback* (query-string) - JSONP
7859 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7860 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7861 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7862 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7863 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7864 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7865 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7866 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetValueBatchClearCall<'a, C>
7867 where
7868 T: AsRef<str>,
7869 {
7870 self._additional_params
7871 .insert(name.as_ref().to_string(), value.as_ref().to_string());
7872 self
7873 }
7874
7875 /// Identifies the authorization scope for the method you are building.
7876 ///
7877 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7878 /// [`Scope::Drive`].
7879 ///
7880 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7881 /// tokens for more than one scope.
7882 ///
7883 /// Usually there is more than one suitable scope to authorize an operation, some of which may
7884 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7885 /// sufficient, a read-write scope will do as well.
7886 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueBatchClearCall<'a, C>
7887 where
7888 St: AsRef<str>,
7889 {
7890 self._scopes.insert(String::from(scope.as_ref()));
7891 self
7892 }
7893 /// Identifies the authorization scope(s) for the method you are building.
7894 ///
7895 /// See [`Self::add_scope()`] for details.
7896 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetValueBatchClearCall<'a, C>
7897 where
7898 I: IntoIterator<Item = St>,
7899 St: AsRef<str>,
7900 {
7901 self._scopes
7902 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7903 self
7904 }
7905
7906 /// Removes all scopes, and no default scope will be used either.
7907 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7908 /// for details).
7909 pub fn clear_scopes(mut self) -> SpreadsheetValueBatchClearCall<'a, C> {
7910 self._scopes.clear();
7911 self
7912 }
7913}
7914
7915/// 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.
7916///
7917/// A builder for the *values.batchClearByDataFilter* method supported by a *spreadsheet* resource.
7918/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
7919///
7920/// # Example
7921///
7922/// Instantiate a resource method builder
7923///
7924/// ```test_harness,no_run
7925/// # extern crate hyper;
7926/// # extern crate hyper_rustls;
7927/// # extern crate google_sheets4 as sheets4;
7928/// use sheets4::api::BatchClearValuesByDataFilterRequest;
7929/// # async fn dox() {
7930/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7931///
7932/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7933/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
7934/// # secret,
7935/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7936/// # ).build().await.unwrap();
7937///
7938/// # let client = hyper_util::client::legacy::Client::builder(
7939/// # hyper_util::rt::TokioExecutor::new()
7940/// # )
7941/// # .build(
7942/// # hyper_rustls::HttpsConnectorBuilder::new()
7943/// # .with_native_roots()
7944/// # .unwrap()
7945/// # .https_or_http()
7946/// # .enable_http1()
7947/// # .build()
7948/// # );
7949/// # let mut hub = Sheets::new(client, auth);
7950/// // As the method needs a request, you would usually fill it with the desired information
7951/// // into the respective structure. Some of the parts shown here might not be applicable !
7952/// // Values shown here are possibly random and not representative !
7953/// let mut req = BatchClearValuesByDataFilterRequest::default();
7954///
7955/// // You can configure optional parameters by calling the respective setters at will, and
7956/// // execute the final call using `doit()`.
7957/// // Values shown here are possibly random and not representative !
7958/// let result = hub.spreadsheets().values_batch_clear_by_data_filter(req, "spreadsheetId")
7959/// .doit().await;
7960/// # }
7961/// ```
7962pub struct SpreadsheetValueBatchClearByDataFilterCall<'a, C>
7963where
7964 C: 'a,
7965{
7966 hub: &'a Sheets<C>,
7967 _request: BatchClearValuesByDataFilterRequest,
7968 _spreadsheet_id: String,
7969 _delegate: Option<&'a mut dyn common::Delegate>,
7970 _additional_params: HashMap<String, String>,
7971 _scopes: BTreeSet<String>,
7972}
7973
7974impl<'a, C> common::CallBuilder for SpreadsheetValueBatchClearByDataFilterCall<'a, C> {}
7975
7976impl<'a, C> SpreadsheetValueBatchClearByDataFilterCall<'a, C>
7977where
7978 C: common::Connector,
7979{
7980 /// Perform the operation you have build so far.
7981 pub async fn doit(
7982 mut self,
7983 ) -> common::Result<(common::Response, BatchClearValuesByDataFilterResponse)> {
7984 use std::borrow::Cow;
7985 use std::io::{Read, Seek};
7986
7987 use common::{url::Params, ToParts};
7988 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7989
7990 let mut dd = common::DefaultDelegate;
7991 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7992 dlg.begin(common::MethodInfo {
7993 id: "sheets.spreadsheets.values.batchClearByDataFilter",
7994 http_method: hyper::Method::POST,
7995 });
7996
7997 for &field in ["alt", "spreadsheetId"].iter() {
7998 if self._additional_params.contains_key(field) {
7999 dlg.finished(false);
8000 return Err(common::Error::FieldClash(field));
8001 }
8002 }
8003
8004 let mut params = Params::with_capacity(4 + self._additional_params.len());
8005 params.push("spreadsheetId", self._spreadsheet_id);
8006
8007 params.extend(self._additional_params.iter());
8008
8009 params.push("alt", "json");
8010 let mut url = self.hub._base_url.clone()
8011 + "v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter";
8012 if self._scopes.is_empty() {
8013 self._scopes.insert(Scope::Drive.as_ref().to_string());
8014 }
8015
8016 #[allow(clippy::single_element_loop)]
8017 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
8018 url = params.uri_replacement(url, param_name, find_this, false);
8019 }
8020 {
8021 let to_remove = ["spreadsheetId"];
8022 params.remove_params(&to_remove);
8023 }
8024
8025 let url = params.parse_with_url(&url);
8026
8027 let mut json_mime_type = mime::APPLICATION_JSON;
8028 let mut request_value_reader = {
8029 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8030 common::remove_json_null_values(&mut value);
8031 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8032 serde_json::to_writer(&mut dst, &value).unwrap();
8033 dst
8034 };
8035 let request_size = request_value_reader
8036 .seek(std::io::SeekFrom::End(0))
8037 .unwrap();
8038 request_value_reader
8039 .seek(std::io::SeekFrom::Start(0))
8040 .unwrap();
8041
8042 loop {
8043 let token = match self
8044 .hub
8045 .auth
8046 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8047 .await
8048 {
8049 Ok(token) => token,
8050 Err(e) => match dlg.token(e) {
8051 Ok(token) => token,
8052 Err(e) => {
8053 dlg.finished(false);
8054 return Err(common::Error::MissingToken(e));
8055 }
8056 },
8057 };
8058 request_value_reader
8059 .seek(std::io::SeekFrom::Start(0))
8060 .unwrap();
8061 let mut req_result = {
8062 let client = &self.hub.client;
8063 dlg.pre_request();
8064 let mut req_builder = hyper::Request::builder()
8065 .method(hyper::Method::POST)
8066 .uri(url.as_str())
8067 .header(USER_AGENT, self.hub._user_agent.clone());
8068
8069 if let Some(token) = token.as_ref() {
8070 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8071 }
8072
8073 let request = req_builder
8074 .header(CONTENT_TYPE, json_mime_type.to_string())
8075 .header(CONTENT_LENGTH, request_size as u64)
8076 .body(common::to_body(
8077 request_value_reader.get_ref().clone().into(),
8078 ));
8079
8080 client.request(request.unwrap()).await
8081 };
8082
8083 match req_result {
8084 Err(err) => {
8085 if let common::Retry::After(d) = dlg.http_error(&err) {
8086 sleep(d).await;
8087 continue;
8088 }
8089 dlg.finished(false);
8090 return Err(common::Error::HttpError(err));
8091 }
8092 Ok(res) => {
8093 let (mut parts, body) = res.into_parts();
8094 let mut body = common::Body::new(body);
8095 if !parts.status.is_success() {
8096 let bytes = common::to_bytes(body).await.unwrap_or_default();
8097 let error = serde_json::from_str(&common::to_string(&bytes));
8098 let response = common::to_response(parts, bytes.into());
8099
8100 if let common::Retry::After(d) =
8101 dlg.http_failure(&response, error.as_ref().ok())
8102 {
8103 sleep(d).await;
8104 continue;
8105 }
8106
8107 dlg.finished(false);
8108
8109 return Err(match error {
8110 Ok(value) => common::Error::BadRequest(value),
8111 _ => common::Error::Failure(response),
8112 });
8113 }
8114 let response = {
8115 let bytes = common::to_bytes(body).await.unwrap_or_default();
8116 let encoded = common::to_string(&bytes);
8117 match serde_json::from_str(&encoded) {
8118 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8119 Err(error) => {
8120 dlg.response_json_decode_error(&encoded, &error);
8121 return Err(common::Error::JsonDecodeError(
8122 encoded.to_string(),
8123 error,
8124 ));
8125 }
8126 }
8127 };
8128
8129 dlg.finished(true);
8130 return Ok(response);
8131 }
8132 }
8133 }
8134 }
8135
8136 ///
8137 /// Sets the *request* property to the given value.
8138 ///
8139 /// Even though the property as already been set when instantiating this call,
8140 /// we provide this method for API completeness.
8141 pub fn request(
8142 mut self,
8143 new_value: BatchClearValuesByDataFilterRequest,
8144 ) -> SpreadsheetValueBatchClearByDataFilterCall<'a, C> {
8145 self._request = new_value;
8146 self
8147 }
8148 /// The ID of the spreadsheet to update.
8149 ///
8150 /// Sets the *spreadsheet id* path property to the given value.
8151 ///
8152 /// Even though the property as already been set when instantiating this call,
8153 /// we provide this method for API completeness.
8154 pub fn spreadsheet_id(
8155 mut self,
8156 new_value: &str,
8157 ) -> SpreadsheetValueBatchClearByDataFilterCall<'a, C> {
8158 self._spreadsheet_id = new_value.to_string();
8159 self
8160 }
8161 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8162 /// while executing the actual API request.
8163 ///
8164 /// ````text
8165 /// It should be used to handle progress information, and to implement a certain level of resilience.
8166 /// ````
8167 ///
8168 /// Sets the *delegate* property to the given value.
8169 pub fn delegate(
8170 mut self,
8171 new_value: &'a mut dyn common::Delegate,
8172 ) -> SpreadsheetValueBatchClearByDataFilterCall<'a, C> {
8173 self._delegate = Some(new_value);
8174 self
8175 }
8176
8177 /// Set any additional parameter of the query string used in the request.
8178 /// It should be used to set parameters which are not yet available through their own
8179 /// setters.
8180 ///
8181 /// Please note that this method must not be used to set any of the known parameters
8182 /// which have their own setter method. If done anyway, the request will fail.
8183 ///
8184 /// # Additional Parameters
8185 ///
8186 /// * *$.xgafv* (query-string) - V1 error format.
8187 /// * *access_token* (query-string) - OAuth access token.
8188 /// * *alt* (query-string) - Data format for response.
8189 /// * *callback* (query-string) - JSONP
8190 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8191 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8192 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8193 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8194 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8195 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8196 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8197 pub fn param<T>(
8198 mut self,
8199 name: T,
8200 value: T,
8201 ) -> SpreadsheetValueBatchClearByDataFilterCall<'a, C>
8202 where
8203 T: AsRef<str>,
8204 {
8205 self._additional_params
8206 .insert(name.as_ref().to_string(), value.as_ref().to_string());
8207 self
8208 }
8209
8210 /// Identifies the authorization scope for the method you are building.
8211 ///
8212 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8213 /// [`Scope::Drive`].
8214 ///
8215 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8216 /// tokens for more than one scope.
8217 ///
8218 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8219 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8220 /// sufficient, a read-write scope will do as well.
8221 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueBatchClearByDataFilterCall<'a, C>
8222 where
8223 St: AsRef<str>,
8224 {
8225 self._scopes.insert(String::from(scope.as_ref()));
8226 self
8227 }
8228 /// Identifies the authorization scope(s) for the method you are building.
8229 ///
8230 /// See [`Self::add_scope()`] for details.
8231 pub fn add_scopes<I, St>(
8232 mut self,
8233 scopes: I,
8234 ) -> SpreadsheetValueBatchClearByDataFilterCall<'a, C>
8235 where
8236 I: IntoIterator<Item = St>,
8237 St: AsRef<str>,
8238 {
8239 self._scopes
8240 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8241 self
8242 }
8243
8244 /// Removes all scopes, and no default scope will be used either.
8245 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8246 /// for details).
8247 pub fn clear_scopes(mut self) -> SpreadsheetValueBatchClearByDataFilterCall<'a, C> {
8248 self._scopes.clear();
8249 self
8250 }
8251}
8252
8253/// Returns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges.
8254///
8255/// A builder for the *values.batchGet* method supported by a *spreadsheet* resource.
8256/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
8257///
8258/// # Example
8259///
8260/// Instantiate a resource method builder
8261///
8262/// ```test_harness,no_run
8263/// # extern crate hyper;
8264/// # extern crate hyper_rustls;
8265/// # extern crate google_sheets4 as sheets4;
8266/// # async fn dox() {
8267/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8268///
8269/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8270/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
8271/// # secret,
8272/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8273/// # ).build().await.unwrap();
8274///
8275/// # let client = hyper_util::client::legacy::Client::builder(
8276/// # hyper_util::rt::TokioExecutor::new()
8277/// # )
8278/// # .build(
8279/// # hyper_rustls::HttpsConnectorBuilder::new()
8280/// # .with_native_roots()
8281/// # .unwrap()
8282/// # .https_or_http()
8283/// # .enable_http1()
8284/// # .build()
8285/// # );
8286/// # let mut hub = Sheets::new(client, auth);
8287/// // You can configure optional parameters by calling the respective setters at will, and
8288/// // execute the final call using `doit()`.
8289/// // Values shown here are possibly random and not representative !
8290/// let result = hub.spreadsheets().values_batch_get("spreadsheetId")
8291/// .value_render_option("sed")
8292/// .add_ranges("duo")
8293/// .major_dimension("sed")
8294/// .date_time_render_option("no")
8295/// .doit().await;
8296/// # }
8297/// ```
8298pub struct SpreadsheetValueBatchGetCall<'a, C>
8299where
8300 C: 'a,
8301{
8302 hub: &'a Sheets<C>,
8303 _spreadsheet_id: String,
8304 _value_render_option: Option<String>,
8305 _ranges: Vec<String>,
8306 _major_dimension: Option<String>,
8307 _date_time_render_option: Option<String>,
8308 _delegate: Option<&'a mut dyn common::Delegate>,
8309 _additional_params: HashMap<String, String>,
8310 _scopes: BTreeSet<String>,
8311}
8312
8313impl<'a, C> common::CallBuilder for SpreadsheetValueBatchGetCall<'a, C> {}
8314
8315impl<'a, C> SpreadsheetValueBatchGetCall<'a, C>
8316where
8317 C: common::Connector,
8318{
8319 /// Perform the operation you have build so far.
8320 pub async fn doit(mut self) -> common::Result<(common::Response, BatchGetValuesResponse)> {
8321 use std::borrow::Cow;
8322 use std::io::{Read, Seek};
8323
8324 use common::{url::Params, ToParts};
8325 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8326
8327 let mut dd = common::DefaultDelegate;
8328 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8329 dlg.begin(common::MethodInfo {
8330 id: "sheets.spreadsheets.values.batchGet",
8331 http_method: hyper::Method::GET,
8332 });
8333
8334 for &field in [
8335 "alt",
8336 "spreadsheetId",
8337 "valueRenderOption",
8338 "ranges",
8339 "majorDimension",
8340 "dateTimeRenderOption",
8341 ]
8342 .iter()
8343 {
8344 if self._additional_params.contains_key(field) {
8345 dlg.finished(false);
8346 return Err(common::Error::FieldClash(field));
8347 }
8348 }
8349
8350 let mut params = Params::with_capacity(7 + self._additional_params.len());
8351 params.push("spreadsheetId", self._spreadsheet_id);
8352 if let Some(value) = self._value_render_option.as_ref() {
8353 params.push("valueRenderOption", value);
8354 }
8355 if !self._ranges.is_empty() {
8356 for f in self._ranges.iter() {
8357 params.push("ranges", f);
8358 }
8359 }
8360 if let Some(value) = self._major_dimension.as_ref() {
8361 params.push("majorDimension", value);
8362 }
8363 if let Some(value) = self._date_time_render_option.as_ref() {
8364 params.push("dateTimeRenderOption", value);
8365 }
8366
8367 params.extend(self._additional_params.iter());
8368
8369 params.push("alt", "json");
8370 let mut url =
8371 self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}/values:batchGet";
8372 if self._scopes.is_empty() {
8373 self._scopes
8374 .insert(Scope::DriveReadonly.as_ref().to_string());
8375 }
8376
8377 #[allow(clippy::single_element_loop)]
8378 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
8379 url = params.uri_replacement(url, param_name, find_this, false);
8380 }
8381 {
8382 let to_remove = ["spreadsheetId"];
8383 params.remove_params(&to_remove);
8384 }
8385
8386 let url = params.parse_with_url(&url);
8387
8388 loop {
8389 let token = match self
8390 .hub
8391 .auth
8392 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8393 .await
8394 {
8395 Ok(token) => token,
8396 Err(e) => match dlg.token(e) {
8397 Ok(token) => token,
8398 Err(e) => {
8399 dlg.finished(false);
8400 return Err(common::Error::MissingToken(e));
8401 }
8402 },
8403 };
8404 let mut req_result = {
8405 let client = &self.hub.client;
8406 dlg.pre_request();
8407 let mut req_builder = hyper::Request::builder()
8408 .method(hyper::Method::GET)
8409 .uri(url.as_str())
8410 .header(USER_AGENT, self.hub._user_agent.clone());
8411
8412 if let Some(token) = token.as_ref() {
8413 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8414 }
8415
8416 let request = req_builder
8417 .header(CONTENT_LENGTH, 0_u64)
8418 .body(common::to_body::<String>(None));
8419
8420 client.request(request.unwrap()).await
8421 };
8422
8423 match req_result {
8424 Err(err) => {
8425 if let common::Retry::After(d) = dlg.http_error(&err) {
8426 sleep(d).await;
8427 continue;
8428 }
8429 dlg.finished(false);
8430 return Err(common::Error::HttpError(err));
8431 }
8432 Ok(res) => {
8433 let (mut parts, body) = res.into_parts();
8434 let mut body = common::Body::new(body);
8435 if !parts.status.is_success() {
8436 let bytes = common::to_bytes(body).await.unwrap_or_default();
8437 let error = serde_json::from_str(&common::to_string(&bytes));
8438 let response = common::to_response(parts, bytes.into());
8439
8440 if let common::Retry::After(d) =
8441 dlg.http_failure(&response, error.as_ref().ok())
8442 {
8443 sleep(d).await;
8444 continue;
8445 }
8446
8447 dlg.finished(false);
8448
8449 return Err(match error {
8450 Ok(value) => common::Error::BadRequest(value),
8451 _ => common::Error::Failure(response),
8452 });
8453 }
8454 let response = {
8455 let bytes = common::to_bytes(body).await.unwrap_or_default();
8456 let encoded = common::to_string(&bytes);
8457 match serde_json::from_str(&encoded) {
8458 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8459 Err(error) => {
8460 dlg.response_json_decode_error(&encoded, &error);
8461 return Err(common::Error::JsonDecodeError(
8462 encoded.to_string(),
8463 error,
8464 ));
8465 }
8466 }
8467 };
8468
8469 dlg.finished(true);
8470 return Ok(response);
8471 }
8472 }
8473 }
8474 }
8475
8476 /// The ID of the spreadsheet to retrieve data from.
8477 ///
8478 /// Sets the *spreadsheet id* path property to the given value.
8479 ///
8480 /// Even though the property as already been set when instantiating this call,
8481 /// we provide this method for API completeness.
8482 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetValueBatchGetCall<'a, C> {
8483 self._spreadsheet_id = new_value.to_string();
8484 self
8485 }
8486 /// How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE.
8487 ///
8488 /// Sets the *value render option* query property to the given value.
8489 pub fn value_render_option(mut self, new_value: &str) -> SpreadsheetValueBatchGetCall<'a, C> {
8490 self._value_render_option = Some(new_value.to_string());
8491 self
8492 }
8493 /// The [A1 notation or R1C1 notation](https://developers.google.com/sheets/api/guides/concepts#cell) of the range to retrieve values from.
8494 ///
8495 /// Append the given value to the *ranges* query property.
8496 /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters.
8497 pub fn add_ranges(mut self, new_value: &str) -> SpreadsheetValueBatchGetCall<'a, C> {
8498 self._ranges.push(new_value.to_string());
8499 self
8500 }
8501 /// 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]]`.
8502 ///
8503 /// Sets the *major dimension* query property to the given value.
8504 pub fn major_dimension(mut self, new_value: &str) -> SpreadsheetValueBatchGetCall<'a, C> {
8505 self._major_dimension = Some(new_value.to_string());
8506 self
8507 }
8508 /// 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.
8509 ///
8510 /// Sets the *date time render option* query property to the given value.
8511 pub fn date_time_render_option(
8512 mut self,
8513 new_value: &str,
8514 ) -> SpreadsheetValueBatchGetCall<'a, C> {
8515 self._date_time_render_option = Some(new_value.to_string());
8516 self
8517 }
8518 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8519 /// while executing the actual API request.
8520 ///
8521 /// ````text
8522 /// It should be used to handle progress information, and to implement a certain level of resilience.
8523 /// ````
8524 ///
8525 /// Sets the *delegate* property to the given value.
8526 pub fn delegate(
8527 mut self,
8528 new_value: &'a mut dyn common::Delegate,
8529 ) -> SpreadsheetValueBatchGetCall<'a, C> {
8530 self._delegate = Some(new_value);
8531 self
8532 }
8533
8534 /// Set any additional parameter of the query string used in the request.
8535 /// It should be used to set parameters which are not yet available through their own
8536 /// setters.
8537 ///
8538 /// Please note that this method must not be used to set any of the known parameters
8539 /// which have their own setter method. If done anyway, the request will fail.
8540 ///
8541 /// # Additional Parameters
8542 ///
8543 /// * *$.xgafv* (query-string) - V1 error format.
8544 /// * *access_token* (query-string) - OAuth access token.
8545 /// * *alt* (query-string) - Data format for response.
8546 /// * *callback* (query-string) - JSONP
8547 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8548 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8549 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8550 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8551 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8552 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8553 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8554 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetValueBatchGetCall<'a, C>
8555 where
8556 T: AsRef<str>,
8557 {
8558 self._additional_params
8559 .insert(name.as_ref().to_string(), value.as_ref().to_string());
8560 self
8561 }
8562
8563 /// Identifies the authorization scope for the method you are building.
8564 ///
8565 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8566 /// [`Scope::DriveReadonly`].
8567 ///
8568 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8569 /// tokens for more than one scope.
8570 ///
8571 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8572 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8573 /// sufficient, a read-write scope will do as well.
8574 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueBatchGetCall<'a, C>
8575 where
8576 St: AsRef<str>,
8577 {
8578 self._scopes.insert(String::from(scope.as_ref()));
8579 self
8580 }
8581 /// Identifies the authorization scope(s) for the method you are building.
8582 ///
8583 /// See [`Self::add_scope()`] for details.
8584 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetValueBatchGetCall<'a, C>
8585 where
8586 I: IntoIterator<Item = St>,
8587 St: AsRef<str>,
8588 {
8589 self._scopes
8590 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8591 self
8592 }
8593
8594 /// Removes all scopes, and no default scope will be used either.
8595 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8596 /// for details).
8597 pub fn clear_scopes(mut self) -> SpreadsheetValueBatchGetCall<'a, C> {
8598 self._scopes.clear();
8599 self
8600 }
8601}
8602
8603/// 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.
8604///
8605/// A builder for the *values.batchGetByDataFilter* method supported by a *spreadsheet* resource.
8606/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
8607///
8608/// # Example
8609///
8610/// Instantiate a resource method builder
8611///
8612/// ```test_harness,no_run
8613/// # extern crate hyper;
8614/// # extern crate hyper_rustls;
8615/// # extern crate google_sheets4 as sheets4;
8616/// use sheets4::api::BatchGetValuesByDataFilterRequest;
8617/// # async fn dox() {
8618/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8619///
8620/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8621/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
8622/// # secret,
8623/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8624/// # ).build().await.unwrap();
8625///
8626/// # let client = hyper_util::client::legacy::Client::builder(
8627/// # hyper_util::rt::TokioExecutor::new()
8628/// # )
8629/// # .build(
8630/// # hyper_rustls::HttpsConnectorBuilder::new()
8631/// # .with_native_roots()
8632/// # .unwrap()
8633/// # .https_or_http()
8634/// # .enable_http1()
8635/// # .build()
8636/// # );
8637/// # let mut hub = Sheets::new(client, auth);
8638/// // As the method needs a request, you would usually fill it with the desired information
8639/// // into the respective structure. Some of the parts shown here might not be applicable !
8640/// // Values shown here are possibly random and not representative !
8641/// let mut req = BatchGetValuesByDataFilterRequest::default();
8642///
8643/// // You can configure optional parameters by calling the respective setters at will, and
8644/// // execute the final call using `doit()`.
8645/// // Values shown here are possibly random and not representative !
8646/// let result = hub.spreadsheets().values_batch_get_by_data_filter(req, "spreadsheetId")
8647/// .doit().await;
8648/// # }
8649/// ```
8650pub struct SpreadsheetValueBatchGetByDataFilterCall<'a, C>
8651where
8652 C: 'a,
8653{
8654 hub: &'a Sheets<C>,
8655 _request: BatchGetValuesByDataFilterRequest,
8656 _spreadsheet_id: String,
8657 _delegate: Option<&'a mut dyn common::Delegate>,
8658 _additional_params: HashMap<String, String>,
8659 _scopes: BTreeSet<String>,
8660}
8661
8662impl<'a, C> common::CallBuilder for SpreadsheetValueBatchGetByDataFilterCall<'a, C> {}
8663
8664impl<'a, C> SpreadsheetValueBatchGetByDataFilterCall<'a, C>
8665where
8666 C: common::Connector,
8667{
8668 /// Perform the operation you have build so far.
8669 pub async fn doit(
8670 mut self,
8671 ) -> common::Result<(common::Response, BatchGetValuesByDataFilterResponse)> {
8672 use std::borrow::Cow;
8673 use std::io::{Read, Seek};
8674
8675 use common::{url::Params, ToParts};
8676 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8677
8678 let mut dd = common::DefaultDelegate;
8679 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8680 dlg.begin(common::MethodInfo {
8681 id: "sheets.spreadsheets.values.batchGetByDataFilter",
8682 http_method: hyper::Method::POST,
8683 });
8684
8685 for &field in ["alt", "spreadsheetId"].iter() {
8686 if self._additional_params.contains_key(field) {
8687 dlg.finished(false);
8688 return Err(common::Error::FieldClash(field));
8689 }
8690 }
8691
8692 let mut params = Params::with_capacity(4 + self._additional_params.len());
8693 params.push("spreadsheetId", self._spreadsheet_id);
8694
8695 params.extend(self._additional_params.iter());
8696
8697 params.push("alt", "json");
8698 let mut url = self.hub._base_url.clone()
8699 + "v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter";
8700 if self._scopes.is_empty() {
8701 self._scopes.insert(Scope::Drive.as_ref().to_string());
8702 }
8703
8704 #[allow(clippy::single_element_loop)]
8705 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
8706 url = params.uri_replacement(url, param_name, find_this, false);
8707 }
8708 {
8709 let to_remove = ["spreadsheetId"];
8710 params.remove_params(&to_remove);
8711 }
8712
8713 let url = params.parse_with_url(&url);
8714
8715 let mut json_mime_type = mime::APPLICATION_JSON;
8716 let mut request_value_reader = {
8717 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8718 common::remove_json_null_values(&mut value);
8719 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8720 serde_json::to_writer(&mut dst, &value).unwrap();
8721 dst
8722 };
8723 let request_size = request_value_reader
8724 .seek(std::io::SeekFrom::End(0))
8725 .unwrap();
8726 request_value_reader
8727 .seek(std::io::SeekFrom::Start(0))
8728 .unwrap();
8729
8730 loop {
8731 let token = match self
8732 .hub
8733 .auth
8734 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8735 .await
8736 {
8737 Ok(token) => token,
8738 Err(e) => match dlg.token(e) {
8739 Ok(token) => token,
8740 Err(e) => {
8741 dlg.finished(false);
8742 return Err(common::Error::MissingToken(e));
8743 }
8744 },
8745 };
8746 request_value_reader
8747 .seek(std::io::SeekFrom::Start(0))
8748 .unwrap();
8749 let mut req_result = {
8750 let client = &self.hub.client;
8751 dlg.pre_request();
8752 let mut req_builder = hyper::Request::builder()
8753 .method(hyper::Method::POST)
8754 .uri(url.as_str())
8755 .header(USER_AGENT, self.hub._user_agent.clone());
8756
8757 if let Some(token) = token.as_ref() {
8758 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8759 }
8760
8761 let request = req_builder
8762 .header(CONTENT_TYPE, json_mime_type.to_string())
8763 .header(CONTENT_LENGTH, request_size as u64)
8764 .body(common::to_body(
8765 request_value_reader.get_ref().clone().into(),
8766 ));
8767
8768 client.request(request.unwrap()).await
8769 };
8770
8771 match req_result {
8772 Err(err) => {
8773 if let common::Retry::After(d) = dlg.http_error(&err) {
8774 sleep(d).await;
8775 continue;
8776 }
8777 dlg.finished(false);
8778 return Err(common::Error::HttpError(err));
8779 }
8780 Ok(res) => {
8781 let (mut parts, body) = res.into_parts();
8782 let mut body = common::Body::new(body);
8783 if !parts.status.is_success() {
8784 let bytes = common::to_bytes(body).await.unwrap_or_default();
8785 let error = serde_json::from_str(&common::to_string(&bytes));
8786 let response = common::to_response(parts, bytes.into());
8787
8788 if let common::Retry::After(d) =
8789 dlg.http_failure(&response, error.as_ref().ok())
8790 {
8791 sleep(d).await;
8792 continue;
8793 }
8794
8795 dlg.finished(false);
8796
8797 return Err(match error {
8798 Ok(value) => common::Error::BadRequest(value),
8799 _ => common::Error::Failure(response),
8800 });
8801 }
8802 let response = {
8803 let bytes = common::to_bytes(body).await.unwrap_or_default();
8804 let encoded = common::to_string(&bytes);
8805 match serde_json::from_str(&encoded) {
8806 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8807 Err(error) => {
8808 dlg.response_json_decode_error(&encoded, &error);
8809 return Err(common::Error::JsonDecodeError(
8810 encoded.to_string(),
8811 error,
8812 ));
8813 }
8814 }
8815 };
8816
8817 dlg.finished(true);
8818 return Ok(response);
8819 }
8820 }
8821 }
8822 }
8823
8824 ///
8825 /// Sets the *request* property to the given value.
8826 ///
8827 /// Even though the property as already been set when instantiating this call,
8828 /// we provide this method for API completeness.
8829 pub fn request(
8830 mut self,
8831 new_value: BatchGetValuesByDataFilterRequest,
8832 ) -> SpreadsheetValueBatchGetByDataFilterCall<'a, C> {
8833 self._request = new_value;
8834 self
8835 }
8836 /// The ID of the spreadsheet to retrieve data from.
8837 ///
8838 /// Sets the *spreadsheet id* path property to the given value.
8839 ///
8840 /// Even though the property as already been set when instantiating this call,
8841 /// we provide this method for API completeness.
8842 pub fn spreadsheet_id(
8843 mut self,
8844 new_value: &str,
8845 ) -> SpreadsheetValueBatchGetByDataFilterCall<'a, C> {
8846 self._spreadsheet_id = new_value.to_string();
8847 self
8848 }
8849 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8850 /// while executing the actual API request.
8851 ///
8852 /// ````text
8853 /// It should be used to handle progress information, and to implement a certain level of resilience.
8854 /// ````
8855 ///
8856 /// Sets the *delegate* property to the given value.
8857 pub fn delegate(
8858 mut self,
8859 new_value: &'a mut dyn common::Delegate,
8860 ) -> SpreadsheetValueBatchGetByDataFilterCall<'a, C> {
8861 self._delegate = Some(new_value);
8862 self
8863 }
8864
8865 /// Set any additional parameter of the query string used in the request.
8866 /// It should be used to set parameters which are not yet available through their own
8867 /// setters.
8868 ///
8869 /// Please note that this method must not be used to set any of the known parameters
8870 /// which have their own setter method. If done anyway, the request will fail.
8871 ///
8872 /// # Additional Parameters
8873 ///
8874 /// * *$.xgafv* (query-string) - V1 error format.
8875 /// * *access_token* (query-string) - OAuth access token.
8876 /// * *alt* (query-string) - Data format for response.
8877 /// * *callback* (query-string) - JSONP
8878 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8879 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8880 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8881 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8882 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8883 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8884 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8885 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetValueBatchGetByDataFilterCall<'a, C>
8886 where
8887 T: AsRef<str>,
8888 {
8889 self._additional_params
8890 .insert(name.as_ref().to_string(), value.as_ref().to_string());
8891 self
8892 }
8893
8894 /// Identifies the authorization scope for the method you are building.
8895 ///
8896 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8897 /// [`Scope::Drive`].
8898 ///
8899 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8900 /// tokens for more than one scope.
8901 ///
8902 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8903 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8904 /// sufficient, a read-write scope will do as well.
8905 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueBatchGetByDataFilterCall<'a, C>
8906 where
8907 St: AsRef<str>,
8908 {
8909 self._scopes.insert(String::from(scope.as_ref()));
8910 self
8911 }
8912 /// Identifies the authorization scope(s) for the method you are building.
8913 ///
8914 /// See [`Self::add_scope()`] for details.
8915 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetValueBatchGetByDataFilterCall<'a, C>
8916 where
8917 I: IntoIterator<Item = St>,
8918 St: AsRef<str>,
8919 {
8920 self._scopes
8921 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8922 self
8923 }
8924
8925 /// Removes all scopes, and no default scope will be used either.
8926 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8927 /// for details).
8928 pub fn clear_scopes(mut self) -> SpreadsheetValueBatchGetByDataFilterCall<'a, C> {
8929 self._scopes.clear();
8930 self
8931 }
8932}
8933
8934/// Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.
8935///
8936/// A builder for the *values.batchUpdate* method supported by a *spreadsheet* resource.
8937/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
8938///
8939/// # Example
8940///
8941/// Instantiate a resource method builder
8942///
8943/// ```test_harness,no_run
8944/// # extern crate hyper;
8945/// # extern crate hyper_rustls;
8946/// # extern crate google_sheets4 as sheets4;
8947/// use sheets4::api::BatchUpdateValuesRequest;
8948/// # async fn dox() {
8949/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8950///
8951/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8952/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
8953/// # secret,
8954/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8955/// # ).build().await.unwrap();
8956///
8957/// # let client = hyper_util::client::legacy::Client::builder(
8958/// # hyper_util::rt::TokioExecutor::new()
8959/// # )
8960/// # .build(
8961/// # hyper_rustls::HttpsConnectorBuilder::new()
8962/// # .with_native_roots()
8963/// # .unwrap()
8964/// # .https_or_http()
8965/// # .enable_http1()
8966/// # .build()
8967/// # );
8968/// # let mut hub = Sheets::new(client, auth);
8969/// // As the method needs a request, you would usually fill it with the desired information
8970/// // into the respective structure. Some of the parts shown here might not be applicable !
8971/// // Values shown here are possibly random and not representative !
8972/// let mut req = BatchUpdateValuesRequest::default();
8973///
8974/// // You can configure optional parameters by calling the respective setters at will, and
8975/// // execute the final call using `doit()`.
8976/// // Values shown here are possibly random and not representative !
8977/// let result = hub.spreadsheets().values_batch_update(req, "spreadsheetId")
8978/// .doit().await;
8979/// # }
8980/// ```
8981pub struct SpreadsheetValueBatchUpdateCall<'a, C>
8982where
8983 C: 'a,
8984{
8985 hub: &'a Sheets<C>,
8986 _request: BatchUpdateValuesRequest,
8987 _spreadsheet_id: String,
8988 _delegate: Option<&'a mut dyn common::Delegate>,
8989 _additional_params: HashMap<String, String>,
8990 _scopes: BTreeSet<String>,
8991}
8992
8993impl<'a, C> common::CallBuilder for SpreadsheetValueBatchUpdateCall<'a, C> {}
8994
8995impl<'a, C> SpreadsheetValueBatchUpdateCall<'a, C>
8996where
8997 C: common::Connector,
8998{
8999 /// Perform the operation you have build so far.
9000 pub async fn doit(mut self) -> common::Result<(common::Response, BatchUpdateValuesResponse)> {
9001 use std::borrow::Cow;
9002 use std::io::{Read, Seek};
9003
9004 use common::{url::Params, ToParts};
9005 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9006
9007 let mut dd = common::DefaultDelegate;
9008 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9009 dlg.begin(common::MethodInfo {
9010 id: "sheets.spreadsheets.values.batchUpdate",
9011 http_method: hyper::Method::POST,
9012 });
9013
9014 for &field in ["alt", "spreadsheetId"].iter() {
9015 if self._additional_params.contains_key(field) {
9016 dlg.finished(false);
9017 return Err(common::Error::FieldClash(field));
9018 }
9019 }
9020
9021 let mut params = Params::with_capacity(4 + self._additional_params.len());
9022 params.push("spreadsheetId", self._spreadsheet_id);
9023
9024 params.extend(self._additional_params.iter());
9025
9026 params.push("alt", "json");
9027 let mut url =
9028 self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}/values:batchUpdate";
9029 if self._scopes.is_empty() {
9030 self._scopes.insert(Scope::Drive.as_ref().to_string());
9031 }
9032
9033 #[allow(clippy::single_element_loop)]
9034 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
9035 url = params.uri_replacement(url, param_name, find_this, false);
9036 }
9037 {
9038 let to_remove = ["spreadsheetId"];
9039 params.remove_params(&to_remove);
9040 }
9041
9042 let url = params.parse_with_url(&url);
9043
9044 let mut json_mime_type = mime::APPLICATION_JSON;
9045 let mut request_value_reader = {
9046 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
9047 common::remove_json_null_values(&mut value);
9048 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
9049 serde_json::to_writer(&mut dst, &value).unwrap();
9050 dst
9051 };
9052 let request_size = request_value_reader
9053 .seek(std::io::SeekFrom::End(0))
9054 .unwrap();
9055 request_value_reader
9056 .seek(std::io::SeekFrom::Start(0))
9057 .unwrap();
9058
9059 loop {
9060 let token = match self
9061 .hub
9062 .auth
9063 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9064 .await
9065 {
9066 Ok(token) => token,
9067 Err(e) => match dlg.token(e) {
9068 Ok(token) => token,
9069 Err(e) => {
9070 dlg.finished(false);
9071 return Err(common::Error::MissingToken(e));
9072 }
9073 },
9074 };
9075 request_value_reader
9076 .seek(std::io::SeekFrom::Start(0))
9077 .unwrap();
9078 let mut req_result = {
9079 let client = &self.hub.client;
9080 dlg.pre_request();
9081 let mut req_builder = hyper::Request::builder()
9082 .method(hyper::Method::POST)
9083 .uri(url.as_str())
9084 .header(USER_AGENT, self.hub._user_agent.clone());
9085
9086 if let Some(token) = token.as_ref() {
9087 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9088 }
9089
9090 let request = req_builder
9091 .header(CONTENT_TYPE, json_mime_type.to_string())
9092 .header(CONTENT_LENGTH, request_size as u64)
9093 .body(common::to_body(
9094 request_value_reader.get_ref().clone().into(),
9095 ));
9096
9097 client.request(request.unwrap()).await
9098 };
9099
9100 match req_result {
9101 Err(err) => {
9102 if let common::Retry::After(d) = dlg.http_error(&err) {
9103 sleep(d).await;
9104 continue;
9105 }
9106 dlg.finished(false);
9107 return Err(common::Error::HttpError(err));
9108 }
9109 Ok(res) => {
9110 let (mut parts, body) = res.into_parts();
9111 let mut body = common::Body::new(body);
9112 if !parts.status.is_success() {
9113 let bytes = common::to_bytes(body).await.unwrap_or_default();
9114 let error = serde_json::from_str(&common::to_string(&bytes));
9115 let response = common::to_response(parts, bytes.into());
9116
9117 if let common::Retry::After(d) =
9118 dlg.http_failure(&response, error.as_ref().ok())
9119 {
9120 sleep(d).await;
9121 continue;
9122 }
9123
9124 dlg.finished(false);
9125
9126 return Err(match error {
9127 Ok(value) => common::Error::BadRequest(value),
9128 _ => common::Error::Failure(response),
9129 });
9130 }
9131 let response = {
9132 let bytes = common::to_bytes(body).await.unwrap_or_default();
9133 let encoded = common::to_string(&bytes);
9134 match serde_json::from_str(&encoded) {
9135 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9136 Err(error) => {
9137 dlg.response_json_decode_error(&encoded, &error);
9138 return Err(common::Error::JsonDecodeError(
9139 encoded.to_string(),
9140 error,
9141 ));
9142 }
9143 }
9144 };
9145
9146 dlg.finished(true);
9147 return Ok(response);
9148 }
9149 }
9150 }
9151 }
9152
9153 ///
9154 /// Sets the *request* property to the given value.
9155 ///
9156 /// Even though the property as already been set when instantiating this call,
9157 /// we provide this method for API completeness.
9158 pub fn request(
9159 mut self,
9160 new_value: BatchUpdateValuesRequest,
9161 ) -> SpreadsheetValueBatchUpdateCall<'a, C> {
9162 self._request = new_value;
9163 self
9164 }
9165 /// The ID of the spreadsheet to update.
9166 ///
9167 /// Sets the *spreadsheet id* path property to the given value.
9168 ///
9169 /// Even though the property as already been set when instantiating this call,
9170 /// we provide this method for API completeness.
9171 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetValueBatchUpdateCall<'a, C> {
9172 self._spreadsheet_id = new_value.to_string();
9173 self
9174 }
9175 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9176 /// while executing the actual API request.
9177 ///
9178 /// ````text
9179 /// It should be used to handle progress information, and to implement a certain level of resilience.
9180 /// ````
9181 ///
9182 /// Sets the *delegate* property to the given value.
9183 pub fn delegate(
9184 mut self,
9185 new_value: &'a mut dyn common::Delegate,
9186 ) -> SpreadsheetValueBatchUpdateCall<'a, C> {
9187 self._delegate = Some(new_value);
9188 self
9189 }
9190
9191 /// Set any additional parameter of the query string used in the request.
9192 /// It should be used to set parameters which are not yet available through their own
9193 /// setters.
9194 ///
9195 /// Please note that this method must not be used to set any of the known parameters
9196 /// which have their own setter method. If done anyway, the request will fail.
9197 ///
9198 /// # Additional Parameters
9199 ///
9200 /// * *$.xgafv* (query-string) - V1 error format.
9201 /// * *access_token* (query-string) - OAuth access token.
9202 /// * *alt* (query-string) - Data format for response.
9203 /// * *callback* (query-string) - JSONP
9204 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9205 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9206 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9207 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9208 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9209 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9210 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9211 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetValueBatchUpdateCall<'a, C>
9212 where
9213 T: AsRef<str>,
9214 {
9215 self._additional_params
9216 .insert(name.as_ref().to_string(), value.as_ref().to_string());
9217 self
9218 }
9219
9220 /// Identifies the authorization scope for the method you are building.
9221 ///
9222 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9223 /// [`Scope::Drive`].
9224 ///
9225 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9226 /// tokens for more than one scope.
9227 ///
9228 /// Usually there is more than one suitable scope to authorize an operation, some of which may
9229 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9230 /// sufficient, a read-write scope will do as well.
9231 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueBatchUpdateCall<'a, C>
9232 where
9233 St: AsRef<str>,
9234 {
9235 self._scopes.insert(String::from(scope.as_ref()));
9236 self
9237 }
9238 /// Identifies the authorization scope(s) for the method you are building.
9239 ///
9240 /// See [`Self::add_scope()`] for details.
9241 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetValueBatchUpdateCall<'a, C>
9242 where
9243 I: IntoIterator<Item = St>,
9244 St: AsRef<str>,
9245 {
9246 self._scopes
9247 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9248 self
9249 }
9250
9251 /// Removes all scopes, and no default scope will be used either.
9252 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9253 /// for details).
9254 pub fn clear_scopes(mut self) -> SpreadsheetValueBatchUpdateCall<'a, C> {
9255 self._scopes.clear();
9256 self
9257 }
9258}
9259
9260/// Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more DataFilterValueRanges.
9261///
9262/// A builder for the *values.batchUpdateByDataFilter* method supported by a *spreadsheet* resource.
9263/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
9264///
9265/// # Example
9266///
9267/// Instantiate a resource method builder
9268///
9269/// ```test_harness,no_run
9270/// # extern crate hyper;
9271/// # extern crate hyper_rustls;
9272/// # extern crate google_sheets4 as sheets4;
9273/// use sheets4::api::BatchUpdateValuesByDataFilterRequest;
9274/// # async fn dox() {
9275/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9276///
9277/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9278/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
9279/// # secret,
9280/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9281/// # ).build().await.unwrap();
9282///
9283/// # let client = hyper_util::client::legacy::Client::builder(
9284/// # hyper_util::rt::TokioExecutor::new()
9285/// # )
9286/// # .build(
9287/// # hyper_rustls::HttpsConnectorBuilder::new()
9288/// # .with_native_roots()
9289/// # .unwrap()
9290/// # .https_or_http()
9291/// # .enable_http1()
9292/// # .build()
9293/// # );
9294/// # let mut hub = Sheets::new(client, auth);
9295/// // As the method needs a request, you would usually fill it with the desired information
9296/// // into the respective structure. Some of the parts shown here might not be applicable !
9297/// // Values shown here are possibly random and not representative !
9298/// let mut req = BatchUpdateValuesByDataFilterRequest::default();
9299///
9300/// // You can configure optional parameters by calling the respective setters at will, and
9301/// // execute the final call using `doit()`.
9302/// // Values shown here are possibly random and not representative !
9303/// let result = hub.spreadsheets().values_batch_update_by_data_filter(req, "spreadsheetId")
9304/// .doit().await;
9305/// # }
9306/// ```
9307pub struct SpreadsheetValueBatchUpdateByDataFilterCall<'a, C>
9308where
9309 C: 'a,
9310{
9311 hub: &'a Sheets<C>,
9312 _request: BatchUpdateValuesByDataFilterRequest,
9313 _spreadsheet_id: String,
9314 _delegate: Option<&'a mut dyn common::Delegate>,
9315 _additional_params: HashMap<String, String>,
9316 _scopes: BTreeSet<String>,
9317}
9318
9319impl<'a, C> common::CallBuilder for SpreadsheetValueBatchUpdateByDataFilterCall<'a, C> {}
9320
9321impl<'a, C> SpreadsheetValueBatchUpdateByDataFilterCall<'a, C>
9322where
9323 C: common::Connector,
9324{
9325 /// Perform the operation you have build so far.
9326 pub async fn doit(
9327 mut self,
9328 ) -> common::Result<(common::Response, BatchUpdateValuesByDataFilterResponse)> {
9329 use std::borrow::Cow;
9330 use std::io::{Read, Seek};
9331
9332 use common::{url::Params, ToParts};
9333 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9334
9335 let mut dd = common::DefaultDelegate;
9336 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9337 dlg.begin(common::MethodInfo {
9338 id: "sheets.spreadsheets.values.batchUpdateByDataFilter",
9339 http_method: hyper::Method::POST,
9340 });
9341
9342 for &field in ["alt", "spreadsheetId"].iter() {
9343 if self._additional_params.contains_key(field) {
9344 dlg.finished(false);
9345 return Err(common::Error::FieldClash(field));
9346 }
9347 }
9348
9349 let mut params = Params::with_capacity(4 + self._additional_params.len());
9350 params.push("spreadsheetId", self._spreadsheet_id);
9351
9352 params.extend(self._additional_params.iter());
9353
9354 params.push("alt", "json");
9355 let mut url = self.hub._base_url.clone()
9356 + "v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter";
9357 if self._scopes.is_empty() {
9358 self._scopes.insert(Scope::Drive.as_ref().to_string());
9359 }
9360
9361 #[allow(clippy::single_element_loop)]
9362 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
9363 url = params.uri_replacement(url, param_name, find_this, false);
9364 }
9365 {
9366 let to_remove = ["spreadsheetId"];
9367 params.remove_params(&to_remove);
9368 }
9369
9370 let url = params.parse_with_url(&url);
9371
9372 let mut json_mime_type = mime::APPLICATION_JSON;
9373 let mut request_value_reader = {
9374 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
9375 common::remove_json_null_values(&mut value);
9376 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
9377 serde_json::to_writer(&mut dst, &value).unwrap();
9378 dst
9379 };
9380 let request_size = request_value_reader
9381 .seek(std::io::SeekFrom::End(0))
9382 .unwrap();
9383 request_value_reader
9384 .seek(std::io::SeekFrom::Start(0))
9385 .unwrap();
9386
9387 loop {
9388 let token = match self
9389 .hub
9390 .auth
9391 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9392 .await
9393 {
9394 Ok(token) => token,
9395 Err(e) => match dlg.token(e) {
9396 Ok(token) => token,
9397 Err(e) => {
9398 dlg.finished(false);
9399 return Err(common::Error::MissingToken(e));
9400 }
9401 },
9402 };
9403 request_value_reader
9404 .seek(std::io::SeekFrom::Start(0))
9405 .unwrap();
9406 let mut req_result = {
9407 let client = &self.hub.client;
9408 dlg.pre_request();
9409 let mut req_builder = hyper::Request::builder()
9410 .method(hyper::Method::POST)
9411 .uri(url.as_str())
9412 .header(USER_AGENT, self.hub._user_agent.clone());
9413
9414 if let Some(token) = token.as_ref() {
9415 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9416 }
9417
9418 let request = req_builder
9419 .header(CONTENT_TYPE, json_mime_type.to_string())
9420 .header(CONTENT_LENGTH, request_size as u64)
9421 .body(common::to_body(
9422 request_value_reader.get_ref().clone().into(),
9423 ));
9424
9425 client.request(request.unwrap()).await
9426 };
9427
9428 match req_result {
9429 Err(err) => {
9430 if let common::Retry::After(d) = dlg.http_error(&err) {
9431 sleep(d).await;
9432 continue;
9433 }
9434 dlg.finished(false);
9435 return Err(common::Error::HttpError(err));
9436 }
9437 Ok(res) => {
9438 let (mut parts, body) = res.into_parts();
9439 let mut body = common::Body::new(body);
9440 if !parts.status.is_success() {
9441 let bytes = common::to_bytes(body).await.unwrap_or_default();
9442 let error = serde_json::from_str(&common::to_string(&bytes));
9443 let response = common::to_response(parts, bytes.into());
9444
9445 if let common::Retry::After(d) =
9446 dlg.http_failure(&response, error.as_ref().ok())
9447 {
9448 sleep(d).await;
9449 continue;
9450 }
9451
9452 dlg.finished(false);
9453
9454 return Err(match error {
9455 Ok(value) => common::Error::BadRequest(value),
9456 _ => common::Error::Failure(response),
9457 });
9458 }
9459 let response = {
9460 let bytes = common::to_bytes(body).await.unwrap_or_default();
9461 let encoded = common::to_string(&bytes);
9462 match serde_json::from_str(&encoded) {
9463 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9464 Err(error) => {
9465 dlg.response_json_decode_error(&encoded, &error);
9466 return Err(common::Error::JsonDecodeError(
9467 encoded.to_string(),
9468 error,
9469 ));
9470 }
9471 }
9472 };
9473
9474 dlg.finished(true);
9475 return Ok(response);
9476 }
9477 }
9478 }
9479 }
9480
9481 ///
9482 /// Sets the *request* property to the given value.
9483 ///
9484 /// Even though the property as already been set when instantiating this call,
9485 /// we provide this method for API completeness.
9486 pub fn request(
9487 mut self,
9488 new_value: BatchUpdateValuesByDataFilterRequest,
9489 ) -> SpreadsheetValueBatchUpdateByDataFilterCall<'a, C> {
9490 self._request = new_value;
9491 self
9492 }
9493 /// The ID of the spreadsheet to update.
9494 ///
9495 /// Sets the *spreadsheet id* path property to the given value.
9496 ///
9497 /// Even though the property as already been set when instantiating this call,
9498 /// we provide this method for API completeness.
9499 pub fn spreadsheet_id(
9500 mut self,
9501 new_value: &str,
9502 ) -> SpreadsheetValueBatchUpdateByDataFilterCall<'a, C> {
9503 self._spreadsheet_id = new_value.to_string();
9504 self
9505 }
9506 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9507 /// while executing the actual API request.
9508 ///
9509 /// ````text
9510 /// It should be used to handle progress information, and to implement a certain level of resilience.
9511 /// ````
9512 ///
9513 /// Sets the *delegate* property to the given value.
9514 pub fn delegate(
9515 mut self,
9516 new_value: &'a mut dyn common::Delegate,
9517 ) -> SpreadsheetValueBatchUpdateByDataFilterCall<'a, C> {
9518 self._delegate = Some(new_value);
9519 self
9520 }
9521
9522 /// Set any additional parameter of the query string used in the request.
9523 /// It should be used to set parameters which are not yet available through their own
9524 /// setters.
9525 ///
9526 /// Please note that this method must not be used to set any of the known parameters
9527 /// which have their own setter method. If done anyway, the request will fail.
9528 ///
9529 /// # Additional Parameters
9530 ///
9531 /// * *$.xgafv* (query-string) - V1 error format.
9532 /// * *access_token* (query-string) - OAuth access token.
9533 /// * *alt* (query-string) - Data format for response.
9534 /// * *callback* (query-string) - JSONP
9535 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9536 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9537 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9538 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9539 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9540 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9541 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9542 pub fn param<T>(
9543 mut self,
9544 name: T,
9545 value: T,
9546 ) -> SpreadsheetValueBatchUpdateByDataFilterCall<'a, C>
9547 where
9548 T: AsRef<str>,
9549 {
9550 self._additional_params
9551 .insert(name.as_ref().to_string(), value.as_ref().to_string());
9552 self
9553 }
9554
9555 /// Identifies the authorization scope for the method you are building.
9556 ///
9557 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9558 /// [`Scope::Drive`].
9559 ///
9560 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9561 /// tokens for more than one scope.
9562 ///
9563 /// Usually there is more than one suitable scope to authorize an operation, some of which may
9564 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9565 /// sufficient, a read-write scope will do as well.
9566 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueBatchUpdateByDataFilterCall<'a, C>
9567 where
9568 St: AsRef<str>,
9569 {
9570 self._scopes.insert(String::from(scope.as_ref()));
9571 self
9572 }
9573 /// Identifies the authorization scope(s) for the method you are building.
9574 ///
9575 /// See [`Self::add_scope()`] for details.
9576 pub fn add_scopes<I, St>(
9577 mut self,
9578 scopes: I,
9579 ) -> SpreadsheetValueBatchUpdateByDataFilterCall<'a, C>
9580 where
9581 I: IntoIterator<Item = St>,
9582 St: AsRef<str>,
9583 {
9584 self._scopes
9585 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9586 self
9587 }
9588
9589 /// Removes all scopes, and no default scope will be used either.
9590 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9591 /// for details).
9592 pub fn clear_scopes(mut self) -> SpreadsheetValueBatchUpdateByDataFilterCall<'a, C> {
9593 self._scopes.clear();
9594 self
9595 }
9596}
9597
9598/// 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.
9599///
9600/// A builder for the *values.clear* method supported by a *spreadsheet* resource.
9601/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
9602///
9603/// # Example
9604///
9605/// Instantiate a resource method builder
9606///
9607/// ```test_harness,no_run
9608/// # extern crate hyper;
9609/// # extern crate hyper_rustls;
9610/// # extern crate google_sheets4 as sheets4;
9611/// use sheets4::api::ClearValuesRequest;
9612/// # async fn dox() {
9613/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9614///
9615/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9616/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
9617/// # secret,
9618/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9619/// # ).build().await.unwrap();
9620///
9621/// # let client = hyper_util::client::legacy::Client::builder(
9622/// # hyper_util::rt::TokioExecutor::new()
9623/// # )
9624/// # .build(
9625/// # hyper_rustls::HttpsConnectorBuilder::new()
9626/// # .with_native_roots()
9627/// # .unwrap()
9628/// # .https_or_http()
9629/// # .enable_http1()
9630/// # .build()
9631/// # );
9632/// # let mut hub = Sheets::new(client, auth);
9633/// // As the method needs a request, you would usually fill it with the desired information
9634/// // into the respective structure. Some of the parts shown here might not be applicable !
9635/// // Values shown here are possibly random and not representative !
9636/// let mut req = ClearValuesRequest::default();
9637///
9638/// // You can configure optional parameters by calling the respective setters at will, and
9639/// // execute the final call using `doit()`.
9640/// // Values shown here are possibly random and not representative !
9641/// let result = hub.spreadsheets().values_clear(req, "spreadsheetId", "range")
9642/// .doit().await;
9643/// # }
9644/// ```
9645pub struct SpreadsheetValueClearCall<'a, C>
9646where
9647 C: 'a,
9648{
9649 hub: &'a Sheets<C>,
9650 _request: ClearValuesRequest,
9651 _spreadsheet_id: String,
9652 _range: String,
9653 _delegate: Option<&'a mut dyn common::Delegate>,
9654 _additional_params: HashMap<String, String>,
9655 _scopes: BTreeSet<String>,
9656}
9657
9658impl<'a, C> common::CallBuilder for SpreadsheetValueClearCall<'a, C> {}
9659
9660impl<'a, C> SpreadsheetValueClearCall<'a, C>
9661where
9662 C: common::Connector,
9663{
9664 /// Perform the operation you have build so far.
9665 pub async fn doit(mut self) -> common::Result<(common::Response, ClearValuesResponse)> {
9666 use std::borrow::Cow;
9667 use std::io::{Read, Seek};
9668
9669 use common::{url::Params, ToParts};
9670 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9671
9672 let mut dd = common::DefaultDelegate;
9673 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9674 dlg.begin(common::MethodInfo {
9675 id: "sheets.spreadsheets.values.clear",
9676 http_method: hyper::Method::POST,
9677 });
9678
9679 for &field in ["alt", "spreadsheetId", "range"].iter() {
9680 if self._additional_params.contains_key(field) {
9681 dlg.finished(false);
9682 return Err(common::Error::FieldClash(field));
9683 }
9684 }
9685
9686 let mut params = Params::with_capacity(5 + self._additional_params.len());
9687 params.push("spreadsheetId", self._spreadsheet_id);
9688 params.push("range", self._range);
9689
9690 params.extend(self._additional_params.iter());
9691
9692 params.push("alt", "json");
9693 let mut url =
9694 self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}/values/{range}:clear";
9695 if self._scopes.is_empty() {
9696 self._scopes.insert(Scope::Drive.as_ref().to_string());
9697 }
9698
9699 #[allow(clippy::single_element_loop)]
9700 for &(find_this, param_name) in
9701 [("{spreadsheetId}", "spreadsheetId"), ("{range}", "range")].iter()
9702 {
9703 url = params.uri_replacement(url, param_name, find_this, false);
9704 }
9705 {
9706 let to_remove = ["range", "spreadsheetId"];
9707 params.remove_params(&to_remove);
9708 }
9709
9710 let url = params.parse_with_url(&url);
9711
9712 let mut json_mime_type = mime::APPLICATION_JSON;
9713 let mut request_value_reader = {
9714 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
9715 common::remove_json_null_values(&mut value);
9716 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
9717 serde_json::to_writer(&mut dst, &value).unwrap();
9718 dst
9719 };
9720 let request_size = request_value_reader
9721 .seek(std::io::SeekFrom::End(0))
9722 .unwrap();
9723 request_value_reader
9724 .seek(std::io::SeekFrom::Start(0))
9725 .unwrap();
9726
9727 loop {
9728 let token = match self
9729 .hub
9730 .auth
9731 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9732 .await
9733 {
9734 Ok(token) => token,
9735 Err(e) => match dlg.token(e) {
9736 Ok(token) => token,
9737 Err(e) => {
9738 dlg.finished(false);
9739 return Err(common::Error::MissingToken(e));
9740 }
9741 },
9742 };
9743 request_value_reader
9744 .seek(std::io::SeekFrom::Start(0))
9745 .unwrap();
9746 let mut req_result = {
9747 let client = &self.hub.client;
9748 dlg.pre_request();
9749 let mut req_builder = hyper::Request::builder()
9750 .method(hyper::Method::POST)
9751 .uri(url.as_str())
9752 .header(USER_AGENT, self.hub._user_agent.clone());
9753
9754 if let Some(token) = token.as_ref() {
9755 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9756 }
9757
9758 let request = req_builder
9759 .header(CONTENT_TYPE, json_mime_type.to_string())
9760 .header(CONTENT_LENGTH, request_size as u64)
9761 .body(common::to_body(
9762 request_value_reader.get_ref().clone().into(),
9763 ));
9764
9765 client.request(request.unwrap()).await
9766 };
9767
9768 match req_result {
9769 Err(err) => {
9770 if let common::Retry::After(d) = dlg.http_error(&err) {
9771 sleep(d).await;
9772 continue;
9773 }
9774 dlg.finished(false);
9775 return Err(common::Error::HttpError(err));
9776 }
9777 Ok(res) => {
9778 let (mut parts, body) = res.into_parts();
9779 let mut body = common::Body::new(body);
9780 if !parts.status.is_success() {
9781 let bytes = common::to_bytes(body).await.unwrap_or_default();
9782 let error = serde_json::from_str(&common::to_string(&bytes));
9783 let response = common::to_response(parts, bytes.into());
9784
9785 if let common::Retry::After(d) =
9786 dlg.http_failure(&response, error.as_ref().ok())
9787 {
9788 sleep(d).await;
9789 continue;
9790 }
9791
9792 dlg.finished(false);
9793
9794 return Err(match error {
9795 Ok(value) => common::Error::BadRequest(value),
9796 _ => common::Error::Failure(response),
9797 });
9798 }
9799 let response = {
9800 let bytes = common::to_bytes(body).await.unwrap_or_default();
9801 let encoded = common::to_string(&bytes);
9802 match serde_json::from_str(&encoded) {
9803 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9804 Err(error) => {
9805 dlg.response_json_decode_error(&encoded, &error);
9806 return Err(common::Error::JsonDecodeError(
9807 encoded.to_string(),
9808 error,
9809 ));
9810 }
9811 }
9812 };
9813
9814 dlg.finished(true);
9815 return Ok(response);
9816 }
9817 }
9818 }
9819 }
9820
9821 ///
9822 /// Sets the *request* property to the given value.
9823 ///
9824 /// Even though the property as already been set when instantiating this call,
9825 /// we provide this method for API completeness.
9826 pub fn request(mut self, new_value: ClearValuesRequest) -> SpreadsheetValueClearCall<'a, C> {
9827 self._request = new_value;
9828 self
9829 }
9830 /// The ID of the spreadsheet to update.
9831 ///
9832 /// Sets the *spreadsheet id* path property to the given value.
9833 ///
9834 /// Even though the property as already been set when instantiating this call,
9835 /// we provide this method for API completeness.
9836 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetValueClearCall<'a, C> {
9837 self._spreadsheet_id = new_value.to_string();
9838 self
9839 }
9840 /// The [A1 notation or R1C1 notation](https://developers.google.com/sheets/api/guides/concepts#cell) of the values to clear.
9841 ///
9842 /// Sets the *range* path property to the given value.
9843 ///
9844 /// Even though the property as already been set when instantiating this call,
9845 /// we provide this method for API completeness.
9846 pub fn range(mut self, new_value: &str) -> SpreadsheetValueClearCall<'a, C> {
9847 self._range = new_value.to_string();
9848 self
9849 }
9850 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9851 /// while executing the actual API request.
9852 ///
9853 /// ````text
9854 /// It should be used to handle progress information, and to implement a certain level of resilience.
9855 /// ````
9856 ///
9857 /// Sets the *delegate* property to the given value.
9858 pub fn delegate(
9859 mut self,
9860 new_value: &'a mut dyn common::Delegate,
9861 ) -> SpreadsheetValueClearCall<'a, C> {
9862 self._delegate = Some(new_value);
9863 self
9864 }
9865
9866 /// Set any additional parameter of the query string used in the request.
9867 /// It should be used to set parameters which are not yet available through their own
9868 /// setters.
9869 ///
9870 /// Please note that this method must not be used to set any of the known parameters
9871 /// which have their own setter method. If done anyway, the request will fail.
9872 ///
9873 /// # Additional Parameters
9874 ///
9875 /// * *$.xgafv* (query-string) - V1 error format.
9876 /// * *access_token* (query-string) - OAuth access token.
9877 /// * *alt* (query-string) - Data format for response.
9878 /// * *callback* (query-string) - JSONP
9879 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9880 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9881 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9882 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9883 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9884 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9885 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9886 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetValueClearCall<'a, C>
9887 where
9888 T: AsRef<str>,
9889 {
9890 self._additional_params
9891 .insert(name.as_ref().to_string(), value.as_ref().to_string());
9892 self
9893 }
9894
9895 /// Identifies the authorization scope for the method you are building.
9896 ///
9897 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9898 /// [`Scope::Drive`].
9899 ///
9900 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9901 /// tokens for more than one scope.
9902 ///
9903 /// Usually there is more than one suitable scope to authorize an operation, some of which may
9904 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9905 /// sufficient, a read-write scope will do as well.
9906 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueClearCall<'a, C>
9907 where
9908 St: AsRef<str>,
9909 {
9910 self._scopes.insert(String::from(scope.as_ref()));
9911 self
9912 }
9913 /// Identifies the authorization scope(s) for the method you are building.
9914 ///
9915 /// See [`Self::add_scope()`] for details.
9916 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetValueClearCall<'a, C>
9917 where
9918 I: IntoIterator<Item = St>,
9919 St: AsRef<str>,
9920 {
9921 self._scopes
9922 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9923 self
9924 }
9925
9926 /// Removes all scopes, and no default scope will be used either.
9927 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9928 /// for details).
9929 pub fn clear_scopes(mut self) -> SpreadsheetValueClearCall<'a, C> {
9930 self._scopes.clear();
9931 self
9932 }
9933}
9934
9935/// Returns a range of values from a spreadsheet. The caller must specify the spreadsheet ID and a range.
9936///
9937/// A builder for the *values.get* method supported by a *spreadsheet* resource.
9938/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
9939///
9940/// # Example
9941///
9942/// Instantiate a resource method builder
9943///
9944/// ```test_harness,no_run
9945/// # extern crate hyper;
9946/// # extern crate hyper_rustls;
9947/// # extern crate google_sheets4 as sheets4;
9948/// # async fn dox() {
9949/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9950///
9951/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9952/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
9953/// # secret,
9954/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9955/// # ).build().await.unwrap();
9956///
9957/// # let client = hyper_util::client::legacy::Client::builder(
9958/// # hyper_util::rt::TokioExecutor::new()
9959/// # )
9960/// # .build(
9961/// # hyper_rustls::HttpsConnectorBuilder::new()
9962/// # .with_native_roots()
9963/// # .unwrap()
9964/// # .https_or_http()
9965/// # .enable_http1()
9966/// # .build()
9967/// # );
9968/// # let mut hub = Sheets::new(client, auth);
9969/// // You can configure optional parameters by calling the respective setters at will, and
9970/// // execute the final call using `doit()`.
9971/// // Values shown here are possibly random and not representative !
9972/// let result = hub.spreadsheets().values_get("spreadsheetId", "range")
9973/// .value_render_option("erat")
9974/// .major_dimension("sed")
9975/// .date_time_render_option("duo")
9976/// .doit().await;
9977/// # }
9978/// ```
9979pub struct SpreadsheetValueGetCall<'a, C>
9980where
9981 C: 'a,
9982{
9983 hub: &'a Sheets<C>,
9984 _spreadsheet_id: String,
9985 _range: String,
9986 _value_render_option: Option<String>,
9987 _major_dimension: Option<String>,
9988 _date_time_render_option: Option<String>,
9989 _delegate: Option<&'a mut dyn common::Delegate>,
9990 _additional_params: HashMap<String, String>,
9991 _scopes: BTreeSet<String>,
9992}
9993
9994impl<'a, C> common::CallBuilder for SpreadsheetValueGetCall<'a, C> {}
9995
9996impl<'a, C> SpreadsheetValueGetCall<'a, C>
9997where
9998 C: common::Connector,
9999{
10000 /// Perform the operation you have build so far.
10001 pub async fn doit(mut self) -> common::Result<(common::Response, ValueRange)> {
10002 use std::borrow::Cow;
10003 use std::io::{Read, Seek};
10004
10005 use common::{url::Params, ToParts};
10006 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10007
10008 let mut dd = common::DefaultDelegate;
10009 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10010 dlg.begin(common::MethodInfo {
10011 id: "sheets.spreadsheets.values.get",
10012 http_method: hyper::Method::GET,
10013 });
10014
10015 for &field in [
10016 "alt",
10017 "spreadsheetId",
10018 "range",
10019 "valueRenderOption",
10020 "majorDimension",
10021 "dateTimeRenderOption",
10022 ]
10023 .iter()
10024 {
10025 if self._additional_params.contains_key(field) {
10026 dlg.finished(false);
10027 return Err(common::Error::FieldClash(field));
10028 }
10029 }
10030
10031 let mut params = Params::with_capacity(7 + self._additional_params.len());
10032 params.push("spreadsheetId", self._spreadsheet_id);
10033 params.push("range", self._range);
10034 if let Some(value) = self._value_render_option.as_ref() {
10035 params.push("valueRenderOption", value);
10036 }
10037 if let Some(value) = self._major_dimension.as_ref() {
10038 params.push("majorDimension", value);
10039 }
10040 if let Some(value) = self._date_time_render_option.as_ref() {
10041 params.push("dateTimeRenderOption", value);
10042 }
10043
10044 params.extend(self._additional_params.iter());
10045
10046 params.push("alt", "json");
10047 let mut url = self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}/values/{range}";
10048 if self._scopes.is_empty() {
10049 self._scopes
10050 .insert(Scope::DriveReadonly.as_ref().to_string());
10051 }
10052
10053 #[allow(clippy::single_element_loop)]
10054 for &(find_this, param_name) in
10055 [("{spreadsheetId}", "spreadsheetId"), ("{range}", "range")].iter()
10056 {
10057 url = params.uri_replacement(url, param_name, find_this, false);
10058 }
10059 {
10060 let to_remove = ["range", "spreadsheetId"];
10061 params.remove_params(&to_remove);
10062 }
10063
10064 let url = params.parse_with_url(&url);
10065
10066 loop {
10067 let token = match self
10068 .hub
10069 .auth
10070 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10071 .await
10072 {
10073 Ok(token) => token,
10074 Err(e) => match dlg.token(e) {
10075 Ok(token) => token,
10076 Err(e) => {
10077 dlg.finished(false);
10078 return Err(common::Error::MissingToken(e));
10079 }
10080 },
10081 };
10082 let mut req_result = {
10083 let client = &self.hub.client;
10084 dlg.pre_request();
10085 let mut req_builder = hyper::Request::builder()
10086 .method(hyper::Method::GET)
10087 .uri(url.as_str())
10088 .header(USER_AGENT, self.hub._user_agent.clone());
10089
10090 if let Some(token) = token.as_ref() {
10091 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10092 }
10093
10094 let request = req_builder
10095 .header(CONTENT_LENGTH, 0_u64)
10096 .body(common::to_body::<String>(None));
10097
10098 client.request(request.unwrap()).await
10099 };
10100
10101 match req_result {
10102 Err(err) => {
10103 if let common::Retry::After(d) = dlg.http_error(&err) {
10104 sleep(d).await;
10105 continue;
10106 }
10107 dlg.finished(false);
10108 return Err(common::Error::HttpError(err));
10109 }
10110 Ok(res) => {
10111 let (mut parts, body) = res.into_parts();
10112 let mut body = common::Body::new(body);
10113 if !parts.status.is_success() {
10114 let bytes = common::to_bytes(body).await.unwrap_or_default();
10115 let error = serde_json::from_str(&common::to_string(&bytes));
10116 let response = common::to_response(parts, bytes.into());
10117
10118 if let common::Retry::After(d) =
10119 dlg.http_failure(&response, error.as_ref().ok())
10120 {
10121 sleep(d).await;
10122 continue;
10123 }
10124
10125 dlg.finished(false);
10126
10127 return Err(match error {
10128 Ok(value) => common::Error::BadRequest(value),
10129 _ => common::Error::Failure(response),
10130 });
10131 }
10132 let response = {
10133 let bytes = common::to_bytes(body).await.unwrap_or_default();
10134 let encoded = common::to_string(&bytes);
10135 match serde_json::from_str(&encoded) {
10136 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10137 Err(error) => {
10138 dlg.response_json_decode_error(&encoded, &error);
10139 return Err(common::Error::JsonDecodeError(
10140 encoded.to_string(),
10141 error,
10142 ));
10143 }
10144 }
10145 };
10146
10147 dlg.finished(true);
10148 return Ok(response);
10149 }
10150 }
10151 }
10152 }
10153
10154 /// The ID of the spreadsheet to retrieve data from.
10155 ///
10156 /// Sets the *spreadsheet id* path property to the given value.
10157 ///
10158 /// Even though the property as already been set when instantiating this call,
10159 /// we provide this method for API completeness.
10160 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetValueGetCall<'a, C> {
10161 self._spreadsheet_id = new_value.to_string();
10162 self
10163 }
10164 /// The [A1 notation or R1C1 notation](https://developers.google.com/sheets/api/guides/concepts#cell) of the range to retrieve values from.
10165 ///
10166 /// Sets the *range* path property to the given value.
10167 ///
10168 /// Even though the property as already been set when instantiating this call,
10169 /// we provide this method for API completeness.
10170 pub fn range(mut self, new_value: &str) -> SpreadsheetValueGetCall<'a, C> {
10171 self._range = new_value.to_string();
10172 self
10173 }
10174 /// How values should be represented in the output. The default render option is FORMATTED_VALUE.
10175 ///
10176 /// Sets the *value render option* query property to the given value.
10177 pub fn value_render_option(mut self, new_value: &str) -> SpreadsheetValueGetCall<'a, C> {
10178 self._value_render_option = Some(new_value.to_string());
10179 self
10180 }
10181 /// 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]]`.
10182 ///
10183 /// Sets the *major dimension* query property to the given value.
10184 pub fn major_dimension(mut self, new_value: &str) -> SpreadsheetValueGetCall<'a, C> {
10185 self._major_dimension = Some(new_value.to_string());
10186 self
10187 }
10188 /// 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.
10189 ///
10190 /// Sets the *date time render option* query property to the given value.
10191 pub fn date_time_render_option(mut self, new_value: &str) -> SpreadsheetValueGetCall<'a, C> {
10192 self._date_time_render_option = Some(new_value.to_string());
10193 self
10194 }
10195 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10196 /// while executing the actual API request.
10197 ///
10198 /// ````text
10199 /// It should be used to handle progress information, and to implement a certain level of resilience.
10200 /// ````
10201 ///
10202 /// Sets the *delegate* property to the given value.
10203 pub fn delegate(
10204 mut self,
10205 new_value: &'a mut dyn common::Delegate,
10206 ) -> SpreadsheetValueGetCall<'a, C> {
10207 self._delegate = Some(new_value);
10208 self
10209 }
10210
10211 /// Set any additional parameter of the query string used in the request.
10212 /// It should be used to set parameters which are not yet available through their own
10213 /// setters.
10214 ///
10215 /// Please note that this method must not be used to set any of the known parameters
10216 /// which have their own setter method. If done anyway, the request will fail.
10217 ///
10218 /// # Additional Parameters
10219 ///
10220 /// * *$.xgafv* (query-string) - V1 error format.
10221 /// * *access_token* (query-string) - OAuth access token.
10222 /// * *alt* (query-string) - Data format for response.
10223 /// * *callback* (query-string) - JSONP
10224 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10225 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10226 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10227 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10228 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10229 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10230 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10231 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetValueGetCall<'a, C>
10232 where
10233 T: AsRef<str>,
10234 {
10235 self._additional_params
10236 .insert(name.as_ref().to_string(), value.as_ref().to_string());
10237 self
10238 }
10239
10240 /// Identifies the authorization scope for the method you are building.
10241 ///
10242 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10243 /// [`Scope::DriveReadonly`].
10244 ///
10245 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10246 /// tokens for more than one scope.
10247 ///
10248 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10249 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10250 /// sufficient, a read-write scope will do as well.
10251 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueGetCall<'a, C>
10252 where
10253 St: AsRef<str>,
10254 {
10255 self._scopes.insert(String::from(scope.as_ref()));
10256 self
10257 }
10258 /// Identifies the authorization scope(s) for the method you are building.
10259 ///
10260 /// See [`Self::add_scope()`] for details.
10261 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetValueGetCall<'a, C>
10262 where
10263 I: IntoIterator<Item = St>,
10264 St: AsRef<str>,
10265 {
10266 self._scopes
10267 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10268 self
10269 }
10270
10271 /// Removes all scopes, and no default scope will be used either.
10272 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10273 /// for details).
10274 pub fn clear_scopes(mut self) -> SpreadsheetValueGetCall<'a, C> {
10275 self._scopes.clear();
10276 self
10277 }
10278}
10279
10280/// Sets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a valueInputOption.
10281///
10282/// A builder for the *values.update* method supported by a *spreadsheet* resource.
10283/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
10284///
10285/// # Example
10286///
10287/// Instantiate a resource method builder
10288///
10289/// ```test_harness,no_run
10290/// # extern crate hyper;
10291/// # extern crate hyper_rustls;
10292/// # extern crate google_sheets4 as sheets4;
10293/// use sheets4::api::ValueRange;
10294/// # async fn dox() {
10295/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10296///
10297/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10298/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
10299/// # secret,
10300/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10301/// # ).build().await.unwrap();
10302///
10303/// # let client = hyper_util::client::legacy::Client::builder(
10304/// # hyper_util::rt::TokioExecutor::new()
10305/// # )
10306/// # .build(
10307/// # hyper_rustls::HttpsConnectorBuilder::new()
10308/// # .with_native_roots()
10309/// # .unwrap()
10310/// # .https_or_http()
10311/// # .enable_http1()
10312/// # .build()
10313/// # );
10314/// # let mut hub = Sheets::new(client, auth);
10315/// // As the method needs a request, you would usually fill it with the desired information
10316/// // into the respective structure. Some of the parts shown here might not be applicable !
10317/// // Values shown here are possibly random and not representative !
10318/// let mut req = ValueRange::default();
10319///
10320/// // You can configure optional parameters by calling the respective setters at will, and
10321/// // execute the final call using `doit()`.
10322/// // Values shown here are possibly random and not representative !
10323/// let result = hub.spreadsheets().values_update(req, "spreadsheetId", "range")
10324/// .value_input_option("voluptua.")
10325/// .response_value_render_option("amet.")
10326/// .response_date_time_render_option("consetetur")
10327/// .include_values_in_response(false)
10328/// .doit().await;
10329/// # }
10330/// ```
10331pub struct SpreadsheetValueUpdateCall<'a, C>
10332where
10333 C: 'a,
10334{
10335 hub: &'a Sheets<C>,
10336 _request: ValueRange,
10337 _spreadsheet_id: String,
10338 _range: String,
10339 _value_input_option: Option<String>,
10340 _response_value_render_option: Option<String>,
10341 _response_date_time_render_option: Option<String>,
10342 _include_values_in_response: Option<bool>,
10343 _delegate: Option<&'a mut dyn common::Delegate>,
10344 _additional_params: HashMap<String, String>,
10345 _scopes: BTreeSet<String>,
10346}
10347
10348impl<'a, C> common::CallBuilder for SpreadsheetValueUpdateCall<'a, C> {}
10349
10350impl<'a, C> SpreadsheetValueUpdateCall<'a, C>
10351where
10352 C: common::Connector,
10353{
10354 /// Perform the operation you have build so far.
10355 pub async fn doit(mut self) -> common::Result<(common::Response, UpdateValuesResponse)> {
10356 use std::borrow::Cow;
10357 use std::io::{Read, Seek};
10358
10359 use common::{url::Params, ToParts};
10360 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10361
10362 let mut dd = common::DefaultDelegate;
10363 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10364 dlg.begin(common::MethodInfo {
10365 id: "sheets.spreadsheets.values.update",
10366 http_method: hyper::Method::PUT,
10367 });
10368
10369 for &field in [
10370 "alt",
10371 "spreadsheetId",
10372 "range",
10373 "valueInputOption",
10374 "responseValueRenderOption",
10375 "responseDateTimeRenderOption",
10376 "includeValuesInResponse",
10377 ]
10378 .iter()
10379 {
10380 if self._additional_params.contains_key(field) {
10381 dlg.finished(false);
10382 return Err(common::Error::FieldClash(field));
10383 }
10384 }
10385
10386 let mut params = Params::with_capacity(9 + self._additional_params.len());
10387 params.push("spreadsheetId", self._spreadsheet_id);
10388 params.push("range", self._range);
10389 if let Some(value) = self._value_input_option.as_ref() {
10390 params.push("valueInputOption", value);
10391 }
10392 if let Some(value) = self._response_value_render_option.as_ref() {
10393 params.push("responseValueRenderOption", value);
10394 }
10395 if let Some(value) = self._response_date_time_render_option.as_ref() {
10396 params.push("responseDateTimeRenderOption", value);
10397 }
10398 if let Some(value) = self._include_values_in_response.as_ref() {
10399 params.push("includeValuesInResponse", value.to_string());
10400 }
10401
10402 params.extend(self._additional_params.iter());
10403
10404 params.push("alt", "json");
10405 let mut url = self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}/values/{range}";
10406 if self._scopes.is_empty() {
10407 self._scopes.insert(Scope::Drive.as_ref().to_string());
10408 }
10409
10410 #[allow(clippy::single_element_loop)]
10411 for &(find_this, param_name) in
10412 [("{spreadsheetId}", "spreadsheetId"), ("{range}", "range")].iter()
10413 {
10414 url = params.uri_replacement(url, param_name, find_this, false);
10415 }
10416 {
10417 let to_remove = ["range", "spreadsheetId"];
10418 params.remove_params(&to_remove);
10419 }
10420
10421 let url = params.parse_with_url(&url);
10422
10423 let mut json_mime_type = mime::APPLICATION_JSON;
10424 let mut request_value_reader = {
10425 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
10426 common::remove_json_null_values(&mut value);
10427 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
10428 serde_json::to_writer(&mut dst, &value).unwrap();
10429 dst
10430 };
10431 let request_size = request_value_reader
10432 .seek(std::io::SeekFrom::End(0))
10433 .unwrap();
10434 request_value_reader
10435 .seek(std::io::SeekFrom::Start(0))
10436 .unwrap();
10437
10438 loop {
10439 let token = match self
10440 .hub
10441 .auth
10442 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10443 .await
10444 {
10445 Ok(token) => token,
10446 Err(e) => match dlg.token(e) {
10447 Ok(token) => token,
10448 Err(e) => {
10449 dlg.finished(false);
10450 return Err(common::Error::MissingToken(e));
10451 }
10452 },
10453 };
10454 request_value_reader
10455 .seek(std::io::SeekFrom::Start(0))
10456 .unwrap();
10457 let mut req_result = {
10458 let client = &self.hub.client;
10459 dlg.pre_request();
10460 let mut req_builder = hyper::Request::builder()
10461 .method(hyper::Method::PUT)
10462 .uri(url.as_str())
10463 .header(USER_AGENT, self.hub._user_agent.clone());
10464
10465 if let Some(token) = token.as_ref() {
10466 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10467 }
10468
10469 let request = req_builder
10470 .header(CONTENT_TYPE, json_mime_type.to_string())
10471 .header(CONTENT_LENGTH, request_size as u64)
10472 .body(common::to_body(
10473 request_value_reader.get_ref().clone().into(),
10474 ));
10475
10476 client.request(request.unwrap()).await
10477 };
10478
10479 match req_result {
10480 Err(err) => {
10481 if let common::Retry::After(d) = dlg.http_error(&err) {
10482 sleep(d).await;
10483 continue;
10484 }
10485 dlg.finished(false);
10486 return Err(common::Error::HttpError(err));
10487 }
10488 Ok(res) => {
10489 let (mut parts, body) = res.into_parts();
10490 let mut body = common::Body::new(body);
10491 if !parts.status.is_success() {
10492 let bytes = common::to_bytes(body).await.unwrap_or_default();
10493 let error = serde_json::from_str(&common::to_string(&bytes));
10494 let response = common::to_response(parts, bytes.into());
10495
10496 if let common::Retry::After(d) =
10497 dlg.http_failure(&response, error.as_ref().ok())
10498 {
10499 sleep(d).await;
10500 continue;
10501 }
10502
10503 dlg.finished(false);
10504
10505 return Err(match error {
10506 Ok(value) => common::Error::BadRequest(value),
10507 _ => common::Error::Failure(response),
10508 });
10509 }
10510 let response = {
10511 let bytes = common::to_bytes(body).await.unwrap_or_default();
10512 let encoded = common::to_string(&bytes);
10513 match serde_json::from_str(&encoded) {
10514 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10515 Err(error) => {
10516 dlg.response_json_decode_error(&encoded, &error);
10517 return Err(common::Error::JsonDecodeError(
10518 encoded.to_string(),
10519 error,
10520 ));
10521 }
10522 }
10523 };
10524
10525 dlg.finished(true);
10526 return Ok(response);
10527 }
10528 }
10529 }
10530 }
10531
10532 ///
10533 /// Sets the *request* property to the given value.
10534 ///
10535 /// Even though the property as already been set when instantiating this call,
10536 /// we provide this method for API completeness.
10537 pub fn request(mut self, new_value: ValueRange) -> SpreadsheetValueUpdateCall<'a, C> {
10538 self._request = new_value;
10539 self
10540 }
10541 /// The ID of the spreadsheet to update.
10542 ///
10543 /// Sets the *spreadsheet id* path property to the given value.
10544 ///
10545 /// Even though the property as already been set when instantiating this call,
10546 /// we provide this method for API completeness.
10547 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetValueUpdateCall<'a, C> {
10548 self._spreadsheet_id = new_value.to_string();
10549 self
10550 }
10551 /// The [A1 notation](https://developers.google.com/sheets/api/guides/concepts#cell) of the values to update.
10552 ///
10553 /// Sets the *range* path property to the given value.
10554 ///
10555 /// Even though the property as already been set when instantiating this call,
10556 /// we provide this method for API completeness.
10557 pub fn range(mut self, new_value: &str) -> SpreadsheetValueUpdateCall<'a, C> {
10558 self._range = new_value.to_string();
10559 self
10560 }
10561 /// How the input data should be interpreted.
10562 ///
10563 /// Sets the *value input option* query property to the given value.
10564 pub fn value_input_option(mut self, new_value: &str) -> SpreadsheetValueUpdateCall<'a, C> {
10565 self._value_input_option = Some(new_value.to_string());
10566 self
10567 }
10568 /// Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
10569 ///
10570 /// Sets the *response value render option* query property to the given value.
10571 pub fn response_value_render_option(
10572 mut self,
10573 new_value: &str,
10574 ) -> SpreadsheetValueUpdateCall<'a, C> {
10575 self._response_value_render_option = Some(new_value.to_string());
10576 self
10577 }
10578 /// 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.
10579 ///
10580 /// Sets the *response date time render option* query property to the given value.
10581 pub fn response_date_time_render_option(
10582 mut self,
10583 new_value: &str,
10584 ) -> SpreadsheetValueUpdateCall<'a, C> {
10585 self._response_date_time_render_option = Some(new_value.to_string());
10586 self
10587 }
10588 /// 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).
10589 ///
10590 /// Sets the *include values in response* query property to the given value.
10591 pub fn include_values_in_response(
10592 mut self,
10593 new_value: bool,
10594 ) -> SpreadsheetValueUpdateCall<'a, C> {
10595 self._include_values_in_response = Some(new_value);
10596 self
10597 }
10598 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10599 /// while executing the actual API request.
10600 ///
10601 /// ````text
10602 /// It should be used to handle progress information, and to implement a certain level of resilience.
10603 /// ````
10604 ///
10605 /// Sets the *delegate* property to the given value.
10606 pub fn delegate(
10607 mut self,
10608 new_value: &'a mut dyn common::Delegate,
10609 ) -> SpreadsheetValueUpdateCall<'a, C> {
10610 self._delegate = Some(new_value);
10611 self
10612 }
10613
10614 /// Set any additional parameter of the query string used in the request.
10615 /// It should be used to set parameters which are not yet available through their own
10616 /// setters.
10617 ///
10618 /// Please note that this method must not be used to set any of the known parameters
10619 /// which have their own setter method. If done anyway, the request will fail.
10620 ///
10621 /// # Additional Parameters
10622 ///
10623 /// * *$.xgafv* (query-string) - V1 error format.
10624 /// * *access_token* (query-string) - OAuth access token.
10625 /// * *alt* (query-string) - Data format for response.
10626 /// * *callback* (query-string) - JSONP
10627 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10628 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10629 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10630 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10631 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10632 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10633 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10634 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetValueUpdateCall<'a, C>
10635 where
10636 T: AsRef<str>,
10637 {
10638 self._additional_params
10639 .insert(name.as_ref().to_string(), value.as_ref().to_string());
10640 self
10641 }
10642
10643 /// Identifies the authorization scope for the method you are building.
10644 ///
10645 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10646 /// [`Scope::Drive`].
10647 ///
10648 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10649 /// tokens for more than one scope.
10650 ///
10651 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10652 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10653 /// sufficient, a read-write scope will do as well.
10654 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetValueUpdateCall<'a, C>
10655 where
10656 St: AsRef<str>,
10657 {
10658 self._scopes.insert(String::from(scope.as_ref()));
10659 self
10660 }
10661 /// Identifies the authorization scope(s) for the method you are building.
10662 ///
10663 /// See [`Self::add_scope()`] for details.
10664 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetValueUpdateCall<'a, C>
10665 where
10666 I: IntoIterator<Item = St>,
10667 St: AsRef<str>,
10668 {
10669 self._scopes
10670 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10671 self
10672 }
10673
10674 /// Removes all scopes, and no default scope will be used either.
10675 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10676 /// for details).
10677 pub fn clear_scopes(mut self) -> SpreadsheetValueUpdateCall<'a, C> {
10678 self._scopes.clear();
10679 self
10680 }
10681}
10682
10683/// 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.
10684///
10685/// A builder for the *batchUpdate* method supported by a *spreadsheet* resource.
10686/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
10687///
10688/// # Example
10689///
10690/// Instantiate a resource method builder
10691///
10692/// ```test_harness,no_run
10693/// # extern crate hyper;
10694/// # extern crate hyper_rustls;
10695/// # extern crate google_sheets4 as sheets4;
10696/// use sheets4::api::BatchUpdateSpreadsheetRequest;
10697/// # async fn dox() {
10698/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10699///
10700/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10701/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
10702/// # secret,
10703/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10704/// # ).build().await.unwrap();
10705///
10706/// # let client = hyper_util::client::legacy::Client::builder(
10707/// # hyper_util::rt::TokioExecutor::new()
10708/// # )
10709/// # .build(
10710/// # hyper_rustls::HttpsConnectorBuilder::new()
10711/// # .with_native_roots()
10712/// # .unwrap()
10713/// # .https_or_http()
10714/// # .enable_http1()
10715/// # .build()
10716/// # );
10717/// # let mut hub = Sheets::new(client, auth);
10718/// // As the method needs a request, you would usually fill it with the desired information
10719/// // into the respective structure. Some of the parts shown here might not be applicable !
10720/// // Values shown here are possibly random and not representative !
10721/// let mut req = BatchUpdateSpreadsheetRequest::default();
10722///
10723/// // You can configure optional parameters by calling the respective setters at will, and
10724/// // execute the final call using `doit()`.
10725/// // Values shown here are possibly random and not representative !
10726/// let result = hub.spreadsheets().batch_update(req, "spreadsheetId")
10727/// .doit().await;
10728/// # }
10729/// ```
10730pub struct SpreadsheetBatchUpdateCall<'a, C>
10731where
10732 C: 'a,
10733{
10734 hub: &'a Sheets<C>,
10735 _request: BatchUpdateSpreadsheetRequest,
10736 _spreadsheet_id: String,
10737 _delegate: Option<&'a mut dyn common::Delegate>,
10738 _additional_params: HashMap<String, String>,
10739 _scopes: BTreeSet<String>,
10740}
10741
10742impl<'a, C> common::CallBuilder for SpreadsheetBatchUpdateCall<'a, C> {}
10743
10744impl<'a, C> SpreadsheetBatchUpdateCall<'a, C>
10745where
10746 C: common::Connector,
10747{
10748 /// Perform the operation you have build so far.
10749 pub async fn doit(
10750 mut self,
10751 ) -> common::Result<(common::Response, BatchUpdateSpreadsheetResponse)> {
10752 use std::borrow::Cow;
10753 use std::io::{Read, Seek};
10754
10755 use common::{url::Params, ToParts};
10756 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10757
10758 let mut dd = common::DefaultDelegate;
10759 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10760 dlg.begin(common::MethodInfo {
10761 id: "sheets.spreadsheets.batchUpdate",
10762 http_method: hyper::Method::POST,
10763 });
10764
10765 for &field in ["alt", "spreadsheetId"].iter() {
10766 if self._additional_params.contains_key(field) {
10767 dlg.finished(false);
10768 return Err(common::Error::FieldClash(field));
10769 }
10770 }
10771
10772 let mut params = Params::with_capacity(4 + self._additional_params.len());
10773 params.push("spreadsheetId", self._spreadsheet_id);
10774
10775 params.extend(self._additional_params.iter());
10776
10777 params.push("alt", "json");
10778 let mut url = self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}:batchUpdate";
10779 if self._scopes.is_empty() {
10780 self._scopes.insert(Scope::Drive.as_ref().to_string());
10781 }
10782
10783 #[allow(clippy::single_element_loop)]
10784 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
10785 url = params.uri_replacement(url, param_name, find_this, false);
10786 }
10787 {
10788 let to_remove = ["spreadsheetId"];
10789 params.remove_params(&to_remove);
10790 }
10791
10792 let url = params.parse_with_url(&url);
10793
10794 let mut json_mime_type = mime::APPLICATION_JSON;
10795 let mut request_value_reader = {
10796 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
10797 common::remove_json_null_values(&mut value);
10798 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
10799 serde_json::to_writer(&mut dst, &value).unwrap();
10800 dst
10801 };
10802 let request_size = request_value_reader
10803 .seek(std::io::SeekFrom::End(0))
10804 .unwrap();
10805 request_value_reader
10806 .seek(std::io::SeekFrom::Start(0))
10807 .unwrap();
10808
10809 loop {
10810 let token = match self
10811 .hub
10812 .auth
10813 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10814 .await
10815 {
10816 Ok(token) => token,
10817 Err(e) => match dlg.token(e) {
10818 Ok(token) => token,
10819 Err(e) => {
10820 dlg.finished(false);
10821 return Err(common::Error::MissingToken(e));
10822 }
10823 },
10824 };
10825 request_value_reader
10826 .seek(std::io::SeekFrom::Start(0))
10827 .unwrap();
10828 let mut req_result = {
10829 let client = &self.hub.client;
10830 dlg.pre_request();
10831 let mut req_builder = hyper::Request::builder()
10832 .method(hyper::Method::POST)
10833 .uri(url.as_str())
10834 .header(USER_AGENT, self.hub._user_agent.clone());
10835
10836 if let Some(token) = token.as_ref() {
10837 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10838 }
10839
10840 let request = req_builder
10841 .header(CONTENT_TYPE, json_mime_type.to_string())
10842 .header(CONTENT_LENGTH, request_size as u64)
10843 .body(common::to_body(
10844 request_value_reader.get_ref().clone().into(),
10845 ));
10846
10847 client.request(request.unwrap()).await
10848 };
10849
10850 match req_result {
10851 Err(err) => {
10852 if let common::Retry::After(d) = dlg.http_error(&err) {
10853 sleep(d).await;
10854 continue;
10855 }
10856 dlg.finished(false);
10857 return Err(common::Error::HttpError(err));
10858 }
10859 Ok(res) => {
10860 let (mut parts, body) = res.into_parts();
10861 let mut body = common::Body::new(body);
10862 if !parts.status.is_success() {
10863 let bytes = common::to_bytes(body).await.unwrap_or_default();
10864 let error = serde_json::from_str(&common::to_string(&bytes));
10865 let response = common::to_response(parts, bytes.into());
10866
10867 if let common::Retry::After(d) =
10868 dlg.http_failure(&response, error.as_ref().ok())
10869 {
10870 sleep(d).await;
10871 continue;
10872 }
10873
10874 dlg.finished(false);
10875
10876 return Err(match error {
10877 Ok(value) => common::Error::BadRequest(value),
10878 _ => common::Error::Failure(response),
10879 });
10880 }
10881 let response = {
10882 let bytes = common::to_bytes(body).await.unwrap_or_default();
10883 let encoded = common::to_string(&bytes);
10884 match serde_json::from_str(&encoded) {
10885 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10886 Err(error) => {
10887 dlg.response_json_decode_error(&encoded, &error);
10888 return Err(common::Error::JsonDecodeError(
10889 encoded.to_string(),
10890 error,
10891 ));
10892 }
10893 }
10894 };
10895
10896 dlg.finished(true);
10897 return Ok(response);
10898 }
10899 }
10900 }
10901 }
10902
10903 ///
10904 /// Sets the *request* property to the given value.
10905 ///
10906 /// Even though the property as already been set when instantiating this call,
10907 /// we provide this method for API completeness.
10908 pub fn request(
10909 mut self,
10910 new_value: BatchUpdateSpreadsheetRequest,
10911 ) -> SpreadsheetBatchUpdateCall<'a, C> {
10912 self._request = new_value;
10913 self
10914 }
10915 /// The spreadsheet to apply the updates to.
10916 ///
10917 /// Sets the *spreadsheet id* path property to the given value.
10918 ///
10919 /// Even though the property as already been set when instantiating this call,
10920 /// we provide this method for API completeness.
10921 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetBatchUpdateCall<'a, C> {
10922 self._spreadsheet_id = new_value.to_string();
10923 self
10924 }
10925 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10926 /// while executing the actual API request.
10927 ///
10928 /// ````text
10929 /// It should be used to handle progress information, and to implement a certain level of resilience.
10930 /// ````
10931 ///
10932 /// Sets the *delegate* property to the given value.
10933 pub fn delegate(
10934 mut self,
10935 new_value: &'a mut dyn common::Delegate,
10936 ) -> SpreadsheetBatchUpdateCall<'a, C> {
10937 self._delegate = Some(new_value);
10938 self
10939 }
10940
10941 /// Set any additional parameter of the query string used in the request.
10942 /// It should be used to set parameters which are not yet available through their own
10943 /// setters.
10944 ///
10945 /// Please note that this method must not be used to set any of the known parameters
10946 /// which have their own setter method. If done anyway, the request will fail.
10947 ///
10948 /// # Additional Parameters
10949 ///
10950 /// * *$.xgafv* (query-string) - V1 error format.
10951 /// * *access_token* (query-string) - OAuth access token.
10952 /// * *alt* (query-string) - Data format for response.
10953 /// * *callback* (query-string) - JSONP
10954 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10955 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10956 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10957 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10958 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10959 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10960 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10961 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetBatchUpdateCall<'a, C>
10962 where
10963 T: AsRef<str>,
10964 {
10965 self._additional_params
10966 .insert(name.as_ref().to_string(), value.as_ref().to_string());
10967 self
10968 }
10969
10970 /// Identifies the authorization scope for the method you are building.
10971 ///
10972 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10973 /// [`Scope::Drive`].
10974 ///
10975 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10976 /// tokens for more than one scope.
10977 ///
10978 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10979 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10980 /// sufficient, a read-write scope will do as well.
10981 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetBatchUpdateCall<'a, C>
10982 where
10983 St: AsRef<str>,
10984 {
10985 self._scopes.insert(String::from(scope.as_ref()));
10986 self
10987 }
10988 /// Identifies the authorization scope(s) for the method you are building.
10989 ///
10990 /// See [`Self::add_scope()`] for details.
10991 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetBatchUpdateCall<'a, C>
10992 where
10993 I: IntoIterator<Item = St>,
10994 St: AsRef<str>,
10995 {
10996 self._scopes
10997 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10998 self
10999 }
11000
11001 /// Removes all scopes, and no default scope will be used either.
11002 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11003 /// for details).
11004 pub fn clear_scopes(mut self) -> SpreadsheetBatchUpdateCall<'a, C> {
11005 self._scopes.clear();
11006 self
11007 }
11008}
11009
11010/// Creates a spreadsheet, returning the newly created spreadsheet.
11011///
11012/// A builder for the *create* method supported by a *spreadsheet* resource.
11013/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
11014///
11015/// # Example
11016///
11017/// Instantiate a resource method builder
11018///
11019/// ```test_harness,no_run
11020/// # extern crate hyper;
11021/// # extern crate hyper_rustls;
11022/// # extern crate google_sheets4 as sheets4;
11023/// use sheets4::api::Spreadsheet;
11024/// # async fn dox() {
11025/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11026///
11027/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11028/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
11029/// # secret,
11030/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11031/// # ).build().await.unwrap();
11032///
11033/// # let client = hyper_util::client::legacy::Client::builder(
11034/// # hyper_util::rt::TokioExecutor::new()
11035/// # )
11036/// # .build(
11037/// # hyper_rustls::HttpsConnectorBuilder::new()
11038/// # .with_native_roots()
11039/// # .unwrap()
11040/// # .https_or_http()
11041/// # .enable_http1()
11042/// # .build()
11043/// # );
11044/// # let mut hub = Sheets::new(client, auth);
11045/// // As the method needs a request, you would usually fill it with the desired information
11046/// // into the respective structure. Some of the parts shown here might not be applicable !
11047/// // Values shown here are possibly random and not representative !
11048/// let mut req = Spreadsheet::default();
11049///
11050/// // You can configure optional parameters by calling the respective setters at will, and
11051/// // execute the final call using `doit()`.
11052/// // Values shown here are possibly random and not representative !
11053/// let result = hub.spreadsheets().create(req)
11054/// .doit().await;
11055/// # }
11056/// ```
11057pub struct SpreadsheetCreateCall<'a, C>
11058where
11059 C: 'a,
11060{
11061 hub: &'a Sheets<C>,
11062 _request: Spreadsheet,
11063 _delegate: Option<&'a mut dyn common::Delegate>,
11064 _additional_params: HashMap<String, String>,
11065 _scopes: BTreeSet<String>,
11066}
11067
11068impl<'a, C> common::CallBuilder for SpreadsheetCreateCall<'a, C> {}
11069
11070impl<'a, C> SpreadsheetCreateCall<'a, C>
11071where
11072 C: common::Connector,
11073{
11074 /// Perform the operation you have build so far.
11075 pub async fn doit(mut self) -> common::Result<(common::Response, Spreadsheet)> {
11076 use std::borrow::Cow;
11077 use std::io::{Read, Seek};
11078
11079 use common::{url::Params, ToParts};
11080 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11081
11082 let mut dd = common::DefaultDelegate;
11083 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11084 dlg.begin(common::MethodInfo {
11085 id: "sheets.spreadsheets.create",
11086 http_method: hyper::Method::POST,
11087 });
11088
11089 for &field in ["alt"].iter() {
11090 if self._additional_params.contains_key(field) {
11091 dlg.finished(false);
11092 return Err(common::Error::FieldClash(field));
11093 }
11094 }
11095
11096 let mut params = Params::with_capacity(3 + self._additional_params.len());
11097
11098 params.extend(self._additional_params.iter());
11099
11100 params.push("alt", "json");
11101 let mut url = self.hub._base_url.clone() + "v4/spreadsheets";
11102 if self._scopes.is_empty() {
11103 self._scopes.insert(Scope::Drive.as_ref().to_string());
11104 }
11105
11106 let url = params.parse_with_url(&url);
11107
11108 let mut json_mime_type = mime::APPLICATION_JSON;
11109 let mut request_value_reader = {
11110 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
11111 common::remove_json_null_values(&mut value);
11112 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
11113 serde_json::to_writer(&mut dst, &value).unwrap();
11114 dst
11115 };
11116 let request_size = request_value_reader
11117 .seek(std::io::SeekFrom::End(0))
11118 .unwrap();
11119 request_value_reader
11120 .seek(std::io::SeekFrom::Start(0))
11121 .unwrap();
11122
11123 loop {
11124 let token = match self
11125 .hub
11126 .auth
11127 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11128 .await
11129 {
11130 Ok(token) => token,
11131 Err(e) => match dlg.token(e) {
11132 Ok(token) => token,
11133 Err(e) => {
11134 dlg.finished(false);
11135 return Err(common::Error::MissingToken(e));
11136 }
11137 },
11138 };
11139 request_value_reader
11140 .seek(std::io::SeekFrom::Start(0))
11141 .unwrap();
11142 let mut req_result = {
11143 let client = &self.hub.client;
11144 dlg.pre_request();
11145 let mut req_builder = hyper::Request::builder()
11146 .method(hyper::Method::POST)
11147 .uri(url.as_str())
11148 .header(USER_AGENT, self.hub._user_agent.clone());
11149
11150 if let Some(token) = token.as_ref() {
11151 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11152 }
11153
11154 let request = req_builder
11155 .header(CONTENT_TYPE, json_mime_type.to_string())
11156 .header(CONTENT_LENGTH, request_size as u64)
11157 .body(common::to_body(
11158 request_value_reader.get_ref().clone().into(),
11159 ));
11160
11161 client.request(request.unwrap()).await
11162 };
11163
11164 match req_result {
11165 Err(err) => {
11166 if let common::Retry::After(d) = dlg.http_error(&err) {
11167 sleep(d).await;
11168 continue;
11169 }
11170 dlg.finished(false);
11171 return Err(common::Error::HttpError(err));
11172 }
11173 Ok(res) => {
11174 let (mut parts, body) = res.into_parts();
11175 let mut body = common::Body::new(body);
11176 if !parts.status.is_success() {
11177 let bytes = common::to_bytes(body).await.unwrap_or_default();
11178 let error = serde_json::from_str(&common::to_string(&bytes));
11179 let response = common::to_response(parts, bytes.into());
11180
11181 if let common::Retry::After(d) =
11182 dlg.http_failure(&response, error.as_ref().ok())
11183 {
11184 sleep(d).await;
11185 continue;
11186 }
11187
11188 dlg.finished(false);
11189
11190 return Err(match error {
11191 Ok(value) => common::Error::BadRequest(value),
11192 _ => common::Error::Failure(response),
11193 });
11194 }
11195 let response = {
11196 let bytes = common::to_bytes(body).await.unwrap_or_default();
11197 let encoded = common::to_string(&bytes);
11198 match serde_json::from_str(&encoded) {
11199 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11200 Err(error) => {
11201 dlg.response_json_decode_error(&encoded, &error);
11202 return Err(common::Error::JsonDecodeError(
11203 encoded.to_string(),
11204 error,
11205 ));
11206 }
11207 }
11208 };
11209
11210 dlg.finished(true);
11211 return Ok(response);
11212 }
11213 }
11214 }
11215 }
11216
11217 ///
11218 /// Sets the *request* property to the given value.
11219 ///
11220 /// Even though the property as already been set when instantiating this call,
11221 /// we provide this method for API completeness.
11222 pub fn request(mut self, new_value: Spreadsheet) -> SpreadsheetCreateCall<'a, C> {
11223 self._request = new_value;
11224 self
11225 }
11226 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11227 /// while executing the actual API request.
11228 ///
11229 /// ````text
11230 /// It should be used to handle progress information, and to implement a certain level of resilience.
11231 /// ````
11232 ///
11233 /// Sets the *delegate* property to the given value.
11234 pub fn delegate(
11235 mut self,
11236 new_value: &'a mut dyn common::Delegate,
11237 ) -> SpreadsheetCreateCall<'a, C> {
11238 self._delegate = Some(new_value);
11239 self
11240 }
11241
11242 /// Set any additional parameter of the query string used in the request.
11243 /// It should be used to set parameters which are not yet available through their own
11244 /// setters.
11245 ///
11246 /// Please note that this method must not be used to set any of the known parameters
11247 /// which have their own setter method. If done anyway, the request will fail.
11248 ///
11249 /// # Additional Parameters
11250 ///
11251 /// * *$.xgafv* (query-string) - V1 error format.
11252 /// * *access_token* (query-string) - OAuth access token.
11253 /// * *alt* (query-string) - Data format for response.
11254 /// * *callback* (query-string) - JSONP
11255 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11256 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11257 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11258 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11259 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11260 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11261 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11262 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetCreateCall<'a, C>
11263 where
11264 T: AsRef<str>,
11265 {
11266 self._additional_params
11267 .insert(name.as_ref().to_string(), value.as_ref().to_string());
11268 self
11269 }
11270
11271 /// Identifies the authorization scope for the method you are building.
11272 ///
11273 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11274 /// [`Scope::Drive`].
11275 ///
11276 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11277 /// tokens for more than one scope.
11278 ///
11279 /// Usually there is more than one suitable scope to authorize an operation, some of which may
11280 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11281 /// sufficient, a read-write scope will do as well.
11282 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetCreateCall<'a, C>
11283 where
11284 St: AsRef<str>,
11285 {
11286 self._scopes.insert(String::from(scope.as_ref()));
11287 self
11288 }
11289 /// Identifies the authorization scope(s) for the method you are building.
11290 ///
11291 /// See [`Self::add_scope()`] for details.
11292 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetCreateCall<'a, C>
11293 where
11294 I: IntoIterator<Item = St>,
11295 St: AsRef<str>,
11296 {
11297 self._scopes
11298 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11299 self
11300 }
11301
11302 /// Removes all scopes, and no default scope will be used either.
11303 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11304 /// for details).
11305 pub fn clear_scopes(mut self) -> SpreadsheetCreateCall<'a, C> {
11306 self._scopes.clear();
11307 self
11308 }
11309}
11310
11311/// 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/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/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.
11312///
11313/// A builder for the *get* method supported by a *spreadsheet* resource.
11314/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
11315///
11316/// # Example
11317///
11318/// Instantiate a resource method builder
11319///
11320/// ```test_harness,no_run
11321/// # extern crate hyper;
11322/// # extern crate hyper_rustls;
11323/// # extern crate google_sheets4 as sheets4;
11324/// # async fn dox() {
11325/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11326///
11327/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11328/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
11329/// # secret,
11330/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11331/// # ).build().await.unwrap();
11332///
11333/// # let client = hyper_util::client::legacy::Client::builder(
11334/// # hyper_util::rt::TokioExecutor::new()
11335/// # )
11336/// # .build(
11337/// # hyper_rustls::HttpsConnectorBuilder::new()
11338/// # .with_native_roots()
11339/// # .unwrap()
11340/// # .https_or_http()
11341/// # .enable_http1()
11342/// # .build()
11343/// # );
11344/// # let mut hub = Sheets::new(client, auth);
11345/// // You can configure optional parameters by calling the respective setters at will, and
11346/// // execute the final call using `doit()`.
11347/// // Values shown here are possibly random and not representative !
11348/// let result = hub.spreadsheets().get("spreadsheetId")
11349/// .add_ranges("et")
11350/// .include_grid_data(false)
11351/// .doit().await;
11352/// # }
11353/// ```
11354pub struct SpreadsheetGetCall<'a, C>
11355where
11356 C: 'a,
11357{
11358 hub: &'a Sheets<C>,
11359 _spreadsheet_id: String,
11360 _ranges: Vec<String>,
11361 _include_grid_data: Option<bool>,
11362 _delegate: Option<&'a mut dyn common::Delegate>,
11363 _additional_params: HashMap<String, String>,
11364 _scopes: BTreeSet<String>,
11365}
11366
11367impl<'a, C> common::CallBuilder for SpreadsheetGetCall<'a, C> {}
11368
11369impl<'a, C> SpreadsheetGetCall<'a, C>
11370where
11371 C: common::Connector,
11372{
11373 /// Perform the operation you have build so far.
11374 pub async fn doit(mut self) -> common::Result<(common::Response, Spreadsheet)> {
11375 use std::borrow::Cow;
11376 use std::io::{Read, Seek};
11377
11378 use common::{url::Params, ToParts};
11379 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11380
11381 let mut dd = common::DefaultDelegate;
11382 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11383 dlg.begin(common::MethodInfo {
11384 id: "sheets.spreadsheets.get",
11385 http_method: hyper::Method::GET,
11386 });
11387
11388 for &field in ["alt", "spreadsheetId", "ranges", "includeGridData"].iter() {
11389 if self._additional_params.contains_key(field) {
11390 dlg.finished(false);
11391 return Err(common::Error::FieldClash(field));
11392 }
11393 }
11394
11395 let mut params = Params::with_capacity(5 + self._additional_params.len());
11396 params.push("spreadsheetId", self._spreadsheet_id);
11397 if !self._ranges.is_empty() {
11398 for f in self._ranges.iter() {
11399 params.push("ranges", f);
11400 }
11401 }
11402 if let Some(value) = self._include_grid_data.as_ref() {
11403 params.push("includeGridData", value.to_string());
11404 }
11405
11406 params.extend(self._additional_params.iter());
11407
11408 params.push("alt", "json");
11409 let mut url = self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}";
11410 if self._scopes.is_empty() {
11411 self._scopes
11412 .insert(Scope::DriveReadonly.as_ref().to_string());
11413 }
11414
11415 #[allow(clippy::single_element_loop)]
11416 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
11417 url = params.uri_replacement(url, param_name, find_this, false);
11418 }
11419 {
11420 let to_remove = ["spreadsheetId"];
11421 params.remove_params(&to_remove);
11422 }
11423
11424 let url = params.parse_with_url(&url);
11425
11426 loop {
11427 let token = match self
11428 .hub
11429 .auth
11430 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11431 .await
11432 {
11433 Ok(token) => token,
11434 Err(e) => match dlg.token(e) {
11435 Ok(token) => token,
11436 Err(e) => {
11437 dlg.finished(false);
11438 return Err(common::Error::MissingToken(e));
11439 }
11440 },
11441 };
11442 let mut req_result = {
11443 let client = &self.hub.client;
11444 dlg.pre_request();
11445 let mut req_builder = hyper::Request::builder()
11446 .method(hyper::Method::GET)
11447 .uri(url.as_str())
11448 .header(USER_AGENT, self.hub._user_agent.clone());
11449
11450 if let Some(token) = token.as_ref() {
11451 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11452 }
11453
11454 let request = req_builder
11455 .header(CONTENT_LENGTH, 0_u64)
11456 .body(common::to_body::<String>(None));
11457
11458 client.request(request.unwrap()).await
11459 };
11460
11461 match req_result {
11462 Err(err) => {
11463 if let common::Retry::After(d) = dlg.http_error(&err) {
11464 sleep(d).await;
11465 continue;
11466 }
11467 dlg.finished(false);
11468 return Err(common::Error::HttpError(err));
11469 }
11470 Ok(res) => {
11471 let (mut parts, body) = res.into_parts();
11472 let mut body = common::Body::new(body);
11473 if !parts.status.is_success() {
11474 let bytes = common::to_bytes(body).await.unwrap_or_default();
11475 let error = serde_json::from_str(&common::to_string(&bytes));
11476 let response = common::to_response(parts, bytes.into());
11477
11478 if let common::Retry::After(d) =
11479 dlg.http_failure(&response, error.as_ref().ok())
11480 {
11481 sleep(d).await;
11482 continue;
11483 }
11484
11485 dlg.finished(false);
11486
11487 return Err(match error {
11488 Ok(value) => common::Error::BadRequest(value),
11489 _ => common::Error::Failure(response),
11490 });
11491 }
11492 let response = {
11493 let bytes = common::to_bytes(body).await.unwrap_or_default();
11494 let encoded = common::to_string(&bytes);
11495 match serde_json::from_str(&encoded) {
11496 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11497 Err(error) => {
11498 dlg.response_json_decode_error(&encoded, &error);
11499 return Err(common::Error::JsonDecodeError(
11500 encoded.to_string(),
11501 error,
11502 ));
11503 }
11504 }
11505 };
11506
11507 dlg.finished(true);
11508 return Ok(response);
11509 }
11510 }
11511 }
11512 }
11513
11514 /// The spreadsheet to request.
11515 ///
11516 /// Sets the *spreadsheet id* path property to the given value.
11517 ///
11518 /// Even though the property as already been set when instantiating this call,
11519 /// we provide this method for API completeness.
11520 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetGetCall<'a, C> {
11521 self._spreadsheet_id = new_value.to_string();
11522 self
11523 }
11524 /// The ranges to retrieve from the spreadsheet.
11525 ///
11526 /// Append the given value to the *ranges* query property.
11527 /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters.
11528 pub fn add_ranges(mut self, new_value: &str) -> SpreadsheetGetCall<'a, C> {
11529 self._ranges.push(new_value.to_string());
11530 self
11531 }
11532 /// True if grid data should be returned. This parameter is ignored if a field mask was set in the request.
11533 ///
11534 /// Sets the *include grid data* query property to the given value.
11535 pub fn include_grid_data(mut self, new_value: bool) -> SpreadsheetGetCall<'a, C> {
11536 self._include_grid_data = Some(new_value);
11537 self
11538 }
11539 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11540 /// while executing the actual API request.
11541 ///
11542 /// ````text
11543 /// It should be used to handle progress information, and to implement a certain level of resilience.
11544 /// ````
11545 ///
11546 /// Sets the *delegate* property to the given value.
11547 pub fn delegate(
11548 mut self,
11549 new_value: &'a mut dyn common::Delegate,
11550 ) -> SpreadsheetGetCall<'a, C> {
11551 self._delegate = Some(new_value);
11552 self
11553 }
11554
11555 /// Set any additional parameter of the query string used in the request.
11556 /// It should be used to set parameters which are not yet available through their own
11557 /// setters.
11558 ///
11559 /// Please note that this method must not be used to set any of the known parameters
11560 /// which have their own setter method. If done anyway, the request will fail.
11561 ///
11562 /// # Additional Parameters
11563 ///
11564 /// * *$.xgafv* (query-string) - V1 error format.
11565 /// * *access_token* (query-string) - OAuth access token.
11566 /// * *alt* (query-string) - Data format for response.
11567 /// * *callback* (query-string) - JSONP
11568 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11569 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11570 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11571 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11572 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11573 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11574 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11575 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetGetCall<'a, C>
11576 where
11577 T: AsRef<str>,
11578 {
11579 self._additional_params
11580 .insert(name.as_ref().to_string(), value.as_ref().to_string());
11581 self
11582 }
11583
11584 /// Identifies the authorization scope for the method you are building.
11585 ///
11586 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11587 /// [`Scope::DriveReadonly`].
11588 ///
11589 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11590 /// tokens for more than one scope.
11591 ///
11592 /// Usually there is more than one suitable scope to authorize an operation, some of which may
11593 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11594 /// sufficient, a read-write scope will do as well.
11595 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetGetCall<'a, C>
11596 where
11597 St: AsRef<str>,
11598 {
11599 self._scopes.insert(String::from(scope.as_ref()));
11600 self
11601 }
11602 /// Identifies the authorization scope(s) for the method you are building.
11603 ///
11604 /// See [`Self::add_scope()`] for details.
11605 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetGetCall<'a, C>
11606 where
11607 I: IntoIterator<Item = St>,
11608 St: AsRef<str>,
11609 {
11610 self._scopes
11611 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11612 self
11613 }
11614
11615 /// Removes all scopes, and no default scope will be used either.
11616 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11617 /// for details).
11618 pub fn clear_scopes(mut self) -> SpreadsheetGetCall<'a, C> {
11619 self._scopes.clear();
11620 self
11621 }
11622}
11623
11624/// 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/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.
11625///
11626/// A builder for the *getByDataFilter* method supported by a *spreadsheet* resource.
11627/// It is not used directly, but through a [`SpreadsheetMethods`] instance.
11628///
11629/// # Example
11630///
11631/// Instantiate a resource method builder
11632///
11633/// ```test_harness,no_run
11634/// # extern crate hyper;
11635/// # extern crate hyper_rustls;
11636/// # extern crate google_sheets4 as sheets4;
11637/// use sheets4::api::GetSpreadsheetByDataFilterRequest;
11638/// # async fn dox() {
11639/// # use sheets4::{Sheets, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11640///
11641/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11642/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
11643/// # secret,
11644/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11645/// # ).build().await.unwrap();
11646///
11647/// # let client = hyper_util::client::legacy::Client::builder(
11648/// # hyper_util::rt::TokioExecutor::new()
11649/// # )
11650/// # .build(
11651/// # hyper_rustls::HttpsConnectorBuilder::new()
11652/// # .with_native_roots()
11653/// # .unwrap()
11654/// # .https_or_http()
11655/// # .enable_http1()
11656/// # .build()
11657/// # );
11658/// # let mut hub = Sheets::new(client, auth);
11659/// // As the method needs a request, you would usually fill it with the desired information
11660/// // into the respective structure. Some of the parts shown here might not be applicable !
11661/// // Values shown here are possibly random and not representative !
11662/// let mut req = GetSpreadsheetByDataFilterRequest::default();
11663///
11664/// // You can configure optional parameters by calling the respective setters at will, and
11665/// // execute the final call using `doit()`.
11666/// // Values shown here are possibly random and not representative !
11667/// let result = hub.spreadsheets().get_by_data_filter(req, "spreadsheetId")
11668/// .doit().await;
11669/// # }
11670/// ```
11671pub struct SpreadsheetGetByDataFilterCall<'a, C>
11672where
11673 C: 'a,
11674{
11675 hub: &'a Sheets<C>,
11676 _request: GetSpreadsheetByDataFilterRequest,
11677 _spreadsheet_id: String,
11678 _delegate: Option<&'a mut dyn common::Delegate>,
11679 _additional_params: HashMap<String, String>,
11680 _scopes: BTreeSet<String>,
11681}
11682
11683impl<'a, C> common::CallBuilder for SpreadsheetGetByDataFilterCall<'a, C> {}
11684
11685impl<'a, C> SpreadsheetGetByDataFilterCall<'a, C>
11686where
11687 C: common::Connector,
11688{
11689 /// Perform the operation you have build so far.
11690 pub async fn doit(mut self) -> common::Result<(common::Response, Spreadsheet)> {
11691 use std::borrow::Cow;
11692 use std::io::{Read, Seek};
11693
11694 use common::{url::Params, ToParts};
11695 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11696
11697 let mut dd = common::DefaultDelegate;
11698 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11699 dlg.begin(common::MethodInfo {
11700 id: "sheets.spreadsheets.getByDataFilter",
11701 http_method: hyper::Method::POST,
11702 });
11703
11704 for &field in ["alt", "spreadsheetId"].iter() {
11705 if self._additional_params.contains_key(field) {
11706 dlg.finished(false);
11707 return Err(common::Error::FieldClash(field));
11708 }
11709 }
11710
11711 let mut params = Params::with_capacity(4 + self._additional_params.len());
11712 params.push("spreadsheetId", self._spreadsheet_id);
11713
11714 params.extend(self._additional_params.iter());
11715
11716 params.push("alt", "json");
11717 let mut url =
11718 self.hub._base_url.clone() + "v4/spreadsheets/{spreadsheetId}:getByDataFilter";
11719 if self._scopes.is_empty() {
11720 self._scopes.insert(Scope::Drive.as_ref().to_string());
11721 }
11722
11723 #[allow(clippy::single_element_loop)]
11724 for &(find_this, param_name) in [("{spreadsheetId}", "spreadsheetId")].iter() {
11725 url = params.uri_replacement(url, param_name, find_this, false);
11726 }
11727 {
11728 let to_remove = ["spreadsheetId"];
11729 params.remove_params(&to_remove);
11730 }
11731
11732 let url = params.parse_with_url(&url);
11733
11734 let mut json_mime_type = mime::APPLICATION_JSON;
11735 let mut request_value_reader = {
11736 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
11737 common::remove_json_null_values(&mut value);
11738 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
11739 serde_json::to_writer(&mut dst, &value).unwrap();
11740 dst
11741 };
11742 let request_size = request_value_reader
11743 .seek(std::io::SeekFrom::End(0))
11744 .unwrap();
11745 request_value_reader
11746 .seek(std::io::SeekFrom::Start(0))
11747 .unwrap();
11748
11749 loop {
11750 let token = match self
11751 .hub
11752 .auth
11753 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11754 .await
11755 {
11756 Ok(token) => token,
11757 Err(e) => match dlg.token(e) {
11758 Ok(token) => token,
11759 Err(e) => {
11760 dlg.finished(false);
11761 return Err(common::Error::MissingToken(e));
11762 }
11763 },
11764 };
11765 request_value_reader
11766 .seek(std::io::SeekFrom::Start(0))
11767 .unwrap();
11768 let mut req_result = {
11769 let client = &self.hub.client;
11770 dlg.pre_request();
11771 let mut req_builder = hyper::Request::builder()
11772 .method(hyper::Method::POST)
11773 .uri(url.as_str())
11774 .header(USER_AGENT, self.hub._user_agent.clone());
11775
11776 if let Some(token) = token.as_ref() {
11777 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11778 }
11779
11780 let request = req_builder
11781 .header(CONTENT_TYPE, json_mime_type.to_string())
11782 .header(CONTENT_LENGTH, request_size as u64)
11783 .body(common::to_body(
11784 request_value_reader.get_ref().clone().into(),
11785 ));
11786
11787 client.request(request.unwrap()).await
11788 };
11789
11790 match req_result {
11791 Err(err) => {
11792 if let common::Retry::After(d) = dlg.http_error(&err) {
11793 sleep(d).await;
11794 continue;
11795 }
11796 dlg.finished(false);
11797 return Err(common::Error::HttpError(err));
11798 }
11799 Ok(res) => {
11800 let (mut parts, body) = res.into_parts();
11801 let mut body = common::Body::new(body);
11802 if !parts.status.is_success() {
11803 let bytes = common::to_bytes(body).await.unwrap_or_default();
11804 let error = serde_json::from_str(&common::to_string(&bytes));
11805 let response = common::to_response(parts, bytes.into());
11806
11807 if let common::Retry::After(d) =
11808 dlg.http_failure(&response, error.as_ref().ok())
11809 {
11810 sleep(d).await;
11811 continue;
11812 }
11813
11814 dlg.finished(false);
11815
11816 return Err(match error {
11817 Ok(value) => common::Error::BadRequest(value),
11818 _ => common::Error::Failure(response),
11819 });
11820 }
11821 let response = {
11822 let bytes = common::to_bytes(body).await.unwrap_or_default();
11823 let encoded = common::to_string(&bytes);
11824 match serde_json::from_str(&encoded) {
11825 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11826 Err(error) => {
11827 dlg.response_json_decode_error(&encoded, &error);
11828 return Err(common::Error::JsonDecodeError(
11829 encoded.to_string(),
11830 error,
11831 ));
11832 }
11833 }
11834 };
11835
11836 dlg.finished(true);
11837 return Ok(response);
11838 }
11839 }
11840 }
11841 }
11842
11843 ///
11844 /// Sets the *request* property to the given value.
11845 ///
11846 /// Even though the property as already been set when instantiating this call,
11847 /// we provide this method for API completeness.
11848 pub fn request(
11849 mut self,
11850 new_value: GetSpreadsheetByDataFilterRequest,
11851 ) -> SpreadsheetGetByDataFilterCall<'a, C> {
11852 self._request = new_value;
11853 self
11854 }
11855 /// The spreadsheet to request.
11856 ///
11857 /// Sets the *spreadsheet id* path property to the given value.
11858 ///
11859 /// Even though the property as already been set when instantiating this call,
11860 /// we provide this method for API completeness.
11861 pub fn spreadsheet_id(mut self, new_value: &str) -> SpreadsheetGetByDataFilterCall<'a, C> {
11862 self._spreadsheet_id = new_value.to_string();
11863 self
11864 }
11865 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11866 /// while executing the actual API request.
11867 ///
11868 /// ````text
11869 /// It should be used to handle progress information, and to implement a certain level of resilience.
11870 /// ````
11871 ///
11872 /// Sets the *delegate* property to the given value.
11873 pub fn delegate(
11874 mut self,
11875 new_value: &'a mut dyn common::Delegate,
11876 ) -> SpreadsheetGetByDataFilterCall<'a, C> {
11877 self._delegate = Some(new_value);
11878 self
11879 }
11880
11881 /// Set any additional parameter of the query string used in the request.
11882 /// It should be used to set parameters which are not yet available through their own
11883 /// setters.
11884 ///
11885 /// Please note that this method must not be used to set any of the known parameters
11886 /// which have their own setter method. If done anyway, the request will fail.
11887 ///
11888 /// # Additional Parameters
11889 ///
11890 /// * *$.xgafv* (query-string) - V1 error format.
11891 /// * *access_token* (query-string) - OAuth access token.
11892 /// * *alt* (query-string) - Data format for response.
11893 /// * *callback* (query-string) - JSONP
11894 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11895 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11896 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11897 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11898 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11899 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11900 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11901 pub fn param<T>(mut self, name: T, value: T) -> SpreadsheetGetByDataFilterCall<'a, C>
11902 where
11903 T: AsRef<str>,
11904 {
11905 self._additional_params
11906 .insert(name.as_ref().to_string(), value.as_ref().to_string());
11907 self
11908 }
11909
11910 /// Identifies the authorization scope for the method you are building.
11911 ///
11912 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11913 /// [`Scope::Drive`].
11914 ///
11915 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11916 /// tokens for more than one scope.
11917 ///
11918 /// Usually there is more than one suitable scope to authorize an operation, some of which may
11919 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11920 /// sufficient, a read-write scope will do as well.
11921 pub fn add_scope<St>(mut self, scope: St) -> SpreadsheetGetByDataFilterCall<'a, C>
11922 where
11923 St: AsRef<str>,
11924 {
11925 self._scopes.insert(String::from(scope.as_ref()));
11926 self
11927 }
11928 /// Identifies the authorization scope(s) for the method you are building.
11929 ///
11930 /// See [`Self::add_scope()`] for details.
11931 pub fn add_scopes<I, St>(mut self, scopes: I) -> SpreadsheetGetByDataFilterCall<'a, C>
11932 where
11933 I: IntoIterator<Item = St>,
11934 St: AsRef<str>,
11935 {
11936 self._scopes
11937 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11938 self
11939 }
11940
11941 /// Removes all scopes, and no default scope will be used either.
11942 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11943 /// for details).
11944 pub fn clear_scopes(mut self) -> SpreadsheetGetByDataFilterCall<'a, C> {
11945 self._scopes.clear();
11946 self
11947 }
11948}