From f50535eb660b4ae11cce07683bca9d9ee4cd762f Mon Sep 17 00:00:00 2001 From: Maxim Mazurok Date: Fri, 27 Sep 2019 19:19:43 +0300 Subject: [PATCH] [gapi.client.sheets] Update Google Sheets API with fixes (#37847) * Update Google Sheets API with fixes Updated typings for Google Sheets, generated using https://github.com/Maxim-Mazurok/google-api-typings-generator/tree/patch-1 * Update tests for gapi.client.sheets * Fix bugs * Added "resource" as a Request body https://github.com/Maxim-Mazurok/google-api-typings-generator/pull/3 * Added ClearValuesRequest interface * Disable no-empty-interface for empty interfaces --- .../gapi.client.sheets-tests.ts | 18 +- types/gapi.client.sheets/index.d.ts | 582 ++++++++++++++---- 2 files changed, 486 insertions(+), 114 deletions(-) diff --git a/types/gapi.client.sheets/gapi.client.sheets-tests.ts b/types/gapi.client.sheets/gapi.client.sheets-tests.ts index 032a8793ad..72fe871bc1 100644 --- a/types/gapi.client.sheets/gapi.client.sheets-tests.ts +++ b/types/gapi.client.sheets/gapi.client.sheets-tests.ts @@ -1,7 +1,7 @@ /* This is stub file for gapi.client.{{=it.name}} definition tests */ /* IMPORTANT. -* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. -* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +* This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator/tree/patch-1. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator or https://github.com/Bolisov/google-api-typings-generator **/ gapi.load('client', () => { /** now we can use gapi.client */ @@ -12,13 +12,13 @@ gapi.load('client', () => { /** declare client_id registered in Google Developers Console */ const client_id = '<>'; const scope = [ - /** View and manage the files in your Google Drive */ + /** See, edit, create, and delete all of your Google Drive files */ 'https://www.googleapis.com/auth/drive', /** View and manage Google Drive files and folders that you have opened or created with this app */ 'https://www.googleapis.com/auth/drive.file', - /** View the files in your Google Drive */ + /** See and download all your Google Drive files */ 'https://www.googleapis.com/auth/drive.readonly', - /** View and manage your spreadsheets in Google Drive */ + /** See, edit, create, and delete your spreadsheets in Google Drive */ 'https://www.googleapis.com/auth/spreadsheets', /** View your Google Spreadsheets */ 'https://www.googleapis.com/auth/spreadsheets.readonly', @@ -57,11 +57,11 @@ gapi.load('client', () => { * collaborator changes. If there are no collaborators, the spreadsheet * should reflect your changes. */ - await gapi.client.spreadsheets.batchUpdate({ + await gapi.client.sheets.spreadsheets.batchUpdate({ spreadsheetId: "spreadsheetId", }); /** Creates a spreadsheet, returning the newly created spreadsheet. */ - await gapi.client.spreadsheets.create({ + await gapi.client.sheets.spreadsheets.create({ }); /** * Returns the spreadsheet at the given ID. @@ -86,7 +86,7 @@ gapi.load('client', () => { * return only the portions of the spreadsheet that intersect the requested * ranges. Ranges are specified using A1 notation. */ - await gapi.client.spreadsheets.get({ + await gapi.client.sheets.spreadsheets.get({ includeGridData: true, ranges: "ranges", spreadsheetId: "spreadsheetId", @@ -115,7 +115,7 @@ gapi.load('client', () => { * For large spreadsheets, it is recommended to retrieve only the specific * fields of the spreadsheet that you want. */ - await gapi.client.spreadsheets.getByDataFilter({ + await gapi.client.sheets.spreadsheets.getByDataFilter({ spreadsheetId: "spreadsheetId", }); } diff --git a/types/gapi.client.sheets/index.d.ts b/types/gapi.client.sheets/index.d.ts index 46aaa2a246..9a057e7288 100644 --- a/types/gapi.client.sheets/index.d.ts +++ b/types/gapi.client.sheets/index.d.ts @@ -1,12 +1,13 @@ // Type definitions for non-npm package Google Google Sheets API v4 4.0 // Project: https://developers.google.com/sheets/ // Definitions by: Bolisov Alexey +// Maxim Mazurok // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 // IMPORTANT -// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. -// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator/tree/patch-1. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator or https://github.com/Bolisov/google-api-typings-generator // Generated from: https://sheets.googleapis.com/$discovery/rest?version=v4 /// @@ -16,8 +17,6 @@ declare namespace gapi.client { function load(name: "sheets", version: "v4"): PromiseLike; function load(name: "sheets", version: "v4", callback: () => any): void; - const spreadsheets: sheets.SpreadsheetsResource; - namespace sheets { interface AddBandingRequest { /** @@ -36,7 +35,7 @@ declare namespace gapi.client { * 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 a chart that already exists.) + * is an error to specify the ID of an embedded object that already exists.) */ chart?: EmbeddedChart; } @@ -50,6 +49,14 @@ declare namespace gapi.client { /** The rule to add. */ rule?: ConditionalFormatRule; } + interface AddDimensionGroupRequest { + /** The range over which to create a group. */ + range?: DimensionRange; + } + interface AddDimensionGroupResponse { + /** All groups of a dimension after adding a group to that dimension. */ + dimensionGroups?: DimensionGroup[]; + } interface AddFilterViewRequest { /** * The filter to add. The filterViewId @@ -161,7 +168,7 @@ declare namespace gapi.client { /** The id of the banded range. */ bandedRangeId?: number; /** - * Properties for column bands. These properties will be applied on a column- + * 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. */ @@ -169,7 +176,7 @@ declare namespace gapi.client { /** The range over which these properties are applied. */ range?: GridRange; /** - * Properties for row bands. These properties will be applied on a row-by-row + * 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. */ @@ -212,6 +219,8 @@ declare namespace gapi.client { title?: string; /** The axis title text position. */ titleTextPosition?: TextPosition; + /** The view window options for this axis. */ + viewWindowOptions?: ChartAxisViewWindowOptions; } interface BasicChartDomain { /** @@ -223,6 +232,20 @@ declare namespace gapi.client { reversed?: boolean; } interface BasicChartSeries { + /** + * The color for elements (i.e. bars, lines, points) associated with this + * series. If empty, a default color is used. + */ + color?: Color; + /** + * 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?: LineStyle; /** The data being visualized in this chart series. */ series?: ChartData; /** @@ -287,7 +310,7 @@ declare namespace gapi.client { series?: BasicChartSeries[]; /** * The stacked type for charts that support vertical stacking. - * Applies to Area, Bar, Column, and Stepped Area charts. + * Applies to Area, Bar, Column, Combo, and Stepped Area charts. */ stackedType?: string; /** @@ -400,7 +423,7 @@ declare namespace gapi.client { requests?: Request[]; /** * True if grid data should be returned. Meaningful only if - * if include_spreadsheet_response is 'true'. + * if include_spreadsheet_in_response is 'true'. * This parameter is ignored if a field mask was set in the request. */ responseIncludeGridData?: boolean; @@ -543,7 +566,7 @@ declare namespace gapi.client { interface BooleanRule { /** * The condition of the rule. If the condition evaluates to true, - * the format will be applied. + * the format is applied. */ condition?: BooleanCondition; /** @@ -616,7 +639,7 @@ declare namespace gapi.client { domain?: ChartData; /** * The data containing the bubble group IDs. All bubbles with the same group - * ID will be drawn in the same color. If bubble_sizes is specified then + * 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. */ @@ -693,8 +716,8 @@ declare namespace gapi.client { */ effectiveFormat?: CellFormat; /** - * The effective value of the cell. For cells with formulas, this will be - * the calculated value. For cells with literals, this will be + * 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. */ @@ -731,7 +754,7 @@ declare namespace gapi.client { * 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 will be erased. + * new user_entered_value, previous runs are erased. */ textFormatRuns?: TextFormatRun[]; /** @@ -771,6 +794,20 @@ declare namespace gapi.client { /** The wrap strategy for the value in the cell. */ wrapStrategy?: string; } + interface ChartAxisViewWindowOptions { + /** + * 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. + */ + viewWindowMax?: number; + /** + * 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. + */ + viewWindowMin?: number; + /** The view window's mode. */ + viewWindowMode?: string; + } interface ChartData { /** The source ranges of the data. */ sourceRange?: ChartSourceRange; @@ -783,7 +820,8 @@ declare namespace gapi.client { * 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 contiguous across the domain and series. + * range at a given offset must be in order and contiguous across the domain + * and series. * * For example, these are valid configurations: * @@ -862,11 +900,18 @@ declare namespace gapi.client { * This field is optional. */ titleTextPosition?: TextPosition; + /** A treemap chart specification. */ + treemapChart?: TreemapChartSpec; + /** A waterfall chart specification. */ + waterfallChart?: WaterfallChartSpec; } interface ClearBasicFilterRequest { /** The sheet ID on which the basic filter should be cleared. */ sheetId?: number; } + // tslint:disable-next-line:no-empty-interface + interface ClearValuesRequest { + } interface ClearValuesResponse { /** * The range (in A1 notation) that was cleared. @@ -916,8 +961,8 @@ declare namespace gapi.client { relativeDate?: string; /** * A value the condition is based on. - * The value will be parsed as if the user typed into a cell. - * Formulas are supported (and must begin with an `=`). + * The value is parsed as if the user typed into a cell. + * Formulas are supported (and must begin with an `=` or a '+'). */ userEnteredValue?: string; } @@ -927,7 +972,7 @@ declare namespace gapi.client { /** The formatting will vary based on the gradients in the rule. */ gradientRule?: GradientRule; /** - * The ranges that will be formatted if the condition is true. + * The ranges that are formatted if the condition is true. * All the ranges must be on the same grid. */ ranges?: GridRange[]; @@ -1008,6 +1053,10 @@ declare namespace gapi.client { /** True if invalid data should be rejected. */ strict?: boolean; } + interface DateTimeRule { + /** The type of date-time grouping to apply. */ + type?: string; + } interface DeleteBandingRequest { /** The ID of the banded range to delete. */ bandedRangeId?: number; @@ -1033,10 +1082,31 @@ declare namespace gapi.client { /** The metadata that was deleted. */ deletedDeveloperMetadata?: DeveloperMetadata[]; } + interface DeleteDimensionGroupRequest { + /** The range of the group to be deleted. */ + range?: DimensionRange; + } + interface DeleteDimensionGroupResponse { + /** All groups of a dimension after deleting a group from that dimension. */ + dimensionGroups?: DimensionGroup[]; + } interface DeleteDimensionRequest { /** The dimensions to delete from the sheet. */ range?: DimensionRange; } + interface DeleteDuplicatesRequest { + /** + * The columns in the range to analyze for duplicate values. If no columns are + * selected then all columns are analyzed for duplicates. + */ + comparisonColumns?: DimensionRange[]; + /** The range to remove duplicates rows from. */ + range?: GridRange; + } + interface DeleteDuplicatesResponse { + /** The number of duplicate rows removed. */ + duplicatesRemovedCount?: number; + } interface DeleteEmbeddedObjectRequest { /** The ID of the embedded object to delete. */ objectId?: number; @@ -1161,6 +1231,26 @@ declare namespace gapi.client { */ visibility?: string; } + interface DimensionGroup { + /** + * 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. + */ + collapsed?: boolean; + /** + * The depth of the group, representing how many groups have a range that + * wholly contains the range of this group. + */ + depth?: number; + /** The range over which this group exists. */ + range?: DimensionRange; + } interface DimensionProperties { /** The developer metadata associated with a single row or column. */ developerMetadata?: DeveloperMetadata[]; @@ -1234,7 +1324,7 @@ declare namespace gapi.client { } interface EmbeddedObjectPosition { /** - * If true, the embedded object will be put on a new sheet whose ID + * If true, the embedded object is put on a new sheet whose ID * is chosen for you. Used only when writing. */ newSheet?: boolean; @@ -1422,6 +1512,8 @@ declare namespace gapi.client { interface GridProperties { /** The number of columns in the grid. */ columnCount?: number; + /** True if the column grouping control toggle is shown after the group. */ + columnGroupControlAfter?: boolean; /** The number of columns that are frozen in the grid. */ frozenColumnCount?: number; /** The number of rows that are frozen in the grid. */ @@ -1430,6 +1522,8 @@ declare namespace gapi.client { hideGridlines?: boolean; /** The number of rows in the grid. */ rowCount?: number; + /** True if the row grouping control toggle is shown after the group. */ + rowGroupControlAfter?: boolean; } interface GridRange { /** The end column (exclusive) of the range, or not set if unbounded. */ @@ -1475,6 +1569,22 @@ declare namespace gapi.client { */ showItemDividers?: boolean; } + interface HistogramRule { + /** + * 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. + */ + end?: number; + /** The size of the buckets that are created. Must be positive. */ + interval?: number; + /** + * 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. + */ + start?: number; + } interface HistogramSeries { /** * The color of the column representing this series in each bucket. @@ -1537,6 +1647,33 @@ declare namespace gapi.client { */ maxIterations?: number; } + interface LineStyle { + /** The dash type of the line. */ + type?: string; + /** The thickness of the line, in px. */ + width?: number; + } + interface ManualRule { + /** + * The list of group names and the corresponding items from the source data + * that map to each group name. + */ + groups?: ManualRuleGroup[]; + } + interface ManualRuleGroup { + /** + * The group name, which must be a string. Each group in a given + * ManualRule must have a unique group name. + */ + groupName?: ExtendedValue; + /** + * 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. + */ + items?: ExtendedValue[]; + } interface MatchedDeveloperMetadata { /** All filters matching the returned developer metadata. */ dataFilters?: DataFilter[]; @@ -1589,8 +1726,8 @@ declare namespace gapi.client { /** * 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](/sheets/api/guides/formats) for more - * information about the supported patterns. + * See the [Date and Number Formats guide](/sheets/api/guides/formats) for + * more information about the supported patterns. */ pattern?: string; /** @@ -1682,6 +1819,48 @@ declare namespace gapi.client { visibleValues?: string[]; } interface PivotGroup { + /** The group rule to apply to this row/column group. */ + groupRule?: PivotGroupRule; + /** + * 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 | + * +--------------+---------+-------+ + */ + label?: string; + /** + * 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 repitition 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 | + * +--------------+ + */ + repeatHeadings?: boolean; /** True if the pivot table should include the totals for this grouping. */ showTotals?: boolean; /** The order the values in this group should be sorted. */ @@ -1702,6 +1881,14 @@ declare namespace gapi.client { /** Metadata about values in the grouping. */ valueMetadata?: PivotGroupValueMetadata[]; } + interface PivotGroupRule { + /** A DateTimeRule. */ + dateTimeRule?: DateTimeRule; + /** A HistogramRule. */ + histogramRule?: HistogramRule; + /** A ManualRule. */ + manualRule?: ManualRule; + } interface PivotGroupSortValueBucket { /** * Determines the bucket from which values are chosen to sort. @@ -1737,7 +1924,7 @@ declare namespace gapi.client { /** * An optional mapping of filters per source column offset. * - * The filters will be applied before aggregating data into the pivot table. + * 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. * @@ -1758,15 +1945,21 @@ declare namespace gapi.client { values?: PivotValue[]; } interface PivotValue { + /** + * 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 UI, this is referred to as "Show As" in the value section of a + * pivot table. + */ + calculatedDisplayType?: string; /** * A custom formula to calculate the value. The formula must start * with an `=` character. */ formula?: string; - /** - * A name to use for the value. This is only used if formula was set. - * Otherwise, the column name is used. - */ + /** A name to use for the value. */ name?: string; /** * The column offset of the source range that this value reads from. @@ -1864,6 +2057,8 @@ declare namespace gapi.client { addChart?: AddChartRequest; /** Adds a new conditional format rule. */ addConditionalFormatRule?: AddConditionalFormatRuleRequest; + /** Creates a group over the specified range. */ + addDimensionGroup?: AddDimensionGroupRequest; /** Adds a filter view. */ addFilterView?: AddFilterViewRequest; /** Adds a named range. */ @@ -1899,6 +2094,13 @@ declare namespace gapi.client { deleteDeveloperMetadata?: DeleteDeveloperMetadataRequest; /** Deletes rows or columns in a sheet. */ deleteDimension?: DeleteDimensionRequest; + /** Deletes a group over the specified range. */ + deleteDimensionGroup?: DeleteDimensionGroupRequest; + /** + * Removes rows containing duplicate values in specified columns of a cell + * range. + */ + deleteDuplicates?: DeleteDuplicatesRequest; /** Deletes an embedded object (e.g, chart, image) in a sheet. */ deleteEmbeddedObject?: DeleteEmbeddedObjectRequest; /** Deletes a filter view from a sheet. */ @@ -1939,6 +2141,8 @@ declare namespace gapi.client { sortRange?: SortRangeRequest; /** Converts a column of text into many columns of text. */ textToColumns?: TextToColumnsRequest; + /** Trims cells of whitespace (such as spaces, tabs, or new lines). */ + trimWhitespace?: TrimWhitespaceRequest; /** Unmerges merged cells. */ unmergeCells?: UnmergeCellsRequest; /** Updates a banded range */ @@ -1953,6 +2157,8 @@ declare namespace gapi.client { updateConditionalFormatRule?: UpdateConditionalFormatRuleRequest; /** Updates an existing developer metadata entry */ updateDeveloperMetadata?: UpdateDeveloperMetadataRequest; + /** Updates the state of the specified group. */ + updateDimensionGroup?: UpdateDimensionGroupRequest; /** Updates dimensions' properties. */ updateDimensionProperties?: UpdateDimensionPropertiesRequest; /** Updates an embedded object's (e.g. chart, image) position. */ @@ -1973,6 +2179,8 @@ declare namespace gapi.client { addBanding?: AddBandingResponse; /** A reply from adding a chart. */ addChart?: AddChartResponse; + /** A reply from adding a dimension group. */ + addDimensionGroup?: AddDimensionGroupResponse; /** A reply from adding a filter view. */ addFilterView?: AddFilterViewResponse; /** A reply from adding a named range. */ @@ -1987,12 +2195,18 @@ declare namespace gapi.client { deleteConditionalFormatRule?: DeleteConditionalFormatRuleResponse; /** A reply from deleting a developer metadata entry. */ deleteDeveloperMetadata?: DeleteDeveloperMetadataResponse; + /** A reply from deleting a dimension group. */ + deleteDimensionGroup?: DeleteDimensionGroupResponse; + /** A reply from removing rows containing duplicate values. */ + deleteDuplicates?: DeleteDuplicatesResponse; /** A reply from duplicating a filter view. */ duplicateFilterView?: DuplicateFilterViewResponse; /** A reply from duplicating a sheet. */ duplicateSheet?: DuplicateSheetResponse; /** A reply from doing a find/replace. */ findReplace?: FindReplaceResponse; + /** A reply from trimming whitespace. */ + trimWhitespace?: TrimWhitespaceResponse; /** A reply from updating a conditional format rule. */ updateConditionalFormatRule?: UpdateConditionalFormatRuleResponse; /** A reply from updating a developer metadata entry. */ @@ -2030,12 +2244,17 @@ declare namespace gapi.client { rule?: DataValidationRule; } interface Sheet { - /** The banded (i.e. alternating colors) ranges on this sheet. */ + /** The banded (alternating colors) ranges on this sheet. */ bandedRanges?: BandedRange[]; /** The filter on this sheet, if any. */ basicFilter?: BasicFilter; /** The specifications of every chart on this sheet. */ charts?: EmbeddedChart[]; + /** + * All column groups on this sheet, ordered by increasing range start index, + * then by group depth. + */ + columnGroups?: DimensionGroup[]; /** The conditional format rules in this sheet. */ conditionalFormats?: ConditionalFormatRule[]; /** @@ -2059,6 +2278,11 @@ declare namespace gapi.client { properties?: SheetProperties; /** The protected ranges in this sheet. */ protectedRanges?: ProtectedRange[]; + /** + * All row groups on this sheet, ordered by increasing range start index, then + * by group depth. + */ + rowGroups?: DimensionGroup[]; } interface SheetProperties { /** @@ -2073,12 +2297,12 @@ declare namespace gapi.client { /** * The index of the sheet within the spreadsheet. * When adding or updating sheet properties, if this field - * is excluded then the sheet will be added or moved to the end + * 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 3 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 will be ignored if the requested index is + * 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. */ @@ -2153,9 +2377,8 @@ declare namespace gapi.client { autoRecalc?: string; /** * 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. + * CellData.effectiveFormat will not be set if + * the cell's format is equal to this default format. This field is read-only. */ defaultFormat?: CellFormat; /** @@ -2217,8 +2440,9 @@ declare namespace gapi.client { * 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 + * Note: For LTR text direction positive angles are in the + * counterclockwise direction, whereas for RTL they are in the clockwise + * direction */ angle?: number; /** @@ -2248,6 +2472,112 @@ declare namespace gapi.client { /** The source data range. This must span exactly one column. */ source?: GridRange; } + interface TreemapChartColorScale { + /** + * The background color for cells with a color value greater than or equal + * to maxValue. Defaults to #109618 if not + * specified. + */ + maxValueColor?: Color; + /** + * The background color for cells with a color value at the midpoint between + * minValue and + * maxValue. Defaults to #efe6dc if not + * specified. + */ + midValueColor?: Color; + /** + * The background color for cells with a color value less than or equal to + * minValue. Defaults to #dc3912 if not + * specified. + */ + minValueColor?: Color; + /** + * The background color for cells that have no color data associated with + * them. Defaults to #000000 if not specified. + */ + noDataColor?: Color; + } + interface TreemapChartSpec { + /** + * 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. + */ + colorData?: ChartData; + /** + * 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. + */ + colorScale?: TreemapChartColorScale; + /** The background color for header cells. */ + headerColor?: Color; + /** True to hide tooltips. */ + hideTooltips?: boolean; + /** + * 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. + */ + hintedLevels?: number; + /** The data that contains the treemap cell labels. */ + labels?: ChartData; + /** + * 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. + */ + levels?: number; + /** + * 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. + */ + maxValue?: number; + /** + * 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. + */ + minValue?: number; + /** The data the contains the treemap cells' parent labels. */ + parentLabels?: ChartData; + /** + * 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. + */ + sizeData?: ChartData; + /** The text format for all labels on the chart. */ + textFormat?: TextFormat; + } + interface TrimWhitespaceRequest { + /** The range whose cells to trim. */ + range?: GridRange; + } + interface TrimWhitespaceResponse { + /** The number of cells that were trimmed of whitespace. */ + cellsChangedCount?: number; + } interface UnmergeCellsRequest { /** * The range within which all cells should be unmerged. @@ -2360,6 +2690,19 @@ declare namespace gapi.client { /** The updated developer metadata. */ developerMetadata?: DeveloperMetadata[]; } + interface UpdateDimensionGroupRequest { + /** + * 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. + */ + dimensionGroup?: DimensionGroup; + /** + * 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. + */ + fields?: string; + } interface UpdateDimensionPropertiesRequest { /** * The fields that should be updated. At least one field must be specified. @@ -2523,6 +2866,74 @@ declare namespace gapi.client { */ values?: any[][]; } + interface WaterfallChartColumnStyle { + /** The color of the column. */ + color?: Color; + /** The label of the column's legend. */ + label?: string; + } + interface WaterfallChartCustomSubtotal { + /** + * True if the data point at subtotal_index is the subtotal. If false, + * the subtotal will be computed and appear after the data point. + */ + dataIsSubtotal?: boolean; + /** A label for the subtotal column. */ + label?: string; + /** + * The 0-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. + */ + subtotalIndex?: number; + } + interface WaterfallChartDomain { + /** The data of the WaterfallChartDomain. */ + data?: ChartData; + /** True to reverse the order of the domain values (horizontal axis). */ + reversed?: boolean; + } + interface WaterfallChartSeries { + /** + * 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. + */ + customSubtotals?: WaterfallChartCustomSubtotal[]; + /** The data being visualized in this series. */ + data?: ChartData; + /** + * 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. + */ + hideTrailingSubtotal?: boolean; + /** Styles for all columns in this series with negative values. */ + negativeColumnsStyle?: WaterfallChartColumnStyle; + /** Styles for all columns in this series with positive values. */ + positiveColumnsStyle?: WaterfallChartColumnStyle; + /** Styles for all subtotal columns in this series. */ + subtotalColumnsStyle?: WaterfallChartColumnStyle; + } + interface WaterfallChartSpec { + /** The line style for the connector lines. */ + connectorLineStyle?: LineStyle; + /** The domain data (horizontal axis) for the waterfall chart. */ + domain?: WaterfallChartDomain; + /** True to interpret the first value as a total. */ + firstValueIsTotal?: boolean; + /** True to hide connector lines between columns. */ + hideConnectorLines?: boolean; + /** The data this waterfall chart is visualizing. */ + series?: WaterfallChartSeries[]; + /** The stacked type. */ + stackedType?: string; + } interface DeveloperMetadataResource { /** * Returns the developer metadata with the specified ID. @@ -2536,8 +2947,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2548,8 +2957,6 @@ declare namespace gapi.client { metadataId: number; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2575,8 +2982,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2585,8 +2990,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2597,6 +3000,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: SearchDeveloperMetadataRequest; }): client.Request; } interface SheetsResource { @@ -2611,8 +3016,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2621,8 +3024,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2635,6 +3036,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: CopySheetToAnotherSpreadsheetRequest; }): client.Request; } interface ValuesResource { @@ -2661,8 +3064,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2679,8 +3080,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2710,6 +3109,8 @@ declare namespace gapi.client { upload_protocol?: string; /** How the input data should be interpreted. */ valueInputOption?: string; + /** Request body */ + resource?: ValueRange; }): client.Request; /** * Clears one or more ranges of values from a spreadsheet. @@ -2724,8 +3125,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2734,8 +3133,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2746,6 +3143,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: BatchClearValuesRequest; }): client.Request; /** * Clears one or more ranges of values from a spreadsheet. @@ -2761,8 +3160,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2771,8 +3168,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2783,6 +3178,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: BatchClearValuesByDataFilterRequest; }): client.Request; /** * Returns one or more ranges of values from a spreadsheet. @@ -2795,8 +3192,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** @@ -2822,14 +3217,12 @@ declare namespace gapi.client { majorDimension?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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; /** The A1 notation of the values to retrieve. */ - ranges?: string; + ranges?: string | string[]; /** The ID of the spreadsheet to retrieve data from. */ spreadsheetId: string; /** Legacy upload protocol for media (e.g. "media", "multipart"). */ @@ -2855,8 +3248,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2865,8 +3256,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2877,6 +3266,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: BatchGetValuesByDataFilterRequest; }): client.Request; /** * Sets values in one or more ranges of a spreadsheet. @@ -2891,8 +3282,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2901,8 +3290,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2913,6 +3300,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: BatchUpdateValuesRequest; }): client.Request; /** * Sets values in one or more ranges of a spreadsheet. @@ -2927,8 +3316,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2937,8 +3324,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2949,6 +3334,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: BatchUpdateValuesByDataFilterRequest; }): client.Request; /** * Clears values from a spreadsheet. @@ -2963,8 +3350,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -2973,8 +3358,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -2987,6 +3370,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: ClearValuesRequest; }): client.Request; /** * Returns a range of values from a spreadsheet. @@ -2999,8 +3384,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** @@ -3026,8 +3409,6 @@ declare namespace gapi.client { majorDimension?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -3058,8 +3439,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -3077,8 +3456,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -3089,7 +3466,8 @@ declare namespace gapi.client { * 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 [DateTimeRenderOption.SERIAL_NUMBER]. + * The default dateTime render option is + * DateTimeRenderOption.SERIAL_NUMBER. */ responseDateTimeRenderOption?: string; /** @@ -3105,6 +3483,8 @@ declare namespace gapi.client { upload_protocol?: string; /** How the input data should be interpreted. */ valueInputOption?: string; + /** Request body */ + resource?: ValueRange; }): client.Request; } interface SpreadsheetsResource { @@ -3136,8 +3516,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -3146,8 +3524,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -3158,6 +3534,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: BatchUpdateSpreadsheetRequest; }): client.Request; /** Creates a spreadsheet, returning the newly created spreadsheet. */ create(request: { @@ -3167,8 +3545,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -3177,8 +3553,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -3187,6 +3561,8 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: Spreadsheet; }): client.Request; /** * Returns the spreadsheet at the given ID. @@ -3218,8 +3594,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -3233,14 +3607,12 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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; /** The ranges to retrieve from the spreadsheet. */ - ranges?: string; + ranges?: string | string[]; /** The spreadsheet to request. */ spreadsheetId: string; /** Legacy upload protocol for media (e.g. "media", "multipart"). */ @@ -3279,8 +3651,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -3289,8 +3659,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** 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. */ @@ -3301,10 +3669,14 @@ declare namespace gapi.client { uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Request body */ + resource?: GetSpreadsheetByDataFilterRequest; }): client.Request; developerMetadata: DeveloperMetadataResource; sheets: SheetsResource; values: ValuesResource; } + + const spreadsheets: SpreadsheetsResource; } }