The type of upload request to the /upload URI. Acceptable values are:
media - Simple upload. Upload the media only, without any metadata.
multipart - Multipart upload. Upload both the media and its metadata, in a single request.
resumable - Resumable upload. Upload the file in a resumable fashion, using a series of at least two requests where the first request includes the metadata.
Optional query parameters
async
(params, auths) => {
}
//See the API docs here: https://developers.google.com/drive/api/v3/reference/files/create?authuser=2
const data = {
appProperties: params.appProperties,
contentHints: params.contentHints,
copyRequiresWriterPermission: params.copyRequiresWriterPermission,
createdTime: params.createdTime,
description: params.description,
folderColorRgb: params.folderColorRgb,
id: params.id,
mimeType: params.mimeType,
originalFilename: params.originalFilename,
parents: params.parents,
properties: params.properties,
starred: params.starred,
viewedByMeTime: params.viewedByMeTime,
writersCanShare: params.writersCanShare,
}
const config = {
method: "post",
url: `https://www.googleapis.com/upload/drive/v3/files`,
params: {
uploadType: params.uploadType,
ignoreDefaultVisibility: params.ignoreDefaultVisibility,
keepRevisionForever: params.keepRevisionForever,
ocrLanguage: params.ocrLanguage,
supportsAllDrives: params.supportsAllDrives,
supportsTeamDrives: params.supportsTeamDrives,
useContentAsIndexableText: params.useContentAsIndexableText,
alt: params.alt,
fields: params.fields || "*", //For improved performance, select actual fields from the related entity required for your use case. "*" selects all fields.
key: params.key,
oauth_token: params.oauth_token,
prettyPrint: params.prettyPrint,
quotaUser: params.quotaUser,
userIp: params.userIp,
},
headers: {
Authorization: `Bearer ${auths.google_drive.oauth_access_token}`,
"Content-Type": "application/octet-stream",
},
}
return await require("@pipedreamhq/platform").axios(this, config)