@googleapis/sheets
Version:
1,259 lines (1,249 loc) • 316 kB
text/typescript
// Copyright 2020 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-interface */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-irregular-whitespace */
import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosResponseWithHTTP2,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export namespace sheets_v4 {
export interface Options extends GlobalOptions {
version: 'v4';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?:
| string
| OAuth2Client
| JWT
| Compute
| UserRefreshClient
| BaseExternalAccountClient
| GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: 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.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* 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.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Google Sheets API
*
* Reads and writes Google Sheets.
*
* @example
* ```js
* const {google} = require('googleapis');
* const sheets = google.sheets('v4');
* ```
*/
export class Sheets {
context: APIRequestContext;
spreadsheets: Resource$Spreadsheets;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.spreadsheets = new Resource$Spreadsheets(this.context);
}
}
/**
* Adds a new banded range to the spreadsheet.
*/
export interface Schema$AddBandingRequest {
/**
* 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.)
*/
bandedRange?: Schema$BandedRange;
}
/**
* The result of adding a banded range.
*/
export interface Schema$AddBandingResponse {
/**
* The banded range that was added.
*/
bandedRange?: Schema$BandedRange;
}
/**
* Adds a chart to a sheet in the spreadsheet.
*/
export interface Schema$AddChartRequest {
/**
* 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.)
*/
chart?: Schema$EmbeddedChart;
}
/**
* The result of adding a chart to a spreadsheet.
*/
export interface Schema$AddChartResponse {
/**
* The newly added chart.
*/
chart?: Schema$EmbeddedChart;
}
/**
* Adds a new conditional format rule at the given index. All subsequent rules' indexes are incremented.
*/
export interface Schema$AddConditionalFormatRuleRequest {
/**
* The zero-based index where the rule should be inserted.
*/
index?: number | null;
/**
* The rule to add.
*/
rule?: Schema$ConditionalFormatRule;
}
/**
* 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 if you are adding a BigQuery data source.
*/
export interface Schema$AddDataSourceRequest {
/**
* The data source to add.
*/
dataSource?: Schema$DataSource;
}
/**
* The result of adding a data source.
*/
export interface Schema$AddDataSourceResponse {
/**
* The data execution status.
*/
dataExecutionStatus?: Schema$DataExecutionStatus;
/**
* The data source that was created.
*/
dataSource?: Schema$DataSource;
}
/**
* 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].
*/
export interface Schema$AddDimensionGroupRequest {
/**
* The range over which to create a group.
*/
range?: Schema$DimensionRange;
}
/**
* The result of adding a group.
*/
export interface Schema$AddDimensionGroupResponse {
/**
* All groups of a dimension after adding a group to that dimension.
*/
dimensionGroups?: Schema$DimensionGroup[];
}
/**
* Adds a filter view.
*/
export interface Schema$AddFilterViewRequest {
/**
* 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.)
*/
filter?: Schema$FilterView;
}
/**
* The result of adding a filter view.
*/
export interface Schema$AddFilterViewResponse {
/**
* The newly added filter view.
*/
filter?: Schema$FilterView;
}
/**
* Adds a named range to the spreadsheet.
*/
export interface Schema$AddNamedRangeRequest {
/**
* 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.)
*/
namedRange?: Schema$NamedRange;
}
/**
* The result of adding a named range.
*/
export interface Schema$AddNamedRangeResponse {
/**
* The named range to add.
*/
namedRange?: Schema$NamedRange;
}
/**
* Adds a new protected range.
*/
export interface Schema$AddProtectedRangeRequest {
/**
* 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.)
*/
protectedRange?: Schema$ProtectedRange;
}
/**
* The result of adding a new protected range.
*/
export interface Schema$AddProtectedRangeResponse {
/**
* The newly added protected range.
*/
protectedRange?: Schema$ProtectedRange;
}
/**
* 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.
*/
export interface Schema$AddSheetRequest {
/**
* 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.)
*/
properties?: Schema$SheetProperties;
}
/**
* The result of adding a sheet.
*/
export interface Schema$AddSheetResponse {
/**
* The properties of the newly added sheet.
*/
properties?: Schema$SheetProperties;
}
/**
* Adds a slicer to a sheet in the spreadsheet.
*/
export interface Schema$AddSlicerRequest {
/**
* 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.)
*/
slicer?: Schema$Slicer;
}
/**
* The result of adding a slicer to a spreadsheet.
*/
export interface Schema$AddSlicerResponse {
/**
* The newly added slicer.
*/
slicer?: Schema$Slicer;
}
/**
* Adds a new table to the spreadsheet.
*/
export interface Schema$AddTableRequest {
/**
* Required. The table to add.
*/
table?: Schema$Table;
}
/**
* The result of adding a table.
*/
export interface Schema$AddTableResponse {
/**
* Output only. The table that was added.
*/
table?: Schema$Table;
}
/**
* Adds new cells after the last row with data in a sheet, inserting new rows into the sheet if necessary.
*/
export interface Schema$AppendCellsRequest {
/**
* 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.
*/
fields?: string | null;
/**
* The data to append.
*/
rows?: Schema$RowData[];
/**
* The sheet ID to append the data to.
*/
sheetId?: number | null;
/**
* The ID of the table to append data to. The data will be only appended to the table body. This field also takes precedence over the `sheet_id` field.
*/
tableId?: string | null;
}
/**
* Appends rows or columns to the end of a sheet.
*/
export interface Schema$AppendDimensionRequest {
/**
* Whether rows or columns should be appended.
*/
dimension?: string | null;
/**
* The number of rows or columns to append.
*/
length?: number | null;
/**
* The sheet to append rows or columns to.
*/
sheetId?: number | null;
}
/**
* The response when updating a range of values in a spreadsheet.
*/
export interface Schema$AppendValuesResponse {
/**
* The spreadsheet the updates were applied to.
*/
spreadsheetId?: string | null;
/**
* 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.
*/
tableRange?: string | null;
/**
* Information about the updates that were applied.
*/
updates?: Schema$UpdateValuesResponse;
}
/**
* Fills in more data based on existing data.
*/
export interface Schema$AutoFillRequest {
/**
* 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.
*/
range?: Schema$GridRange;
/**
* The source and destination areas to autofill. This explicitly lists the source of the autofill and where to extend that data.
*/
sourceAndDestination?: Schema$SourceAndDestination;
/**
* True if we should generate data with the "alternate" series. This differs based on the type and amount of source data.
*/
useAlternateSeries?: boolean | null;
}
/**
* Automatically resizes one or more dimensions based on the contents of the cells in that dimension.
*/
export interface Schema$AutoResizeDimensionsRequest {
/**
* The dimensions on a data source sheet to automatically resize.
*/
dataSourceSheetDimensions?: Schema$DataSourceSheetDimensionRange;
/**
* The dimensions to automatically resize.
*/
dimensions?: Schema$DimensionRange;
}
/**
* A banded (alternating colors) range in a sheet.
*/
export interface Schema$BandedRange {
/**
* The ID of the banded range. If unset, refer to banded_range_reference.
*/
bandedRangeId?: number | null;
/**
* Output only. The reference of the banded range, used to identify the ID that is not supported by the banded_range_id.
*/
bandedRangeReference?: string | null;
/**
* 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.
*/
columnProperties?: Schema$BandingProperties;
/**
* The range over which these properties are applied.
*/
range?: Schema$GridRange;
/**
* 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.
*/
rowProperties?: Schema$BandingProperties;
}
/**
* 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.
*/
export interface Schema$BandingProperties {
/**
* The first color that is alternating. (Required) Deprecated: Use first_band_color_style.
*/
firstBandColor?: Schema$Color;
/**
* The first color that is alternating. (Required) If first_band_color is also set, this field takes precedence.
*/
firstBandColorStyle?: Schema$ColorStyle;
/**
* 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.
*/
footerColor?: Schema$Color;
/**
* 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.
*/
footerColorStyle?: Schema$ColorStyle;
/**
* 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.
*/
headerColor?: Schema$Color;
/**
* 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.
*/
headerColorStyle?: Schema$ColorStyle;
/**
* The second color that is alternating. (Required) Deprecated: Use second_band_color_style.
*/
secondBandColor?: Schema$Color;
/**
* The second color that is alternating. (Required) If second_band_color is also set, this field takes precedence.
*/
secondBandColorStyle?: Schema$ColorStyle;
}
/**
* Formatting options for baseline value.
*/
export interface Schema$BaselineValueFormat {
/**
* The comparison type of key value with baseline value.
*/
comparisonType?: string | null;
/**
* Description which is appended after the baseline value. This field is optional.
*/
description?: string | null;
/**
* Color to be used, in case baseline value represents a negative change for key value. This field is optional. Deprecated: Use negative_color_style.
*/
negativeColor?: Schema$Color;
/**
* 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.
*/
negativeColorStyle?: Schema$ColorStyle;
/**
* Specifies the horizontal text positioning of baseline value. This field is optional. If not specified, default positioning is used.
*/
position?: Schema$TextPosition;
/**
* Color to be used, in case baseline value represents a positive change for key value. This field is optional. Deprecated: Use positive_color_style.
*/
positiveColor?: Schema$Color;
/**
* 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.
*/
positiveColorStyle?: Schema$ColorStyle;
/**
* Text formatting options for baseline value. The link field is not supported.
*/
textFormat?: Schema$TextFormat;
}
/**
* An axis of the chart. A chart may not have more than one axis per axis position.
*/
export interface Schema$BasicChartAxis {
/**
* The format of the title. Only valid if the axis is not associated with the domain. The link field is not supported.
*/
format?: Schema$TextFormat;
/**
* The position of this axis.
*/
position?: string | null;
/**
* The title of this axis. If set, this overrides any title inferred from headers of the data.
*/
title?: string | null;
/**
* The axis title text position.
*/
titleTextPosition?: Schema$TextPosition;
/**
* The view window options for this axis.
*/
viewWindowOptions?: Schema$ChartAxisViewWindowOptions;
}
/**
* The domain of a chart. For example, if charting stock prices over time, this would be the date.
*/
export interface Schema$BasicChartDomain {
/**
* The data of the domain. For example, if charting stock prices over time, this is the data representing the dates.
*/
domain?: Schema$ChartData;
/**
* True to reverse the order of the domain values (horizontal axis).
*/
reversed?: boolean | null;
}
/**
* 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".
*/
export interface Schema$BasicChartSeries {
/**
* 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.
*/
color?: Schema$Color;
/**
* 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.
*/
colorStyle?: Schema$ColorStyle;
/**
* Information about the data labels for this series.
*/
dataLabel?: Schema$DataLabel;
/**
* 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.
*/
lineStyle?: Schema$LineStyle;
/**
* 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.
*/
pointStyle?: Schema$PointStyle;
/**
* The data being visualized in this chart series.
*/
series?: Schema$ChartData;
/**
* Style override settings for series data points.
*/
styleOverrides?: Schema$BasicSeriesDataPointStyleOverride[];
/**
* 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.
*/
targetAxis?: string | null;
/**
* 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.
*/
type?: string | null;
}
/**
* The specification for a basic chart. See BasicChartType for the list of charts this supports.
*/
export interface Schema$BasicChartSpec {
/**
* The axis on the chart.
*/
axis?: Schema$BasicChartAxis[];
/**
* The type of the chart.
*/
chartType?: string | null;
/**
* The behavior of tooltips and data highlighting when hovering on data and chart area.
*/
compareMode?: string | null;
/**
* The domain of data this is charting. Only a single domain is supported.
*/
domains?: Schema$BasicChartDomain[];
/**
* 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.)
*/
headerCount?: number | null;
/**
* 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.
*/
interpolateNulls?: boolean | null;
/**
* The position of the chart legend.
*/
legendPosition?: string | null;
/**
* Gets whether all lines should be rendered smooth or straight by default. Applies to Line charts.
*/
lineSmoothing?: boolean | null;
/**
* The data this chart is visualizing.
*/
series?: Schema$BasicChartSeries[];
/**
* The stacked type for charts that support vertical stacking. Applies to Area, Bar, Column, Combo, and Stepped Area charts.
*/
stackedType?: string | null;
/**
* True to make the chart 3D. Applies to Bar and Column charts.
*/
threeDimensional?: boolean | null;
/**
* 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.
*/
totalDataLabel?: Schema$DataLabel;
}
/**
* The default filter associated with a sheet.
*/
export interface Schema$BasicFilter {
/**
* 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.
*/
criteria?: {[key: string]: Schema$FilterCriteria} | null;
/**
* 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.
*/
filterSpecs?: Schema$FilterSpec[];
/**
* The range the filter covers.
*/
range?: Schema$GridRange;
/**
* The sort order per column. Later specifications are used when values are equal in the earlier specifications.
*/
sortSpecs?: Schema$SortSpec[];
/**
* The table this filter is backed by, if any. When writing, only one of range or table_id may be set.
*/
tableId?: string | null;
}
/**
* Style override settings for a single series data point.
*/
export interface Schema$BasicSeriesDataPointStyleOverride {
/**
* Color of the series data point. If empty, the series default is used. Deprecated: Use color_style.
*/
color?: Schema$Color;
/**
* Color of the series data point. If empty, the series default is used. If color is also set, this field takes precedence.
*/
colorStyle?: Schema$ColorStyle;
/**
* The zero-based index of the series data point.
*/
index?: number | null;
/**
* 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.
*/
pointStyle?: Schema$PointStyle;
}
/**
* The request for clearing more than one range selected by a DataFilter in a spreadsheet.
*/
export interface Schema$BatchClearValuesByDataFilterRequest {
/**
* The DataFilters used to determine which ranges to clear.
*/
dataFilters?: Schema$DataFilter[];
}
/**
* The response when clearing a range of values selected with DataFilters in a spreadsheet.
*/
export interface Schema$BatchClearValuesByDataFilterResponse {
/**
* The ranges that were cleared, in [A1 notation](https://developers.google.com/workspace/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.
*/
clearedRanges?: string[] | null;
/**
* The spreadsheet the updates were applied to.
*/
spreadsheetId?: string | null;
}
/**
* The request for clearing more than one range of values in a spreadsheet.
*/
export interface Schema$BatchClearValuesRequest {
/**
* The ranges to clear, in [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell).
*/
ranges?: string[] | null;
}
/**
* The response when clearing a range of values in a spreadsheet.
*/
export interface Schema$BatchClearValuesResponse {
/**
* 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.
*/
clearedRanges?: string[] | null;
/**
* The spreadsheet the updates were applied to.
*/
spreadsheetId?: string | null;
}
/**
* The request for retrieving a range of values in a spreadsheet selected by a set of DataFilters.
*/
export interface Schema$BatchGetValuesByDataFilterRequest {
/**
* 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.
*/
dataFilters?: Schema$DataFilter[];
/**
* 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.
*/
dateTimeRenderOption?: string | null;
/**
* 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]]`.
*/
majorDimension?: string | null;
/**
* How values should be represented in the output. The default render option is FORMATTED_VALUE.
*/
valueRenderOption?: string | null;
}
/**
* The response when retrieving more than one range of values in a spreadsheet selected by DataFilters.
*/
export interface Schema$BatchGetValuesByDataFilterResponse {
/**
* The ID of the spreadsheet the data was retrieved from.
*/
spreadsheetId?: string | null;
/**
* The requested values with the list of data filters that matched them.
*/
valueRanges?: Schema$MatchedValueRange[];
}
/**
* The response when retrieving more than one range of values in a spreadsheet.
*/
export interface Schema$BatchGetValuesResponse {
/**
* The ID of the spreadsheet the data was retrieved from.
*/
spreadsheetId?: string | null;
/**
* The requested values. The order of the ValueRanges is the same as the order of the requested ranges.
*/
valueRanges?: Schema$ValueRange[];
}
/**
* The request for updating any aspect of a spreadsheet.
*/
export interface Schema$BatchUpdateSpreadsheetRequest {
/**
* Determines if the update response should include the spreadsheet resource.
*/
includeSpreadsheetInResponse?: boolean | null;
/**
* 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.
*/
requests?: Schema$Request[];
/**
* 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.
*/
responseIncludeGridData?: boolean | null;
/**
* Limits the ranges included in the response spreadsheet. Meaningful only if include_spreadsheet_in_response is 'true'.
*/
responseRanges?: string[] | null;
}
/**
* The reply for batch updating a spreadsheet.
*/
export interface Schema$BatchUpdateSpreadsheetResponse {
/**
* The reply of the updates. This maps 1:1 with the updates, although replies to some requests may be empty.
*/
replies?: Schema$Response[];
/**
* The spreadsheet the updates were applied to.
*/
spreadsheetId?: string | null;
/**
* The spreadsheet after updates were applied. This is only set if BatchUpdateSpreadsheetRequest.include_spreadsheet_in_response is `true`.
*/
updatedSpreadsheet?: Schema$Spreadsheet;
}
/**
* The request for updating more than one range of values in a spreadsheet.
*/
export interface Schema$BatchUpdateValuesByDataFilterRequest {
/**
* 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.
*/
data?: Schema$DataFilterValueRange[];
/**
* 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).
*/
includeValuesInResponse?: boolean | null;
/**
* 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.
*/
responseDateTimeRenderOption?: string | null;
/**
* Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
*/
responseValueRenderOption?: string | null;
/**
* How the input data should be interpreted.
*/
valueInputOption?: string | null;
}
/**
* The response when updating a range of values in a spreadsheet.
*/
export interface Schema$BatchUpdateValuesByDataFilterResponse {
/**
* The response for each range updated.
*/
responses?: Schema$UpdateValuesByDataFilterResponse[];
/**
* The spreadsheet the updates were applied to.
*/
spreadsheetId?: string | null;
/**
* The total number of cells updated.
*/
totalUpdatedCells?: number | null;
/**
* The total number of columns where at least one cell in the column was updated.
*/
totalUpdatedColumns?: number | null;
/**
* The total number of rows where at least one cell in the row was updated.
*/
totalUpdatedRows?: number | null;
/**
* The total number of sheets where at least one cell in the sheet was updated.
*/
totalUpdatedSheets?: number | null;
}
/**
* The request for updating more than one range of values in a spreadsheet.
*/
export interface Schema$BatchUpdateValuesRequest {
/**
* The new values to apply to the spreadsheet.
*/
data?: Schema$ValueRange[];
/**
* 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).
*/
includeValuesInResponse?: boolean | null;
/**
* 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.
*/
responseDateTimeRenderOption?: string | null;
/**
* Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
*/
responseValueRenderOption?: string | null;
/**
* How the input data should be interpreted.
*/
valueInputOption?: string | null;
}
/**
* The response when updating a range of values in a spreadsheet.
*/
export interface Schema$BatchUpdateValuesResponse {
/**
* One UpdateValuesResponse per requested range, in the same order as the requests appeared.
*/
responses?: Schema$UpdateValuesResponse[];
/**
* The spreadsheet the updates were applied to.
*/
spreadsheetId?: string | null;
/**
* The total number of cells updated.
*/
totalUpdatedCells?: number | null;
/**
* The total number of columns where at least one cell in the column was updated.
*/
totalUpdatedColumns?: number | null;
/**
* The total number of rows where at least one cell in the row was updated.
*/
totalUpdatedRows?: number | null;
/**
* The total number of sheets where at least one cell in the sheet was updated.
*/
totalUpdatedSheets?: number | null;
}
/**
* The specification of a BigQuery data source that's connected to a sheet.
*/
export interface Schema$BigQueryDataSourceSpec {
/**
* 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.
*/
projectId?: string | null;
/**
* A BigQueryQuerySpec.
*/
querySpec?: Schema$BigQueryQuerySpec;
/**
* A BigQueryTableSpec.
*/
tableSpec?: Schema$BigQueryTableSpec;
}
/**
* Specifies a custom BigQuery query.
*/
export interface Schema$BigQueryQuerySpec {
/**
* The raw query string.
*/
rawQuery?: string | null;
}
/**
* Specifies a BigQuery table definition. Only [native tables](https://cloud.google.com/bigquery/docs/tables-intro) are allowed.
*/
export interface Schema$BigQueryTableSpec {
/**
* The BigQuery dataset id.
*/
datasetId?: string | null;
/**
* The BigQuery table id.
*/
tableId?: string | null;
/**
* The ID of a BigQuery project the table belongs to. If not specified, the project_id is assumed.
*/
tableProjectId?: string | null;
}
/**
* A condition that can evaluate to true or false. BooleanConditions are used by conditional formatting, data validation, and the criteria in filters.
*/
export interface Schema$BooleanCondition {
/**
* The type of condition.
*/
type?: string | null;
/**
* 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.
*/
values?: Schema$ConditionValue[];
}
/**
* A rule that may or may not match, depending on the condition.
*/
export interface Schema$BooleanRule {
/**
* The condition of the rule. If the condition evaluates to true, the format is applied.
*/
condition?: Schema$BooleanCondition;
/**
* The format to apply. Conditional formatting can only apply a subset of formatting: bold, italic, strikethrough, foreground color and, background color.
*/
format?: Schema$CellFormat;
}
/**
* A border along a cell.
*/
export interface Schema$Border {
/**
* The color of the border. Deprecated: Use color_style.
*/
color?: Schema$Color;
/**
* The color of the border. If color is also set, this field takes precedence.
*/
colorStyle?: Schema$ColorStyle;
/**
* The style of the border.
*/
style?: string | null;
/**
* The width of the border, in pixels. Deprecated; the width is determined by the "style" field.
*/
width?: number | null;
}
/**
* The borders of the cell.
*/
export interface Schema$Borders {
/**
* The bottom border of the cell.
*/
bottom?: Schema$Border;
/**
* The left border of the cell.
*/
left?: Schema$Border;
/**
* The right border of the cell.
*/
right?: Schema$Border;
/**
* The top border of the cell.
*/
top?: Schema$Border;
}
/**
* A bubble chart.
*/
export interface Schema$BubbleChartSpec {
/**
* The bubble border color. Deprecated: Use bubble_border_color_style.
*/
bubbleBorderColor?: Schema$Color;
/**
* The bubble border color. If bubble_border_color is also set, this field takes precedence.
*/
bubbleBorderColorStyle?: Schema$ColorStyle;
/**
* The data containing the bubble labels. These do not need to be unique.
*/
bubbleLabels?: Schema$ChartData;
/**
* The max radius size of the bubbles, in pixels. If specified, the field must be a positive value.
*/
bubbleMaxRadiusSize?: number | null;
/**
* The minimum radius size of the bubbles, in pixels. If specific, the field must be a positive value.
*/
bubbleMinRadiusSize?: number | null;
/**
* The opacity of the bubbles between 0 and 1.0. 0 is fully transparent and 1 is fully opaque.
*/
bubbleOpacity?: number | null;
/**
* 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.
*/
bubbleSizes?: Schema$ChartData;
/**
* The format of the text inside the bubbles. Strikethrough, underline, and link are not supported.
*/
bubbleTextStyle?: Schema$TextFormat;
/**
* The data containing the bubble x-values. These values locate the bubbles in the chart horizontally.
*/
domain?: Schema$ChartData;
/**
* 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.
*/
groupIds?: Schema$ChartData;
/**
* Where the legend of the chart should be drawn.
*/
legendPosition?: string | null;
/**
* The data containing the bubble y-values. These values locate the bubbles in the chart vertically.
*/
series?: Schema$ChartData;
}
/**
* Cancels one or multiple refreshes of data source objects in the spreadsheet by the specified references. The request requires an additional `bigquery.readonly` OAuth scope if you are cancelling a refresh on a BigQuery data source.
*/
export interface Schema$CancelDataSourceRefreshRequest {
/**
* Reference to a DataSource. If specified, cancels all associated data source object refreshes for this data source.
*/
dataSourceId?: string | null;
/**
* Cancels all existing data source object refreshes for all data sources in the spreadsheet.
*/
isAll?: boolean | null;
/**
* References to data source objects whose refreshes are to be cancelled.
*/
references?: Schema$DataSourceObjectReferences;
}
/**
* The response from cancelling one or multiple data source object refreshes.
*/
export interface Schema$CancelDataSourceRefreshResponse {
/**
* 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`.
*/
statuses?: Schema$CancelDataSourceRefreshStatus[];
}
/**
* The status of cancelling a single data source object refresh.
*/
export interface Schema$CancelDataSourceRefreshStatus {
/**
* Reference to the data source object whose refresh is being cancelled.
*/
reference?: Schema$DataSourceObjectReference;
/**
* The cancellation status.
*/
refreshCancellationStatus?: Schema$RefreshCancellationStatus;
}
/**
* A candlestick chart.
*/
export interface Schema$CandlestickChartSpec {
/**
* The Candlestick chart data. Only one CandlestickData is supported.
*/
data?: Schema$CandlestickData[];
/**
* 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.
*/
domain?: Schema$CandlestickDomain;
}
/**
* The Candlestick chart data, each containing the low, open, close, and high values for a series.
*/
export interface Schema$CandlestickData {
/**
* 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.
*/
closeSeries?: Schema$CandlestickSeries;
/**
* The range data (vertical axis) for the high/maximum value for each candle. This is the top of the candle's center line.
*/
highSeries?: Schema$CandlestickSeries;
/**
* The range data (vertical axis) for the low/minimum value for each candle. This is the bottom of the candle's center line.
*/
lowSeries?: Schema$CandlestickSeries;
/**
* 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.
*/
openSeries?: Schema$CandlestickSeries;
}
/**
* The domain of a CandlestickChart.
*/
export interface Schema$CandlestickDomain {
/**
* The data of the CandlestickDomain.
*/
data?: Schema$ChartData;
/**
* True to reverse the order of the domain values (horizontal axis).
*/
reversed?: boolean | null;
}
/**
* The series of a CandlestickData.
*/
export interface Schema$CandlestickSeries {
/**
* The data of the CandlestickSeries.
*/
data?: Schema$ChartData;
}
/**
* Data about a specific cell.
*/
export interface Schema$CellData {
/**
* Optional. Runs of chips applied to subsections of the cell. Properties of a run start at a specific index in the text and continue until the next run. When reading, all chipped and non-chipped runs are included. Non-chipped runs will have an empty Chip. When writing, only runs with chips are included. Runs containing chips are of length 1 and are represented in the user-entered text by an “@” placeholder symbol. New runs will overwrite any prior runs. Writing a new user_entered_value will erase previous runs.
*/
chipRuns?: Schema$ChipRun[];
/**
* 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)`.
*/
dataSourceFormula?: Schema$DataSourceFormula;
/**
* 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.
*/
dataSourceTable?: Schema$DataSourceTable;
/**
* A data validation rule on the cell, if any. When writing, the new data validation rule will overwrite any prior rule.
*/
dataValidation?: Schema$DataValidationRule;
/**
* 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.
*/
effectiveFormat?: Schema$CellFormat;
/**
* 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.
*/
effectiveValue?: Schema$ExtendedValue;
/**
* The formatted value of the cell. This is the value as it's shown to the user. This field is read-only.
*/
formattedValue?: string | null;
/**
* 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.
*/
hyperlink?: string | null;
/**
* Any note on the cell.
*/
note?: string | null;
/**
* 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.
*/
pivotTable?: Schema$PivotTable;
/**
* 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.
*/
textFormatRuns?: Schema$TextFormatRun[];
/**
* The format the user entered for the cell. When writing, the new format will be merged with the existing format.
*/
userEnteredFormat?: Schema$CellFormat;
/**
* 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.
*/
userEnteredValue?: Schema$ExtendedValue;
}
/**
* The format of a cell.
*/
export interface Schema$CellFormat {
/**
* The background color of the cell. Deprecated: Use background_color_style.
*/
backgroundColor?: Schema$Color;
/**
* The background color of the cell. If background_color is also set, this field takes precedence.
*/
backgroundColorStyle?: Schema$ColorStyle;
/**
* The borders of the cell.
*/
borders?: Schema$Borders;
/**
* The horizontal alignment of the value in the cell.
*/
horizontalAlignment?: string | null;