#' Creates a new comment on a file.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @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
#' }
#' @param fileId The ID of the file.
#' @param anchor A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties.
#' @param author The author of the comment. The author's email address and permission ID will not be populated.
#' @param content The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed.
#' @param createdTime The time at which the comment was created (RFC 3339 date-time).
#' @param deleted Whether the comment has been deleted. A deleted comment has no content.
#' @param htmlContent The content of the comment with HTML formatting.
#' @param id The ID of the comment.
#' @param kind Identifies what kind of resource this is. Value: the fixed string "drive#comment".
#' @param modifiedTime The last time the comment or any of its replies was modified (RFC 3339 date-time).
#' @param quotedFileContent The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment.
#' @param replies The full list of replies to the comment in chronological order.
#' @param resolved Whether the comment has been resolved by one of its replies.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
comments.create <- function(fileId, anchor = NULL, author = NULL, content = NULL, createdTime = NULL, deleted = NULL, htmlContent = NULL, id = NULL, kind = NULL, modifiedTime = NULL, quotedFileContent = NULL, replies = NULL, resolved = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['drive.comments.create']]$scopes), return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['drive.comments.create']], params = params, base_url = 'https://www.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
#' Deletes a comment.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @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
#' }
#' @param commentId The ID of the comment.
#' @param fileId The ID of the file.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
comments.delete <- function(commentId, fileId, gargle_token = gargle::token_fetch(scopes = .endpoints[['drive.comments.delete']]$scopes), return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['drive.comments.delete']], params = params, base_url = 'https://www.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
#' Gets a comment by ID.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @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
#' }
#' @param commentId The ID of the comment.
#' @param fileId The ID of the file.
#' @param includeDeleted Whether to return deleted comments. Deleted comments will not include their original content.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
comments.get <- function(commentId, fileId, includeDeleted = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['drive.comments.get']]$scopes), return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['drive.comments.get']], params = params, base_url = 'https://www.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
#' Lists a file's comments.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @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
#' }
#' @param fileId The ID of the file.
#' @param includeDeleted Whether to include deleted comments. Deleted comments will not include their original content.
#' @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. This should be set to the value of 'nextPageToken' from the previous response.
#' @param startModifiedTime The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time).
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
comments.list <- function(fileId, includeDeleted = NULL, pageSize = NULL, pageToken = NULL, startModifiedTime = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['drive.comments.list']]$scopes), return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['drive.comments.list']], params = params, base_url = 'https://www.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
#' Updates a comment with patch semantics.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @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
#' }
#' @param commentId The ID of the comment.
#' @param fileId The ID of the file.
#' @param anchor A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties.
#' @param author The author of the comment. The author's email address and permission ID will not be populated.
#' @param content The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed.
#' @param createdTime The time at which the comment was created (RFC 3339 date-time).
#' @param deleted Whether the comment has been deleted. A deleted comment has no content.
#' @param htmlContent The content of the comment with HTML formatting.
#' @param id The ID of the comment.
#' @param kind Identifies what kind of resource this is. Value: the fixed string "drive#comment".
#' @param modifiedTime The last time the comment or any of its replies was modified (RFC 3339 date-time).
#' @param quotedFileContent The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment.
#' @param replies The full list of replies to the comment in chronological order.
#' @param resolved Whether the comment has been resolved by one of its replies.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
comments.update <- function(commentId, fileId, anchor = NULL, author = NULL, content = NULL, createdTime = NULL, deleted = NULL, htmlContent = NULL, id = NULL, kind = NULL, modifiedTime = NULL, quotedFileContent = NULL, replies = NULL, resolved = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['drive.comments.update']]$scopes), return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['drive.comments.update']], params = params, base_url = 'https://www.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.