batch_update_spreadsheet_request_body = {
'requests': [
{
"updateCells": {
"rows": [
{
"values": [
{
"userEnteredValue": {
"boolValue": False
}
}
]
}
],
"fields": "userEnteredValue",
"start": {
"sheetId": "target_sheet_id",
"rowIndex": 0,
"columnIndex": 0
}
},
"updateSheetProperties": {
"properties": {
"sheetId": "target_sheet_id",
"title": "Some title"
},
"fields": "title"
}
}
]
}
request = service.spreadsheets().batchUpdate(
spreadsheetId=spreadsheet_id,
body=batch_update_spreadsheet_request_body)
request.execute()
This code results in following error: "Invalid value at 'requests[0]' (oneof), oneof field 'kind' is already set. Cannot set 'updateSheetProperties'". Details: "[{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'requests[0]', 'description': "Invalid value at 'requests[0]' (oneof), oneof field 'kind' is already set. Cannot set 'updateSheetProperties'"}]}]"
But separately each request body is working:
batch_update_spreadsheet_request_body = {
'requests': [
{
"updateCells": {
"rows": [
{
"values": [
{
"userEnteredValue": {
"boolValue": False
}
}
]
}
],
"fields": "userEnteredValue",
"start": {
"sheetId": "target_sheet_id",
"rowIndex": 0,
"columnIndex": 0
}
}
}
]
}
As well as "updateSheetProperties" request body. Reading documentation doesn't help, I've also tried to find answers elsewhere but to no avail.