Skip to content

Commit

Permalink
chore: Update code examples for v3 API to use requestBody instead o…
Browse files Browse the repository at this point in the history
…f `resource` (#785)

5 years old issue : googleapis/google-api-nodejs-client#1885
  • Loading branch information
zipang authored Jun 18, 2024
1 parent b55ab85 commit cb970a4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drive/snippets/drive_v3/appdata_snippets/upload_appdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function uploadAppdata() {
};
try {
const file = await service.files.create({
resource: fileMetadata,
requestBody: fileMetadata,
media: media,
fields: 'id',
});
Expand Down
2 changes: 1 addition & 1 deletion drive/snippets/drive_v3/file_snippets/create_folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drive/snippets/drive_v3/file_snippets/create_shortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drive/snippets/drive_v3/file_snippets/touch_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drive/snippets/drive_v3/file_snippets/upload_to_folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function uploadToFolder(folderId) {

try {
const file = await service.files.create({
resource: fileMetadata,
requestBody: fileMetadata,
media: media,
fields: 'id',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function uploadWithConversion() {

try {
const file = await service.files.create({
resource: fileMetadata,
requestBody: fileMetadata,
media: media,
fields: 'id',
});
Expand Down

0 comments on commit cb970a4

Please sign in to comment.