Skip to content

Commit a15a717

Browse files
authored
🤖 Merge PR DefinitelyTyped#71854 [google-apps-script] Added the fields argument to Drive.Comments.create() and Drive.Replies.create() by @marekdedic
1 parent 28b5e35 commit a15a717

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

types/google-apps-script/apis/drive_v3.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,7 @@ declare namespace GoogleAppsScript {
11431143
resource: Drive.V3.Schema.Reply,
11441144
fileId: string,
11451145
commentId: string,
1146+
optionalArgs: { fields: string },
11461147
): Drive_v3.Drive.V3.Schema.Reply;
11471148
/**Gets a reply by ID.
11481149
@param fileId The ID of the file.
@@ -1486,6 +1487,7 @@ declare namespace GoogleAppsScript {
14861487
create(
14871488
resource: Drive.V3.Schema.Comment,
14881489
fileId: string,
1490+
optionalArgs: { fields: string },
14891491
): Drive_v3.Drive.V3.Schema.Comment;
14901492
/**Gets a comment by ID.
14911493
@param fileId The ID of the file.

types/google-apps-script/test/google-apps-script-tests.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,13 @@ function listDrives() {
11791179
}
11801180
}
11811181

1182+
// Example: Create a comment and a reply
1183+
function commentAndReply() {
1184+
const comment = Drive.Comments.create({ content: "Comment text" }, "FileID", { fields: "id" });
1185+
const reply = Drive.Replies.create({ content: "Reply text" }, "FileID", comment.id, { fields: "id" });
1186+
console.log(reply.id);
1187+
}
1188+
11821189
// Example: List tabs (Google Docs)
11831190
function listTabs() {
11841191
const allTabs = DocumentApp.openById("FileID").getTabs();

0 commit comments

Comments
 (0)