1 | |
2 |
|
3 | type Gdrive = { |
4 | token: string; |
5 | }; |
6 | export async function main( |
7 | gdrive_auth: Gdrive, |
8 | driveId: string, |
9 | allowItemDeletion: boolean = false, |
10 | useDomainAdminAccess: boolean = false, |
11 | ) { |
12 | const DELETE_SHARED_DRIVE_URL = `https://www.googleapis.com/drive/v3/drives/${driveId}/?allowItemDeletion=${allowItemDeletion}&useDomainAdminAccess=${useDomainAdminAccess}`; |
13 |
|
14 | const token = gdrive_auth["token"]; |
15 |
|
16 | const response = await fetch(DELETE_SHARED_DRIVE_URL, { |
17 | method: "DELETE", |
18 | headers: { |
19 | Authorization: "Bearer " + token, |
20 | "Content-Type": "application/json", |
21 | }, |
22 | }); |
23 |
|
24 | return "Deleted shared drive."; |
25 | } |
26 |
|