/*! * Copyright Adaptavist 2025 (c) All rights reserved */ import { Response, Headers, BaseApiCore, ErrorStrategyOptionType, PlatformImplementation } from '@managed-api/commons-core'; import { CommonError, AdditionalErrorTypes, ErrorStrategyHandlers, ErrorStrategyOption } from './errorStrategy'; import { ErrorStrategyBuilder } from './builders/errorStrategy'; import { MeRequest, MeResponseOK } from './types/about'; import { CopyFileRequest, CopyFileResponseOK, CreateFileRequest, CreateFileResponseOK, DeleteFileRequest, DeleteFileResponseOK, DownloadFileRequest, DownloadFileResponseOK, EditLabelsRequest, EditLabelsResponseOK, EmptyTrashRequest, EmptyTrashResponseOK, ExportFileRequest, ExportFileResponseOK, GenerateIdsRequest, GenerateIdsResponseOK, GetFileRequest, GetFileResponseOK, GetFilesRequest, GetFilesResponseOK, GetLabelsRequest, GetLabelsResponseOK, UpdateFileRequest, UpdateFileResponseOK, WatchFileRequest, WatchFileResponseOK } from './types/file'; export interface GoogleDriveApiCoreOptions extends ErrorStrategyOption { } type GetGlobalErrorStrategy = () => ErrorStrategyOptionType | undefined; export declare abstract class GoogleDriveApiCore extends BaseApiCore { private options?; All: AllGroup; About: AboutGroup; File: FileGroup; constructor(options?: GoogleDriveApiCoreOptions | undefined); setGlobalErrorStrategy(errorStrategy: ErrorStrategyOptionType): void; protected buildResponse(url: string, status: number, statusText: string, headers: Headers, body?: string | ArrayBuffer): Response; private getGlobalErrorStrategy; } declare class AllGroup { private About; private File; constructor(About: AboutGroup, File: FileGroup); /** * Gets information about the user, the user's Drive, and system capabilities. * For more information, see [Return user info](https://developers.google.com/workspace/drive/api/guides/user-info). * Required: The `fields` parameter must be set. To return the exact fields you need, see [Return specific fields](https://developers.google.com/workspace/drive/api/guides/fields-parameter). * Alternative usage: About.me * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/about/get * @param options Request options. */ aboutMe(options: MeRequest): Promise; /** * Creates a copy of a file and applies any requested updates with patch semantics. * Alternative usage: File.copyFile * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/copy * @param options Request options. */ copyFile(options: CopyFileRequest): Promise; /** * 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. * Alternative usage: File.deleteFile * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/delete * @param options Request options. */ deleteFile(options: DeleteFileRequest): Promise; /** * Downloads content of a file. * Operations are valid for 24 hours from the time of creation. * Alternative usage: File.downloadFile * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/download * @param options Request options. */ downloadFile(options: DownloadFileRequest): Promise; /** * Permanently deletes all of the user's trashed files. * Alternative usage: File.emptyTrash * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/emptyTrash * @param options Request options. */ emptyTrash(options?: EmptyTrashRequest): Promise; /** * Exports a Google Workspace document to the requested MIME type and returns exported byte content. * Alternative usage: File.exportFile * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/export * @param options Request options. */ exportFile(options: ExportFileRequest): Promise; /** * Generates a set of file IDs which can be provided in create or copy requests. * Alternative usage: File.generateIds * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/generateIds * @param options Request options. */ generateIds(options?: GenerateIdsRequest): Promise; /** * Gets a file's metadata or content by ID. * Alternative usage: File.getFile * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get * @param options Request options. */ getFile(options: GetFileRequest): Promise; /** * Lists the user's files. * Alternative usage: File.getFiles * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list * @param options Request options. */ getFiles(options?: GetFilesRequest): Promise; /** * Lists the labels on a file. * Alternative usage: File.getLabels * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/listLabels * @param options Request options. */ getFileLabels(options: GetLabelsRequest): Promise; /** * Creates a new file or folder. Supports both metadata-only creation and file uploads with content. * When uploadType is not provided, this method creates a metadata-only file using the standard endpoint. * When uploadType is provided, this method uploads the file using the /upload endpoint. * - media: [Simple upload.](https://developers.google.com/workspace/drive/api/guides/manage-uploads#simple) Upload the media only, without any metadata. * - multipart: [Multipart upload.](https://developers.google.com/workspace/drive/api/guides/manage-uploads#multipart) Upload both the media and its metadata, in a single request. * - resumable: [Resumable upload.](https://developers.google.com/workspace/drive/api/guides/manage-uploads#resumable) Initiates a resumable upload session. * The response will contain a 'location' URL that must be used for subsequent upload request(s) to send the actual file content. * See the [resumable upload guide](https://developers.google.com/workspace/drive/api/guides/manage-uploads#resumable) for details on completing the upload. * Alternative usage: File.createFile * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create * @param options Request options. */ createFile(options?: CreateFileRequest): Promise; /** * Updates a file's metadata and/or content. * When calling this method, only populate fields in the request that you want to modify. * When updating fields, some fields might be changed automatically, such as modifiedDate. * Alternative usage: File.updateFile * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/update * @param options Request options. */ updateFile(options: UpdateFileRequest): Promise; /** * Subscribes to changes to a file. * Alternative usage: File.watchFile * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/watch * @param options Request options. */ watchFile(options: WatchFileRequest): Promise; /** * Modifies the set of labels applied to a file. * Returns a list of the labels that were added or modified. * Alternative usage: File.editLabels * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/modifyLabels * @param options Request options. */ editFileLabels(options: EditLabelsRequest): Promise; } declare class AboutGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Gets information about the user, the user's Drive, and system capabilities. * For more information, see [Return user info](https://developers.google.com/workspace/drive/api/guides/user-info). * Required: The `fields` parameter must be set. To return the exact fields you need, see [Return specific fields](https://developers.google.com/workspace/drive/api/guides/fields-parameter). * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/about/get * @param options Request options. */ me(options: MeRequest): Promise; } declare class FileGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Creates a copy of a file and applies any requested updates with patch semantics. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/copy * @param options Request options. */ copyFile(options: CopyFileRequest): Promise; /** * 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. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/delete * @param options Request options. */ deleteFile(options: DeleteFileRequest): Promise; /** * Downloads content of a file. * Operations are valid for 24 hours from the time of creation. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/download * @param options Request options. */ downloadFile(options: DownloadFileRequest): Promise; /** * Permanently deletes all of the user's trashed files. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/emptyTrash * @param options Request options. */ emptyTrash(options?: EmptyTrashRequest): Promise; /** * Exports a Google Workspace document to the requested MIME type and returns exported byte content. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/export * @param options Request options. */ exportFile(options: ExportFileRequest): Promise; /** * Generates a set of file IDs which can be provided in create or copy requests. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/generateIds * @param options Request options. */ generateIds(options?: GenerateIdsRequest): Promise; /** * Gets a file's metadata or content by ID. * If you provide the URL parameter alt=media, then the response includes the file contents in the response body. * Downloading content with alt=media only works if the file is stored in Drive. To download Google Docs, Sheets, and Slides use files.export instead. For more information, see [Download & export files](https://developers.google.com/workspace/drive/api/guides/manage-downloads). * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get * @param options Request options. */ getFile(options: GetFileRequest): Promise; /** * Lists the user's files. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list * @param options Request options. */ getFiles(options?: GetFilesRequest): Promise; /** * Creates a new file or folder. Supports both metadata-only creation and file uploads with content. * When uploadType is not provided, this method creates a metadata-only file using the standard endpoint. * When uploadType is provided, this method uploads the file using the /upload endpoint. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create * @param options Request options. */ createFile(options?: CreateFileRequest): Promise; /** * Lists the labels on a file. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/listLabels * @param options Request options. */ getLabels(options: GetLabelsRequest): Promise; /** * Modifies the set of labels applied to a file. * Returns a list of the labels that were added or modified. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/modifyLabels * @param options Request options. */ editLabels(options: EditLabelsRequest): Promise; /** * Updates a file's metadata and/or content. * When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as modifiedDate. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/update * @param options Request options. */ updateFile(options: UpdateFileRequest): Promise; /** * Subscribes to changes to a file. * Documentation: https://developers.google.com/workspace/drive/api/reference/rest/v3/files/watch * @param options Request options. */ watchFile(options: WatchFileRequest): Promise; } export {}; //# sourceMappingURL=index.d.ts.map