-
Notifications
You must be signed in to change notification settings - Fork 495
Open
Description
Summary
Following the example on node.js, the Typescript compiler complains about incorrect types on the update method.
Expected Behavior
Sample URL: https://github.com/googleworkspace/node-samples/blob/main/sheets/snippets/sheets_update_values.js
Description: No Typescript errors
Actual Behavior
No overload matches this call.
Overload 1 of 6, '(params?: Params$Resource$Spreadsheets$Values$Update | undefined, options?: MethodOptions | undefined): GaxiosPromise<...>', gave the following error.
Object literal may only specify known properties, and 'resource' does not exist in type 'Params$Resource$Spreadsheets$Values$Update'.
Overload 2 of 6, '(callback: BodyResponseCallback<Schema$UpdateValuesResponse>): void', gave the following error.
Object literal may only specify known properties, and 'auth' does not exist in type 'BodyResponseCallback<Schema$UpdateValuesResponse>'.
async setCells(range: string, values: string[][]) {
return await this.sheets.spreadsheets.values.update({
auth: this.auth,
spreadsheetId: this.spreadsheetId,
range: range,
valueInputOption: "USER_ENTERED",
resource: { values },
});
}Steps to Reproduce the Problem
- Copy the API call for
updatefrom the docs into a project that has a JS server side, e.g. node.js or in my case, Nuxt. - See the error.
Workaround
Changing resource to requestBody solves the issue. I suggest updating the docs.
Metadata
Metadata
Assignees
Labels
No labels