diff --git a/apps-script/execute/index.js b/apps-script/execute/index.js index 50798c4a..6e1ff26c 100644 --- a/apps-script/execute/index.js +++ b/apps-script/execute/index.js @@ -33,10 +33,10 @@ async function callAppsScript() { const script = google.script({version: 'v1', auth}); try { - // Make the API request. The request object is included here as 'resource'. + // Make the API request. The request object is included here as 'requestBody'. const resp = await script.scripts.run({ auth: auth, - resource: { + requestBody: { function: 'getFoldersUnderRoot', }, scriptId: scriptId, diff --git a/apps-script/quickstart/index.js b/apps-script/quickstart/index.js index e37d37b3..62910d25 100644 --- a/apps-script/quickstart/index.js +++ b/apps-script/quickstart/index.js @@ -89,14 +89,14 @@ async function authorize() { async function callAppsScript(auth) { const script = google.script({version: 'v1', auth}); let res = await script.projects.create({ - resource: { + requestBody: { title: 'My Script', }, }); res = await script.projects.updateContent({ scriptId: res.data.scriptId, auth, - resource: { + requestBody: { files: [ { name: 'hello', diff --git a/drive/snippets/drive_v2/appdata_snippets/upload_appdata.js b/drive/snippets/drive_v2/appdata_snippets/upload_appdata.js index 18069cc3..8dcf52d4 100644 --- a/drive/snippets/drive_v2/appdata_snippets/upload_appdata.js +++ b/drive/snippets/drive_v2/appdata_snippets/upload_appdata.js @@ -44,7 +44,7 @@ async function uploadAppdata() { }; try { const file = await service.files.insert({ - resource: fileMetadata, + requestBody: fileMetadata, media: media, fields: 'id', }); diff --git a/drive/snippets/drive_v2/drive_snippets/create_drive.js b/drive/snippets/drive_v2/drive_snippets/create_drive.js index 75c26d89..996b970f 100644 --- a/drive/snippets/drive_v2/drive_snippets/create_drive.js +++ b/drive/snippets/drive_v2/drive_snippets/create_drive.js @@ -37,7 +37,7 @@ async function createDrive() { const requestId = uuid.v4(); try { const Drive = await service.drives.insert({ - resource: driveMetadata, + requestBody: driveMetadata, requestId: requestId, fields: 'id', }); diff --git a/drive/snippets/drive_v2/drive_snippets/recover_drives.js b/drive/snippets/drive_v2/drive_snippets/recover_drives.js index 390c483f..d42e520f 100644 --- a/drive/snippets/drive_v2/drive_snippets/recover_drives.js +++ b/drive/snippets/drive_v2/drive_snippets/recover_drives.js @@ -53,7 +53,7 @@ async function recoverDrives(userEmail) { drive.id, ); await service.permissions.insert({ - resource: newOrganizerPermission, + requestBody: newOrganizerPermission, fileId: drive.id, useDomainAdminAccess: true, supportsAllDrives: true, diff --git a/drive/snippets/drive_v2/file snippets/create_folder.js b/drive/snippets/drive_v2/file snippets/create_folder.js index ca18fa0f..0685f453 100644 --- a/drive/snippets/drive_v2/file snippets/create_folder.js +++ b/drive/snippets/drive_v2/file snippets/create_folder.js @@ -35,7 +35,7 @@ async function createFolder() { }; try { const file = await service.files.insert({ - resource: fileMetadata, + requestBody: fileMetadata, fields: 'id', }); console.log('Folder Id:', file.data.id); diff --git a/drive/snippets/drive_v2/file snippets/create_shortcut.js b/drive/snippets/drive_v2/file snippets/create_shortcut.js index 5d85ba62..a334c638 100644 --- a/drive/snippets/drive_v2/file snippets/create_shortcut.js +++ b/drive/snippets/drive_v2/file snippets/create_shortcut.js @@ -36,7 +36,7 @@ async function createShortcut() { try { const file = await service.files.insert({ - resource: fileMetadata, + requestBody: fileMetadata, fields: 'id', }); console.log('File Id:', file.data.id); diff --git a/drive/snippets/drive_v2/file snippets/share_file.js b/drive/snippets/drive_v2/file snippets/share_file.js index 0cb72954..d107860c 100644 --- a/drive/snippets/drive_v2/file snippets/share_file.js +++ b/drive/snippets/drive_v2/file snippets/share_file.js @@ -54,7 +54,7 @@ async function shareFile(fileId, targetUser, targetDomain) { for (const permission of permissions) { try { const result = await service.permissions.insert({ - resource: permission, + requestBody: permission, fileId: fileId, fields: 'id', }); diff --git a/drive/snippets/drive_v2/file snippets/touch_file.js b/drive/snippets/drive_v2/file snippets/touch_file.js index d4b2b822..39bc806f 100644 --- a/drive/snippets/drive_v2/file snippets/touch_file.js +++ b/drive/snippets/drive_v2/file snippets/touch_file.js @@ -40,7 +40,7 @@ async function touchFile(fileId, timestamp) { const file = await service.files.update({ fileId: fileId, setModifiedDate: true, - resource: fileMetadata, + requestBody: fileMetadata, fields: 'id, modifiedDate', }); console.log('Modified time:', file.data.modifiedDate); diff --git a/drive/snippets/drive_v2/file snippets/upload_basic.js b/drive/snippets/drive_v2/file snippets/upload_basic.js index faa5c2c5..33ef1e8c 100644 --- a/drive/snippets/drive_v2/file snippets/upload_basic.js +++ b/drive/snippets/drive_v2/file snippets/upload_basic.js @@ -39,7 +39,7 @@ async function uploadBasic() { }; try { const file = await service.files.insert({ - resource: fileMetadata, + requestBody: fileMetadata, media: media, fields: 'id', }); diff --git a/drive/snippets/drive_v2/file snippets/upload_to_folder.js b/drive/snippets/drive_v2/file snippets/upload_to_folder.js index 9ebe801a..5b443254 100644 --- a/drive/snippets/drive_v2/file snippets/upload_to_folder.js +++ b/drive/snippets/drive_v2/file snippets/upload_to_folder.js @@ -42,7 +42,7 @@ async function uploadToFolder(folderId) { try { const file = await service.files.insert({ - resource: fileMetadata, + requestBody: fileMetadata, media: media, fields: 'id', }); diff --git a/drive/snippets/drive_v2/file snippets/upload_with_conversion.js b/drive/snippets/drive_v2/file snippets/upload_with_conversion.js index 54433892..3a8ea359 100644 --- a/drive/snippets/drive_v2/file snippets/upload_with_conversion.js +++ b/drive/snippets/drive_v2/file snippets/upload_with_conversion.js @@ -41,7 +41,7 @@ async function uploadWithConversion() { try { const file = await service.files.insert({ - resource: fileMetadata, + requestBody: fileMetadata, media: media, fields: 'id', }); diff --git a/drive/snippets/drive_v3/appdata_snippets/upload_appdata.js b/drive/snippets/drive_v3/appdata_snippets/upload_appdata.js index 270684a5..42661f9f 100644 --- a/drive/snippets/drive_v3/appdata_snippets/upload_appdata.js +++ b/drive/snippets/drive_v3/appdata_snippets/upload_appdata.js @@ -40,7 +40,7 @@ async function uploadAppdata() { }; try { const file = await service.files.create({ - resource: fileMetadata, + requestBody: fileMetadata, media: media, fields: 'id', }); diff --git a/drive/snippets/drive_v3/drive_snippets/create_drive.js b/drive/snippets/drive_v3/drive_snippets/create_drive.js index e69a5018..3699e491 100644 --- a/drive/snippets/drive_v3/drive_snippets/create_drive.js +++ b/drive/snippets/drive_v3/drive_snippets/create_drive.js @@ -37,7 +37,7 @@ async function createDrive() { const requestId = uuid.v4(); try { const Drive = await service.drives.create({ - resource: driveMetadata, + requestBody: driveMetadata, requestId: requestId, fields: 'id', }); diff --git a/drive/snippets/drive_v3/drive_snippets/recover_drives.js b/drive/snippets/drive_v3/drive_snippets/recover_drives.js index 638c7e92..2c43c41b 100644 --- a/drive/snippets/drive_v3/drive_snippets/recover_drives.js +++ b/drive/snippets/drive_v3/drive_snippets/recover_drives.js @@ -53,7 +53,7 @@ async function recoverDrives(userEmail) { drive.id, ); await service.permissions.create({ - resource: newOrganizerPermission, + requestBody: newOrganizerPermission, fileId: drive.id, useDomainAdminAccess: true, supportsAllDrives: true, diff --git a/drive/snippets/drive_v3/file_snippets/create_folder.js b/drive/snippets/drive_v3/file_snippets/create_folder.js index 5b062ede..73d73557 100644 --- a/drive/snippets/drive_v3/file_snippets/create_folder.js +++ b/drive/snippets/drive_v3/file_snippets/create_folder.js @@ -36,7 +36,7 @@ async function createFolder() { }; try { const file = await service.files.create({ - resource: fileMetadata, + requestBody: fileMetadata, fields: 'id', }); console.log('Folder Id:', file.data.id); diff --git a/drive/snippets/drive_v3/file_snippets/create_shortcut.js b/drive/snippets/drive_v3/file_snippets/create_shortcut.js index f17e11c0..70a3a867 100644 --- a/drive/snippets/drive_v3/file_snippets/create_shortcut.js +++ b/drive/snippets/drive_v3/file_snippets/create_shortcut.js @@ -37,7 +37,7 @@ async function createShortcut() { try { const file = await service.files.create({ - resource: fileMetadata, + requestBody: fileMetadata, fields: 'id', }); console.log('File Id:', file.data.id); diff --git a/drive/snippets/drive_v3/file_snippets/share_file.js b/drive/snippets/drive_v3/file_snippets/share_file.js index 79206471..a64a9eb5 100644 --- a/drive/snippets/drive_v3/file_snippets/share_file.js +++ b/drive/snippets/drive_v3/file_snippets/share_file.js @@ -53,7 +53,7 @@ async function shareFile(fileId, targetUserEmail, targetDomainName) { for (const permission of permissions) { try { const result = await service.permissions.create({ - resource: permission, + requestBody: permission, fileId: fileId, fields: 'id', }); diff --git a/drive/snippets/drive_v3/file_snippets/touch_file.js b/drive/snippets/drive_v3/file_snippets/touch_file.js index f61c7b19..636198c7 100644 --- a/drive/snippets/drive_v3/file_snippets/touch_file.js +++ b/drive/snippets/drive_v3/file_snippets/touch_file.js @@ -38,7 +38,7 @@ async function touchFile(fileId, Timestamp) { try { const file = await service.files.update({ fileId: fileId, - resource: fileMetadata, + requestBody: fileMetadata, fields: 'id, modifiedTime', }); console.log('Modified time:', file.data.modifiedTime); diff --git a/drive/snippets/drive_v3/file_snippets/upload_to_folder.js b/drive/snippets/drive_v3/file_snippets/upload_to_folder.js index ca643d52..952dad63 100644 --- a/drive/snippets/drive_v3/file_snippets/upload_to_folder.js +++ b/drive/snippets/drive_v3/file_snippets/upload_to_folder.js @@ -44,7 +44,7 @@ async function uploadToFolder(folderId) { try { const file = await service.files.create({ - resource: fileMetadata, + requestBody: fileMetadata, media: media, fields: 'id', }); diff --git a/drive/snippets/drive_v3/file_snippets/upload_with_conversion.js b/drive/snippets/drive_v3/file_snippets/upload_with_conversion.js index 05ce2dc5..f8d35de6 100644 --- a/drive/snippets/drive_v3/file_snippets/upload_with_conversion.js +++ b/drive/snippets/drive_v3/file_snippets/upload_with_conversion.js @@ -40,7 +40,7 @@ async function uploadWithConversion() { try { const file = await service.files.create({ - resource: fileMetadata, + requestBody: fileMetadata, media: media, fields: 'id', }); diff --git a/drive/snippets/test/helpers.js b/drive/snippets/test/helpers.js index 12645766..2349dcb2 100644 --- a/drive/snippets/test/helpers.js +++ b/drive/snippets/test/helpers.js @@ -65,7 +65,7 @@ class Helpers { */ async createFile(fileMetadata, media) { const file = await this.service.files.create({ - resource: fileMetadata, + requestBody: fileMetadata, media, fields: 'id', }); diff --git a/sheets/snippets/sheets_append_values.js b/sheets/snippets/sheets_append_values.js index db99aade..93c49563 100644 --- a/sheets/snippets/sheets_append_values.js +++ b/sheets/snippets/sheets_append_values.js @@ -41,7 +41,7 @@ async function appendValues(spreadsheetId, range, valueInputOption, _values) { // [START_EXCLUDE silent] values = _values; // [END_EXCLUDE] - const resource = { + const requestBody = { values, }; try { @@ -49,7 +49,7 @@ async function appendValues(spreadsheetId, range, valueInputOption, _values) { spreadsheetId, range, valueInputOption, - resource, + requestBody, }); console.log(`${result.data.updates.updatedCells} cells appended.`); return result; diff --git a/sheets/snippets/sheets_batch_update.js b/sheets/snippets/sheets_batch_update.js index be9c8db7..68065aef 100644 --- a/sheets/snippets/sheets_batch_update.js +++ b/sheets/snippets/sheets_batch_update.js @@ -55,7 +55,7 @@ async function batchUpdate(spreadsheetId, title, find, replacement) { try { const response = await service.spreadsheets.batchUpdate({ spreadsheetId, - resource: batchUpdateRequest, + requestBody: batchUpdateRequest, }); const findReplaceResponse = response.data.replies[1].findReplace; console.log(`${findReplaceResponse.occurrencesChanged} replacements made.`); diff --git a/sheets/snippets/sheets_batch_update_values.js b/sheets/snippets/sheets_batch_update_values.js index e266fba1..3c266013 100644 --- a/sheets/snippets/sheets_batch_update_values.js +++ b/sheets/snippets/sheets_batch_update_values.js @@ -53,14 +53,14 @@ async function batchUpdateValues( }, ]; // Additional ranges to update ... - const resource = { + const requestBody = { data, valueInputOption, }; try { const result = await service.spreadsheets.values.batchUpdate({ spreadsheetId, - resource, + requestBody, }); console.log('%d cells updated.', result.data.totalUpdatedCells); return result; diff --git a/sheets/snippets/sheets_conditional_formatting.js b/sheets/snippets/sheets_conditional_formatting.js index 74230a7c..6a3c316a 100644 --- a/sheets/snippets/sheets_conditional_formatting.js +++ b/sheets/snippets/sheets_conditional_formatting.js @@ -72,13 +72,13 @@ async function conditionalFormatting(spreadsheetId) { }, }, ]; - const resource = { + const requestBody = { requests, }; try { const response = await service.spreadsheets.batchUpdate({ spreadsheetId, - resource, + requestBody, }); console.log(`${response.data.replies.length} cells updated.`); return response; diff --git a/sheets/snippets/sheets_create.js b/sheets/snippets/sheets_create.js index 2309ff4e..4d2d76e6 100644 --- a/sheets/snippets/sheets_create.js +++ b/sheets/snippets/sheets_create.js @@ -29,14 +29,14 @@ async function create(title) { }); const service = google.sheets({version: 'v4', auth}); - const resource = { + const requestBody = { properties: { title, }, }; try { const spreadsheet = await service.spreadsheets.create({ - resource, + requestBody, fields: 'spreadsheetId', }); console.log(`Spreadsheet ID: ${spreadsheet.data.spreadsheetId}`); diff --git a/sheets/snippets/sheets_pivot_table.js b/sheets/snippets/sheets_pivot_table.js index 52b86e13..de439a3a 100644 --- a/sheets/snippets/sheets_pivot_table.js +++ b/sheets/snippets/sheets_pivot_table.js @@ -39,10 +39,10 @@ async function pivotTable(spreadsheetId) { addSheet: {}, }, ]; - let resource = {requests}; + let requestBody = {requests}; let response = await service.spreadsheets.batchUpdate({ spreadsheetId, - resource, + requestBody, }); const sourceSheetId = response.data.replies[0].addSheet.properties.sheetId; const targetSheetId = response.data.replies[1].addSheet.properties.sheetId; @@ -95,12 +95,12 @@ async function pivotTable(spreadsheetId) { }, }, ]; - resource = { + requestBody = { requests, }; response = service.spreadsheets.batchUpdate({ spreadsheetId, - resource, + requestBody, }); return response; } catch (err) { diff --git a/sheets/snippets/sheets_update_values.js b/sheets/snippets/sheets_update_values.js index b9891829..4393d733 100644 --- a/sheets/snippets/sheets_update_values.js +++ b/sheets/snippets/sheets_update_values.js @@ -41,7 +41,7 @@ async function updateValues(spreadsheetId, range, valueInputOption, _values) { // [START_EXCLUDE silent] values = _values; // [END_EXCLUDE] - const resource = { + const requestBody = { values, }; try { @@ -49,7 +49,7 @@ async function updateValues(spreadsheetId, range, valueInputOption, _values) { spreadsheetId, range, valueInputOption, - resource, + requestBody, }); console.log('%d cells updated.', result.data.updatedCells); return result; diff --git a/sheets/snippets/test/helpers.js b/sheets/snippets/test/helpers.js index fb02f865..0bbd1064 100644 --- a/sheets/snippets/test/helpers.js +++ b/sheets/snippets/test/helpers.js @@ -69,7 +69,7 @@ class Helpers { */ async createTestSpreadsheet() { const res = await this.sheetsService.spreadsheets.create({ - resource: { + requestBody: { properties: { title: 'Test Spreadsheet', }, @@ -88,7 +88,7 @@ class Helpers { async populateValues(spreadsheetId) { await this.sheetsService.spreadsheets.batchUpdate({ spreadsheetId, - resource: { + requestBody: { requests: [ { repeatCell: { diff --git a/slides/snippets/slides_copy_presentation.js b/slides/snippets/slides_copy_presentation.js index 38b7c047..82a15382 100644 --- a/slides/snippets/slides_copy_presentation.js +++ b/slides/snippets/slides_copy_presentation.js @@ -36,7 +36,7 @@ async function copyPresentation(presentationId, copyTitle) { try { const driveResponse = await service.files.copy({ fileId: presentationId, - resource: request, + requestBody: request, }); const presentationCopyId = driveResponse.data.id; console.log('Created copied presentation with ID: ' + presentationCopyId); diff --git a/slides/snippets/slides_create_bulleted_text.js b/slides/snippets/slides_create_bulleted_text.js index ef4e8065..db6d34e5 100644 --- a/slides/snippets/slides_create_bulleted_text.js +++ b/slides/snippets/slides_create_bulleted_text.js @@ -47,7 +47,7 @@ async function createBulletedText(presentationId, shapeId) { try { const batchUpdateResponse = await service.presentations.batchUpdate({ presentationId, - resource: { + requestBody: { requests, }, }); diff --git a/slides/snippets/slides_create_image.js b/slides/snippets/slides_create_image.js index 1e1a1b30..a5e2c985 100644 --- a/slides/snippets/slides_create_image.js +++ b/slides/snippets/slides_create_image.js @@ -65,7 +65,7 @@ async function createImage(presentationId, pageId) { try { const response = await service.presentations.batchUpdate({ presentationId, - resource: {requests}, + requestBody: {requests}, }); const createImageResponse = response.data.replies; console.log( diff --git a/slides/snippets/slides_create_sheets_chart.js b/slides/snippets/slides_create_sheets_chart.js index f926e11c..2bb9573c 100644 --- a/slides/snippets/slides_create_sheets_chart.js +++ b/slides/snippets/slides_create_sheets_chart.js @@ -74,7 +74,7 @@ async function createSheetsChart( try { const batchUpdateResponse = await service.presentations.batchUpdate({ presentationId, - resource: { + requestBody: { requests, }, }); diff --git a/slides/snippets/slides_create_slide.js b/slides/snippets/slides_create_slide.js index 211ac3e3..93425225 100644 --- a/slides/snippets/slides_create_slide.js +++ b/slides/snippets/slides_create_slide.js @@ -47,7 +47,7 @@ async function createSlide(presentationId, pageId) { try { const res = await service.presentations.batchUpdate({ presentationId, - resource: { + requestBody: { requests, }, }); diff --git a/slides/snippets/slides_create_textbox_with_text.js b/slides/snippets/slides_create_textbox_with_text.js index 756b638d..8a1838d8 100644 --- a/slides/snippets/slides_create_textbox_with_text.js +++ b/slides/snippets/slides_create_textbox_with_text.js @@ -69,7 +69,7 @@ async function createTextboxWithText(presentationId, pageId) { const createTextboxWithTextResponse = await service.presentations.batchUpdate({ presentationId, - resource: {requests}, + requestBody: {requests}, }); const createShapeResponse = createTextboxWithTextResponse.data.replies[0].createShape; diff --git a/slides/snippets/slides_image_merging.js b/slides/snippets/slides_image_merging.js index abfe8fbc..f881b80a 100644 --- a/slides/snippets/slides_image_merging.js +++ b/slides/snippets/slides_image_merging.js @@ -42,7 +42,7 @@ async function imageMerging(templatePresentationId, imageUrl, customerName) { try { const driveResponse = await driveService.files.copy({ fileId: templatePresentationId, - resource: { + requestBody: { name: copyTitle, }, }); @@ -75,7 +75,7 @@ async function imageMerging(templatePresentationId, imageUrl, customerName) { // Execute the requests for this presentation. const batchUpdateResponse = await slidesService.presentations.batchUpdate({ presentationId: presentationCopyId, - resource: { + requestBody: { requests, }, }); diff --git a/slides/snippets/slides_refresh_sheets_chart.js b/slides/snippets/slides_refresh_sheets_chart.js index c9d9a703..1023e0d5 100644 --- a/slides/snippets/slides_refresh_sheets_chart.js +++ b/slides/snippets/slides_refresh_sheets_chart.js @@ -42,7 +42,7 @@ async function refreshSheetsChart(presentationId, presentationChartId) { try { const batchUpdateResponse = await service.presentations.batchUpdate({ presentationId, - resource: { + requestBody: { requests, }, }); diff --git a/slides/snippets/slides_simple_text_replace.js b/slides/snippets/slides_simple_text_replace.js index 3bbfac39..c94b13ca 100644 --- a/slides/snippets/slides_simple_text_replace.js +++ b/slides/snippets/slides_simple_text_replace.js @@ -52,7 +52,7 @@ async function simpleTextReplace(presentationId, shapeId, replacementText) { try { const batchUpdateResponse = await service.presentations.batchUpdate({ presentationId, - resource: { + requestBody: { requests, }, }); diff --git a/slides/snippets/slides_text_merging.js b/slides/snippets/slides_text_merging.js index f51af3e4..983bec14 100644 --- a/slides/snippets/slides_text_merging.js +++ b/slides/snippets/slides_text_merging.js @@ -100,7 +100,7 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) { const batchUpdateResponse = await slidesService.presentations.batchUpdate( { presentationId: presentationCopyId, - resource: { + requestBody: { requests, }, }, diff --git a/slides/snippets/slides_text_style_update.js b/slides/snippets/slides_text_style_update.js index 85195c12..eff9a9cd 100644 --- a/slides/snippets/slides_text_style_update.js +++ b/slides/snippets/slides_text_style_update.js @@ -98,7 +98,7 @@ async function textStyleUpdate(presentationId, shapeId) { try { const batchUpdateResponse = await service.presentations.batchUpdate({ presentationId, - resource: { + requestBody: { requests, }, }); diff --git a/slides/snippets/test/helpers.js b/slides/snippets/test/helpers.js index 3eb8aac5..c08815b0 100644 --- a/slides/snippets/test/helpers.js +++ b/slides/snippets/test/helpers.js @@ -99,7 +99,7 @@ class Helpers { } await this.slidesService.presentations.batchUpdate({ presentationId, - resource: { + requestBody: { requests, }, }); @@ -149,7 +149,7 @@ class Helpers { ]; const res = await this.slidesService.presentations.batchUpdate({ presentationId, - resource: { + requestBody: { requests, }, }); @@ -202,7 +202,7 @@ class Helpers { const res = await this.slidesService.presentations.batchUpdate({ presentationId, - resource: { + requestBody: { requests, }, }); @@ -215,7 +215,7 @@ class Helpers { */ async createTestSpreadsheet() { const res = await this.sheetsService.spreadsheets.create({ - resource: { + requestBody: { properties: { title: 'Test Spreadsheet', }, @@ -235,7 +235,7 @@ class Helpers { async populateValues(spreadsheetId) { await this.sheetsService.spreadsheets.batchUpdate({ spreadsheetId, - resource: { + requestBody: { requests: [ { repeatCell: {