Google Apps Script API
    Preparing search index...
    interface FilesCollection {
        copy(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File,
            fileId: string,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        copy(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File,
            fileId: string,
            optionalArgs: Record<string, any>,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        create(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        create(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File,
            mediaData: Blob,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        create(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File,
            mediaData: Blob,
            optionalArgs: Record<string, any>,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        download(fileId: string): Operation;
        download(fileId: string, optionalArgs: Record<string, any>): Operation;
        emptyTrash(): void;
        emptyTrash(optionalArgs: Record<string, any>): void;
        export(fileId: string, mimeType: string): void;
        generateIds(): GoogleAppsScript.Drive_v3.Drive.V3.Schema.GeneratedIds;
        generateIds(
            optionalArgs: Record<string, any>,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.GeneratedIds;
        get(fileId: string): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        get(
            fileId: string,
            optionalArgs: Record<string, any> & { alt: "media" },
        ): string;
        get(
            fileId: string,
            optionalArgs: Record<string, any>,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        list(): GoogleAppsScript.Drive_v3.Drive.V3.Schema.FileList;
        list(
            optionalArgs: Record<string, any>,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.FileList;
        listLabels(fileId: string): LabelList;
        listLabels(fileId: string, optionalArgs: Record<string, any>): LabelList;
        modifyLabels(
            resource: ModifyLabelsRequest,
            fileId: string,
        ): ModifyLabelsResponse;
        remove(fileId: string): void;
        remove(fileId: string, optionalArgs: Record<string, any>): void;
        update(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File,
            fileId: string,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        update(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File,
            fileId: string,
            mediaData: Blob,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        update(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File,
            fileId: string,
            mediaData: Blob,
            optionalArgs: Record<string, any>,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File;
        watch(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Channel,
            fileId: string,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.Channel;
        watch(
            resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Channel,
            fileId: string,
            optionalArgs: Record<string, any>,
        ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.Channel;
    }
    Index

    Methods

    • Creates a new file. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types:*/* Note: Specify a valid MIME type, rather than the literal */* value. The literal */* is only used to indicate that any valid MIME type can be uploaded. For more information on uploading files, see Upload file data. Apps creating shortcuts with files.create must specify the MIME type application/vnd.google-apps.shortcut. Apps should specify a file extension in the name property when inserting files with the API. For example, an operation to insert a JPEG file should specify something like "name": "cat.jpg" in the metadata. Subsequent GET requests include the read-only fileExtension property populated with the extension originally specified in the title property. When a Google Drive user requests to download a file, or when the file is downloaded through the sync client, Drive builds a full filename (with extension) based on the title. In cases where the extension is missing, Drive attempts to determine the extension based on the file's MIME type.

      Parameters

      Returns GoogleAppsScript.Drive_v3.Drive.V3.Schema.File

    • Creates a new file. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types:*/* Note: Specify a valid MIME type, rather than the literal */* value. The literal */* is only used to indicate that any valid MIME type can be uploaded. For more information on uploading files, see Upload file data. Apps creating shortcuts with files.create must specify the MIME type application/vnd.google-apps.shortcut. Apps should specify a file extension in the name property when inserting files with the API. For example, an operation to insert a JPEG file should specify something like "name": "cat.jpg" in the metadata. Subsequent GET requests include the read-only fileExtension property populated with the extension originally specified in the title property. When a Google Drive user requests to download a file, or when the file is downloaded through the sync client, Drive builds a full filename (with extension) based on the title. In cases where the extension is missing, Drive attempts to determine the extension based on the file's MIME type.

      Parameters

      Returns GoogleAppsScript.Drive_v3.Drive.V3.Schema.File

    • Creates a new file. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types:*/* Note: Specify a valid MIME type, rather than the literal */* value. The literal */* is only used to indicate that any valid MIME type can be uploaded. For more information on uploading files, see Upload file data. Apps creating shortcuts with files.create must specify the MIME type application/vnd.google-apps.shortcut. Apps should specify a file extension in the name property when inserting files with the API. For example, an operation to insert a JPEG file should specify something like "name": "cat.jpg" in the metadata. Subsequent GET requests include the read-only fileExtension property populated with the extension originally specified in the title property. When a Google Drive user requests to download a file, or when the file is downloaded through the sync client, Drive builds a full filename (with extension) based on the title. In cases where the extension is missing, Drive attempts to determine the extension based on the file's MIME type.

      Parameters

      Returns GoogleAppsScript.Drive_v3.Drive.V3.Schema.File

    • Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive, the user must be an organizer on the parent folder. If the target is a folder, all descendants owned by the user are also deleted.

      Parameters

      • fileId: string

        The ID of the file.

      Returns void

    • Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive, the user must be an organizer on the parent folder. If the target is a folder, all descendants owned by the user are also deleted.

      Parameters

      • fileId: string

        The ID of the file.

      • optionalArgs: Record<string, any>

        Optional arguments.

      Returns void