googleapis version: 47.0.0I try to convert this code (from the official docs: https://developers.google.com/sheets/api/guides/batchupdate) to typescript:
gapi.client.sheets.spreadsheets.batchUpdate({
spreadsheetId: spreadsheetId,
resource: batchUpdateRequest
})
It makes the following error:
Argument of type '{ spreadsheetId: string; resource: { requests: any; }; }' is not assignable to parameter of type 'Params$Resource$Spreadsheets$Batchupdate'.
Object literal may only specify known properties, and 'resource' does not exist in type 'Params$Resource$Spreadsheets$Batchupdate'.
(Actually here is the file I am trying to convert to ts, where I have this error: https://github.com/MTES-MCT/camino-api/blob/89a8a764177c5efda57a7154b6ffd936f63afee9/src/tools/api-google-spreadsheets/index.js#L22)
what should I do to avoid the error?
Thank you
Greetings! It looks like this may be coming from an old tutorial. Instead of resource, can you try requestBody?
https://github.com/googleapis/google-api-nodejs-client#specifying-request-body
Let us know if this helps!
thank you
Greetings! It looks like this may be coming from an old tutorial. Instead of
resource, can you tryrequestBody?
https://github.com/googleapis/google-api-nodejs-client#specifying-request-bodyLet us know if this helps!
@JustinBeckwith I can still see resource being used in the official documentation. Is it just a synonym for requestBody? And, just curious, how does this work? I don't see the synonym specified anywhere.
@JustinBeckwith Also, same thing for uploadType (official sample) when creating a new file. Is this parameter no longer required? You provided this sample. Is providing requestBody enough for multipart? If I want a simple upload, do I need to specify uploadType?