samples/gar_drive.R

#' Drive API
#' Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.
#' 
#' Auto-generated code by googleAuthR::gar_create_api_skeleton
#'  at 2020-12-12 16:18:47
#' filename: test_drive.R
#' api_json: discovery_api drive v3
#' 
#' @details 
#' Authentication scopes used are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' \item https://www.googleapis.com/auth/drive.scripts
#' }
#' 
#' @docType package 
#' @name drive_googleAuthR
#' 
NULL
## NULL

#' A helper function that tests whether an object is either NULL _or_
#' a list of NULLs
#'
#' @keywords internal
is.NullOb <- function(x) is.null(x) | all(sapply(x, is.null))
#' Recursively step down into list, removing all such objects
#'
#' @keywords internal
rmNullObs <- function(x) {
    x <- Filter(Negate(is.NullOb), x)
    lapply(x, function(x) if (is.list(x)) 
        rmNullObs(x) else x)
}

#' Gets information about the user, the user's Drive, and system capabilities.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' #' @importFrom googleAuthR gar_api_generator
#' @export
about.get <- function() {
    url <- "https://www.googleapis.com/drive/v3/about"
    # drive.about.get
    f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
    f()
    
}

#' Gets the starting pageToken for listing future changes.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param driveId The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param teamDriveId Deprecated use driveId instead
#' @importFrom googleAuthR gar_api_generator
#' @export
changes.getStartPageToken <- function(driveId = NULL, supportsAllDrives = NULL, supportsTeamDrives = NULL, 
    teamDriveId = NULL) {
    url <- "https://www.googleapis.com/drive/v3/changes/startPageToken"
    # drive.changes.getStartPageToken
    pars = list(driveId = driveId, supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives, 
        teamDriveId = teamDriveId)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Lists the changes for a user or shared drive.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param pageToken The token for continuing a previous list request on the next page
#' @param driveId The shared drive from which changes are returned
#' @param includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file
#' @param includeItemsFromAllDrives Whether both My Drive and shared drive items should be included in results
#' @param includePermissionsForView Specifies which additional view's permissions to include in the response
#' @param includeRemoved Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access
#' @param includeTeamDriveItems Deprecated use includeItemsFromAllDrives instead
#' @param pageSize The maximum number of changes to return per page
#' @param restrictToMyDrive Whether to restrict the results to changes inside the My Drive hierarchy
#' @param spaces A comma-separated list of spaces to query within the user corpus
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param teamDriveId Deprecated use driveId instead
#' @importFrom googleAuthR gar_api_generator
#' @export
changes.list <- function(pageToken, driveId = NULL, includeCorpusRemovals = NULL, 
    includeItemsFromAllDrives = NULL, includePermissionsForView = NULL, includeRemoved = NULL, 
    includeTeamDriveItems = NULL, pageSize = NULL, restrictToMyDrive = NULL, spaces = NULL, 
    supportsAllDrives = NULL, supportsTeamDrives = NULL, teamDriveId = NULL) {
    url <- "https://www.googleapis.com/drive/v3/changes"
    # drive.changes.list
    pars = list(pageToken = pageToken, driveId = driveId, includeCorpusRemovals = includeCorpusRemovals, 
        includeItemsFromAllDrives = includeItemsFromAllDrives, includePermissionsForView = includePermissionsForView, 
        includeRemoved = includeRemoved, includeTeamDriveItems = includeTeamDriveItems, 
        pageSize = pageSize, restrictToMyDrive = restrictToMyDrive, spaces = spaces, 
        supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives, 
        teamDriveId = teamDriveId)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Subscribes to changes for a user.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Channel The \link{Channel} object to pass to this method
#' @param pageToken The token for continuing a previous list request on the next page
#' @param driveId The shared drive from which changes are returned
#' @param includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file
#' @param includeItemsFromAllDrives Whether both My Drive and shared drive items should be included in results
#' @param includePermissionsForView Specifies which additional view's permissions to include in the response
#' @param includeRemoved Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access
#' @param includeTeamDriveItems Deprecated use includeItemsFromAllDrives instead
#' @param pageSize The maximum number of changes to return per page
#' @param restrictToMyDrive Whether to restrict the results to changes inside the My Drive hierarchy
#' @param spaces A comma-separated list of spaces to query within the user corpus
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param teamDriveId Deprecated use driveId instead
#' @importFrom googleAuthR gar_api_generator
#' @family Channel functions
#' @export
changes.watch <- function(Channel, pageToken, driveId = NULL, includeCorpusRemovals = NULL, 
    includeItemsFromAllDrives = NULL, includePermissionsForView = NULL, includeRemoved = NULL, 
    includeTeamDriveItems = NULL, pageSize = NULL, restrictToMyDrive = NULL, spaces = NULL, 
    supportsAllDrives = NULL, supportsTeamDrives = NULL, teamDriveId = NULL) {
    url <- "https://www.googleapis.com/drive/v3/changes/watch"
    # drive.changes.watch
    pars = list(pageToken = pageToken, driveId = driveId, includeCorpusRemovals = includeCorpusRemovals, 
        includeItemsFromAllDrives = includeItemsFromAllDrives, includePermissionsForView = includePermissionsForView, 
        includeRemoved = includeRemoved, includeTeamDriveItems = includeTeamDriveItems, 
        pageSize = pageSize, restrictToMyDrive = restrictToMyDrive, spaces = spaces, 
        supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives, 
        teamDriveId = teamDriveId)
    f <- googleAuthR::gar_api_generator(url, "POST", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(Channel, "gar_Channel"))
    
    f(the_body = Channel)
    
}

#' Stop watching resources through this channel
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Channel The \link{Channel} object to pass to this method
#' #' @importFrom googleAuthR gar_api_generator
#' @family Channel functions
#' @export
channels.stop <- function(Channel) {
    url <- "https://www.googleapis.com/drive/v3/channels/stop"
    # drive.channels.stop
    f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
    stopifnot(inherits(Channel, "gar_Channel"))
    
    f(the_body = Channel)
    
}

#' Creates a new comment on a file.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Comment The \link{Comment} object to pass to this method
#' @param fileId The ID of the file
#' @importFrom googleAuthR gar_api_generator
#' @family Comment functions
#' @export
comments.create <- function(Comment, fileId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments", fileId)
    # drive.comments.create
    f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
    stopifnot(inherits(Comment, "gar_Comment"))
    
    f(the_body = Comment)
    
}

#' Deletes a comment.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param commentId The ID of the comment
#' @importFrom googleAuthR gar_api_generator
#' @export
comments.delete <- function(fileId, commentId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments/%s", fileId, 
        commentId)
    # drive.comments.delete
    f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
    f()
    
}

#' Gets a comment by ID.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param commentId The ID of the comment
#' @param includeDeleted Whether to return deleted comments
#' @importFrom googleAuthR gar_api_generator
#' @export
comments.get <- function(fileId, commentId, includeDeleted = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments/%s", fileId, 
        commentId)
    # drive.comments.get
    pars = list(includeDeleted = includeDeleted)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Lists a file's comments.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param includeDeleted Whether to include deleted comments
#' @param pageSize The maximum number of comments to return per page
#' @param pageToken The token for continuing a previous list request on the next page
#' @param startModifiedTime The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time)
#' @importFrom googleAuthR gar_api_generator
#' @export
comments.list <- function(fileId, includeDeleted = NULL, pageSize = NULL, pageToken = NULL, 
    startModifiedTime = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments", fileId)
    # drive.comments.list
    pars = list(includeDeleted = includeDeleted, pageSize = pageSize, pageToken = pageToken, 
        startModifiedTime = startModifiedTime)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Updates a comment with patch semantics.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Comment The \link{Comment} object to pass to this method
#' @param fileId The ID of the file
#' @param commentId The ID of the comment
#' @importFrom googleAuthR gar_api_generator
#' @family Comment functions
#' @export
comments.update <- function(Comment, fileId, commentId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments/%s", fileId, 
        commentId)
    # drive.comments.update
    f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
    stopifnot(inherits(Comment, "gar_Comment"))
    
    f(the_body = Comment)
    
}

#' Creates a new shared drive.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Drive The \link{Drive} object to pass to this method
#' @param requestId An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive
#' @importFrom googleAuthR gar_api_generator
#' @family Drive functions
#' @export
drives.create <- function(Drive, requestId) {
    url <- "https://www.googleapis.com/drive/v3/drives"
    # drive.drives.create
    pars = list(requestId = requestId)
    f <- googleAuthR::gar_api_generator(url, "POST", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(Drive, "gar_Drive"))
    
    f(the_body = Drive)
    
}

#' Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param driveId The ID of the shared drive
#' @importFrom googleAuthR gar_api_generator
#' @export
drives.delete <- function(driveId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/drives/%s", driveId)
    # drive.drives.delete
    f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
    f()
    
}

#' Gets a shared drive's metadata by ID.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param driveId The ID of the shared drive
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs
#' @importFrom googleAuthR gar_api_generator
#' @export
drives.get <- function(driveId, useDomainAdminAccess = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/drives/%s", driveId)
    # drive.drives.get
    pars = list(useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Hides a shared drive from the default view.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param driveId The ID of the shared drive
#' @importFrom googleAuthR gar_api_generator
#' @export
drives.hide <- function(driveId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/drives/%s/hide", driveId)
    # drive.drives.hide
    f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
    f()
    
}

#' Lists the user's shared drives.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param pageSize Maximum number of shared drives to return
#' @param pageToken Page token for shared drives
#' @param q Query string for searching shared drives
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then all shared drives of the domain in which the requester is an administrator are returned
#' @importFrom googleAuthR gar_api_generator
#' @export
drives.list <- function(pageSize = NULL, pageToken = NULL, q = NULL, useDomainAdminAccess = NULL) {
    url <- "https://www.googleapis.com/drive/v3/drives"
    # drive.drives.list
    pars = list(pageSize = pageSize, pageToken = pageToken, q = q, useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Restores a shared drive to the default view.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param driveId The ID of the shared drive
#' @importFrom googleAuthR gar_api_generator
#' @export
drives.unhide <- function(driveId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/drives/%s/unhide", driveId)
    # drive.drives.unhide
    f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
    f()
    
}

#' Updates the metadate for a shared drive.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Drive The \link{Drive} object to pass to this method
#' @param driveId The ID of the shared drive
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs
#' @importFrom googleAuthR gar_api_generator
#' @family Drive functions
#' @export
drives.update <- function(Drive, driveId, useDomainAdminAccess = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/drives/%s", driveId)
    # drive.drives.update
    pars = list(useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "PATCH", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(Drive, "gar_Drive"))
    
    f(the_body = Drive)
    
}

#' Creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.photos.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param File The \link{File} object to pass to this method
#' @param fileId The ID of the file
#' @param enforceSingleParent Deprecated
#' @param ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file
#' @param includePermissionsForView Specifies which additional view's permissions to include in the response
#' @param keepRevisionForever Whether to set the 'keepForever' field in the new head revision
#' @param ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code)
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @importFrom googleAuthR gar_api_generator
#' @family File functions
#' @export
files.copy <- function(File, fileId, enforceSingleParent = NULL, ignoreDefaultVisibility = NULL, 
    includePermissionsForView = NULL, keepRevisionForever = NULL, ocrLanguage = NULL, 
    supportsAllDrives = NULL, supportsTeamDrives = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/copy", fileId)
    # drive.files.copy
    pars = list(enforceSingleParent = enforceSingleParent, ignoreDefaultVisibility = ignoreDefaultVisibility, 
        includePermissionsForView = includePermissionsForView, keepRevisionForever = keepRevisionForever, 
        ocrLanguage = ocrLanguage, supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives)
    f <- googleAuthR::gar_api_generator(url, "POST", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(File, "gar_File"))
    
    f(the_body = File)
    
}

#' Creates a new file.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param File The \link{File} object to pass to this method
#' @param enforceSingleParent Deprecated
#' @param ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file
#' @param includePermissionsForView Specifies which additional view's permissions to include in the response
#' @param keepRevisionForever Whether to set the 'keepForever' field in the new head revision
#' @param ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code)
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param useContentAsIndexableText Whether to use the uploaded content as indexable text
#' @importFrom googleAuthR gar_api_generator
#' @family File functions
#' @export
files.create <- function(File, enforceSingleParent = NULL, ignoreDefaultVisibility = NULL, 
    includePermissionsForView = NULL, keepRevisionForever = NULL, ocrLanguage = NULL, 
    supportsAllDrives = NULL, supportsTeamDrives = NULL, useContentAsIndexableText = NULL) {
    url <- "https://www.googleapis.com/drive/v3/files"
    # drive.files.create
    pars = list(enforceSingleParent = enforceSingleParent, ignoreDefaultVisibility = ignoreDefaultVisibility, 
        includePermissionsForView = includePermissionsForView, keepRevisionForever = keepRevisionForever, 
        ocrLanguage = ocrLanguage, supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives, 
        useContentAsIndexableText = useContentAsIndexableText)
    f <- googleAuthR::gar_api_generator(url, "POST", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(File, "gar_File"))
    
    f(the_body = 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. If the target is a folder, all descendants owned by the user are also deleted.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param enforceSingleParent Deprecated
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @importFrom googleAuthR gar_api_generator
#' @export
files.delete <- function(fileId, enforceSingleParent = NULL, supportsAllDrives = NULL, 
    supportsTeamDrives = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s", fileId)
    # drive.files.delete
    pars = list(enforceSingleParent = enforceSingleParent, supportsAllDrives = supportsAllDrives, 
        supportsTeamDrives = supportsTeamDrives)
    f <- googleAuthR::gar_api_generator(url, "DELETE", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Permanently deletes all of the user's trashed files.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param enforceSingleParent Deprecated
#' @importFrom googleAuthR gar_api_generator
#' @export
files.emptyTrash <- function(enforceSingleParent = NULL) {
    url <- "https://www.googleapis.com/drive/v3/files/trash"
    # drive.files.emptyTrash
    pars = list(enforceSingleParent = enforceSingleParent)
    f <- googleAuthR::gar_api_generator(url, "DELETE", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param mimeType The MIME type of the format requested for this export
#' @importFrom googleAuthR gar_api_generator
#' @export
files.export <- function(fileId, mimeType) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/export", fileId)
    # drive.files.export
    pars = list(mimeType = mimeType)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Generates a set of file IDs which can be provided in create or copy requests.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param count The number of IDs to return
#' @param space The space in which the IDs can be used to create new files
#' @importFrom googleAuthR gar_api_generator
#' @export
files.generateIds <- function(count = NULL, space = NULL) {
    url <- "https://www.googleapis.com/drive/v3/files/generateIds"
    # drive.files.generateIds
    pars = list(count = count, space = space)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Gets a file's metadata or content by ID.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files
#' @param includePermissionsForView Specifies which additional view's permissions to include in the response
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @importFrom googleAuthR gar_api_generator
#' @export
files.get <- function(fileId, acknowledgeAbuse = NULL, includePermissionsForView = NULL, 
    supportsAllDrives = NULL, supportsTeamDrives = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s", fileId)
    # drive.files.get
    pars = list(acknowledgeAbuse = acknowledgeAbuse, includePermissionsForView = includePermissionsForView, 
        supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Lists or searches files.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param corpora Groupings of files to which the query applies
#' @param corpus The source of files to list
#' @param driveId ID of the shared drive to search
#' @param includeItemsFromAllDrives Whether both My Drive and shared drive items should be included in results
#' @param includePermissionsForView Specifies which additional view's permissions to include in the response
#' @param includeTeamDriveItems Deprecated use includeItemsFromAllDrives instead
#' @param orderBy A comma-separated list of sort keys
#' @param pageSize The maximum number of files to return per page
#' @param pageToken The token for continuing a previous list request on the next page
#' @param q A query for filtering the file results
#' @param spaces A comma-separated list of spaces to query within the corpus
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param teamDriveId Deprecated use driveId instead
#' @importFrom googleAuthR gar_api_generator
#' @export
files.list <- function(corpora = NULL, corpus = NULL, driveId = NULL, includeItemsFromAllDrives = NULL, 
    includePermissionsForView = NULL, includeTeamDriveItems = NULL, orderBy = NULL, 
    pageSize = NULL, pageToken = NULL, q = NULL, spaces = NULL, supportsAllDrives = NULL, 
    supportsTeamDrives = NULL, teamDriveId = NULL) {
    url <- "https://www.googleapis.com/drive/v3/files"
    # drive.files.list
    pars = list(corpora = corpora, corpus = corpus, driveId = driveId, includeItemsFromAllDrives = includeItemsFromAllDrives, 
        includePermissionsForView = includePermissionsForView, includeTeamDriveItems = includeTeamDriveItems, 
        orderBy = orderBy, pageSize = pageSize, pageToken = pageToken, q = q, spaces = spaces, 
        supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives, 
        teamDriveId = teamDriveId)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Updates a file's metadata and/or content. This method supports patch semantics.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.scripts
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.scripts)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param File The \link{File} object to pass to this method
#' @param fileId The ID of the file
#' @param addParents A comma-separated list of parent IDs to add
#' @param enforceSingleParent Deprecated
#' @param includePermissionsForView Specifies which additional view's permissions to include in the response
#' @param keepRevisionForever Whether to set the 'keepForever' field in the new head revision
#' @param ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code)
#' @param removeParents A comma-separated list of parent IDs to remove
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param useContentAsIndexableText Whether to use the uploaded content as indexable text
#' @importFrom googleAuthR gar_api_generator
#' @family File functions
#' @export
files.update <- function(File, fileId, addParents = NULL, enforceSingleParent = NULL, 
    includePermissionsForView = NULL, keepRevisionForever = NULL, ocrLanguage = NULL, 
    removeParents = NULL, supportsAllDrives = NULL, supportsTeamDrives = NULL, useContentAsIndexableText = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s", fileId)
    # drive.files.update
    pars = list(addParents = addParents, enforceSingleParent = enforceSingleParent, 
        includePermissionsForView = includePermissionsForView, keepRevisionForever = keepRevisionForever, 
        ocrLanguage = ocrLanguage, removeParents = removeParents, supportsAllDrives = supportsAllDrives, 
        supportsTeamDrives = supportsTeamDrives, useContentAsIndexableText = useContentAsIndexableText)
    f <- googleAuthR::gar_api_generator(url, "PATCH", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(File, "gar_File"))
    
    f(the_body = File)
    
}

#' Subscribes to changes to a file
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Channel The \link{Channel} object to pass to this method
#' @param fileId The ID of the file
#' @param acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files
#' @param includePermissionsForView Specifies which additional view's permissions to include in the response
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @importFrom googleAuthR gar_api_generator
#' @family Channel functions
#' @export
files.watch <- function(Channel, fileId, acknowledgeAbuse = NULL, includePermissionsForView = NULL, 
    supportsAllDrives = NULL, supportsTeamDrives = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/watch", fileId)
    # drive.files.watch
    pars = list(acknowledgeAbuse = acknowledgeAbuse, includePermissionsForView = includePermissionsForView, 
        supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives)
    f <- googleAuthR::gar_api_generator(url, "POST", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(Channel, "gar_Channel"))
    
    f(the_body = Channel)
    
}

#' Creates a permission for a file or shared drive.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Permission The \link{Permission} object to pass to this method
#' @param fileId The ID of the file or shared drive
#' @param emailMessage A plain text custom message to include in the notification email
#' @param enforceSingleParent Deprecated
#' @param moveToNewOwnersRoot This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item
#' @param sendNotificationEmail Whether to send a notification email when sharing to users or groups
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs
#' @importFrom googleAuthR gar_api_generator
#' @family Permission functions
#' @export
permissions.create <- function(Permission, fileId, emailMessage = NULL, enforceSingleParent = NULL, 
    moveToNewOwnersRoot = NULL, sendNotificationEmail = NULL, supportsAllDrives = NULL, 
    supportsTeamDrives = NULL, transferOwnership = NULL, useDomainAdminAccess = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/permissions", fileId)
    # drive.permissions.create
    pars = list(emailMessage = emailMessage, enforceSingleParent = enforceSingleParent, 
        moveToNewOwnersRoot = moveToNewOwnersRoot, sendNotificationEmail = sendNotificationEmail, 
        supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives, 
        transferOwnership = transferOwnership, useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "POST", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(Permission, "gar_Permission"))
    
    f(the_body = Permission)
    
}

#' Deletes a permission.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file or shared drive
#' @param permissionId The ID of the permission
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs
#' @importFrom googleAuthR gar_api_generator
#' @export
permissions.delete <- function(fileId, permissionId, supportsAllDrives = NULL, supportsTeamDrives = NULL, 
    useDomainAdminAccess = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/permissions/%s", 
        fileId, permissionId)
    # drive.permissions.delete
    pars = list(supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives, 
        useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "DELETE", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Gets a permission by ID.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param permissionId The ID of the permission
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs
#' @importFrom googleAuthR gar_api_generator
#' @export
permissions.get <- function(fileId, permissionId, supportsAllDrives = NULL, supportsTeamDrives = NULL, 
    useDomainAdminAccess = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/permissions/%s", 
        fileId, permissionId)
    # drive.permissions.get
    pars = list(supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives, 
        useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Lists a file's or shared drive's permissions.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file or shared drive
#' @param includePermissionsForView Specifies which additional view's permissions to include in the response
#' @param pageSize The maximum number of permissions to return per page
#' @param pageToken The token for continuing a previous list request on the next page
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs
#' @importFrom googleAuthR gar_api_generator
#' @export
permissions.list <- function(fileId, includePermissionsForView = NULL, pageSize = NULL, 
    pageToken = NULL, supportsAllDrives = NULL, supportsTeamDrives = NULL, useDomainAdminAccess = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/permissions", fileId)
    # drive.permissions.list
    pars = list(includePermissionsForView = includePermissionsForView, pageSize = pageSize, 
        pageToken = pageToken, supportsAllDrives = supportsAllDrives, supportsTeamDrives = supportsTeamDrives, 
        useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Updates a permission with patch semantics.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Permission The \link{Permission} object to pass to this method
#' @param fileId The ID of the file or shared drive
#' @param permissionId The ID of the permission
#' @param removeExpiration Whether to remove the expiration date
#' @param supportsAllDrives Whether the requesting application supports both My Drives and shared drives
#' @param supportsTeamDrives Deprecated use supportsAllDrives instead
#' @param transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs
#' @importFrom googleAuthR gar_api_generator
#' @family Permission functions
#' @export
permissions.update <- function(Permission, fileId, permissionId, removeExpiration = NULL, 
    supportsAllDrives = NULL, supportsTeamDrives = NULL, transferOwnership = NULL, 
    useDomainAdminAccess = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/permissions/%s", 
        fileId, permissionId)
    # drive.permissions.update
    pars = list(removeExpiration = removeExpiration, supportsAllDrives = supportsAllDrives, 
        supportsTeamDrives = supportsTeamDrives, transferOwnership = transferOwnership, 
        useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "PATCH", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(Permission, "gar_Permission"))
    
    f(the_body = Permission)
    
}

#' Creates a new reply to a comment.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Reply The \link{Reply} object to pass to this method
#' @param fileId The ID of the file
#' @param commentId The ID of the comment
#' @importFrom googleAuthR gar_api_generator
#' @family Reply functions
#' @export
replies.create <- function(Reply, fileId, commentId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments/%s/replies", 
        fileId, commentId)
    # drive.replies.create
    f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
    stopifnot(inherits(Reply, "gar_Reply"))
    
    f(the_body = Reply)
    
}

#' Deletes a reply.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param commentId The ID of the comment
#' @param replyId The ID of the reply
#' @importFrom googleAuthR gar_api_generator
#' @export
replies.delete <- function(fileId, commentId, replyId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments/%s/replies/%s", 
        fileId, commentId, replyId)
    # drive.replies.delete
    f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
    f()
    
}

#' Gets a reply by ID.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param commentId The ID of the comment
#' @param replyId The ID of the reply
#' @param includeDeleted Whether to return deleted replies
#' @importFrom googleAuthR gar_api_generator
#' @export
replies.get <- function(fileId, commentId, replyId, includeDeleted = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments/%s/replies/%s", 
        fileId, commentId, replyId)
    # drive.replies.get
    pars = list(includeDeleted = includeDeleted)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Lists a comment's replies.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param commentId The ID of the comment
#' @param includeDeleted Whether to include deleted replies
#' @param pageSize The maximum number of replies to return per page
#' @param pageToken The token for continuing a previous list request on the next page
#' @importFrom googleAuthR gar_api_generator
#' @export
replies.list <- function(fileId, commentId, includeDeleted = NULL, pageSize = NULL, 
    pageToken = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments/%s/replies", 
        fileId, commentId)
    # drive.replies.list
    pars = list(includeDeleted = includeDeleted, pageSize = pageSize, pageToken = pageToken)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Updates a reply with patch semantics.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Reply The \link{Reply} object to pass to this method
#' @param fileId The ID of the file
#' @param commentId The ID of the comment
#' @param replyId The ID of the reply
#' @importFrom googleAuthR gar_api_generator
#' @family Reply functions
#' @export
replies.update <- function(Reply, fileId, commentId, replyId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/comments/%s/replies/%s", 
        fileId, commentId, replyId)
    # drive.replies.update
    f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
    stopifnot(inherits(Reply, "gar_Reply"))
    
    f(the_body = Reply)
    
}

#' Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param revisionId The ID of the revision
#' @importFrom googleAuthR gar_api_generator
#' @export
revisions.delete <- function(fileId, revisionId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/revisions/%s", fileId, 
        revisionId)
    # drive.revisions.delete
    f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
    f()
    
}

#' Gets a revision's metadata or content by ID.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param revisionId The ID of the revision
#' @param acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files
#' @importFrom googleAuthR gar_api_generator
#' @export
revisions.get <- function(fileId, revisionId, acknowledgeAbuse = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/revisions/%s", fileId, 
        revisionId)
    # drive.revisions.get
    pars = list(acknowledgeAbuse = acknowledgeAbuse)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Lists a file's revisions.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' \item https://www.googleapis.com/auth/drive.metadata
#' \item https://www.googleapis.com/auth/drive.metadata.readonly
#' \item https://www.googleapis.com/auth/drive.photos.readonly
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file, https://www.googleapis.com/auth/drive.metadata, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.photos.readonly, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param fileId The ID of the file
#' @param pageSize The maximum number of revisions to return per page
#' @param pageToken The token for continuing a previous list request on the next page
#' @importFrom googleAuthR gar_api_generator
#' @export
revisions.list <- function(fileId, pageSize = NULL, pageToken = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/revisions", fileId)
    # drive.revisions.list
    pars = list(pageSize = pageSize, pageToken = pageToken)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Updates a revision with patch semantics.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.appdata
#' \item https://www.googleapis.com/auth/drive.file
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.file)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param Revision The \link{Revision} object to pass to this method
#' @param fileId The ID of the file
#' @param revisionId The ID of the revision
#' @importFrom googleAuthR gar_api_generator
#' @family Revision functions
#' @export
revisions.update <- function(Revision, fileId, revisionId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/files/%s/revisions/%s", fileId, 
        revisionId)
    # drive.revisions.update
    f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
    stopifnot(inherits(Revision, "gar_Revision"))
    
    f(the_body = Revision)
    
}

#' Deprecated use drives.create instead.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param TeamDrive The \link{TeamDrive} object to pass to this method
#' @param requestId An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive
#' @importFrom googleAuthR gar_api_generator
#' @family TeamDrive functions
#' @export
teamdrives.create <- function(TeamDrive, requestId) {
    url <- "https://www.googleapis.com/drive/v3/teamdrives"
    # drive.teamdrives.create
    pars = list(requestId = requestId)
    f <- googleAuthR::gar_api_generator(url, "POST", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    stopifnot(inherits(TeamDrive, "gar_TeamDrive"))
    
    f(the_body = TeamDrive)
    
}

#' Deprecated use drives.delete instead.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param teamDriveId The ID of the Team Drive
#' @importFrom googleAuthR gar_api_generator
#' @export
teamdrives.delete <- function(teamDriveId) {
    url <- sprintf("https://www.googleapis.com/drive/v3/teamdrives/%s", teamDriveId)
    # drive.teamdrives.delete
    f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
    f()
    
}

#' Deprecated use drives.get instead.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param teamDriveId The ID of the Team Drive
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs
#' @importFrom googleAuthR gar_api_generator
#' @export
teamdrives.get <- function(teamDriveId, useDomainAdminAccess = NULL) {
    url <- sprintf("https://www.googleapis.com/drive/v3/teamdrives/%s", teamDriveId)
    # drive.teamdrives.get
    pars = list(useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}

#' Deprecated use drives.list instead.
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' \item https://www.googleapis.com/auth/drive.readonly
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param pageSize Maximum number of Team Drives to return
#' @param pageToken Page token for Team Drives
#' @param q Query string for searching Team Drives
#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned
#' @importFrom googleAuthR gar_api_generator
#' @export
teamdrives.list <- function(pageSize = NULL, pageToken = NULL, q = NULL, useDomainAdminAccess = NULL) {
    url <- "https://www.googleapis.com/drive/v3/teamdrives"
    # drive.teamdrives.list
    pars = list(pageSize = pageSize, pageToken = pageToken, q = q, useDomainAdminAccess = useDomainAdminAccess)
    f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    f()
    
}


#' Deprecated use drives.update instead
#' 
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#' 
#' @seealso \href{https://developers.google.com/drive/}{Google Documentation}
#' 
#' @details 
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/drive
#' }
#' 
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/drive)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details. 
#' 
#' @param TeamDrive The \link{TeamDrive} object to pass to this method
#' @param teamDriveId The ID of the Team Drive

#' @param useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs
#' @importFrom googleAuthR gar_api_generator
#' @family TeamDrive functions
#' @export


teamdrives.update <- function(TeamDrive, teamDriveId, useDomainAdminAccess = NULL) {
    
    
    url <- sprintf("https://www.googleapis.com/drive/v3/teamdrives/%s", teamDriveId)
    # drive.teamdrives.update
    pars = list(useDomainAdminAccess = useDomainAdminAccess)
    
    f <- googleAuthR::gar_api_generator(url, "PATCH", pars_args = rmNullObs(pars), 
        data_parse_function = function(x) x)
    
    stopifnot(inherits(TeamDrive, "gar_TeamDrive"))
    
    f(the_body = TeamDrive)
    
    
}
samterfa/googlePackageMaker documentation built on May 18, 2022, 10:58 a.m.