Delete Shared Drive ( gdrive)
One script reply has been approved by the moderators Verified

Created by rossmccrann 192 days ago Viewed 62 times 1 Point

No comments yet

Login to be able to comment
Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import * as wmill from "https://deno.land/x/windmill@v1.24.1/mod.ts";

export async function main(
    gdrive_auth: wmill.Resource<"gdrive">,
    driveId: string,
    allowItemDeletion: boolean = false,
    useDomainAdminAccess: boolean = false,
) {
    const DELETE_SHARED_DRIVE_URL = `https://www.googleapis.com/drive/v3/drives/${driveId}/?allowItemDeletion=${allowItemDeletion}&useDomainAdminAccess=${useDomainAdminAccess}`;

    const token = gdrive_auth["token"];

    const response = await fetch(DELETE_SHARED_DRIVE_URL, {
        method: "DELETE",
        headers: {
            Authorization: "Bearer " + token,
            "Content-Type": "application/json",
        },
    });

    return 'Deleted shared drive.';
}

Submitted by rossmccrann 192 days ago

Edited 192 days ago

No comments yet

Login to be able to comment