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