samples/AdminDirectoryV1/R/roles.R

	#' Deletes a role.
	#'
	#'  Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
	#'
	#' @seealso \href{http://developers.google.com/admin-sdk/}{Google Documentation}
	#'
	#' @details
	#' Authentication scopes used by this function are:
	#' \itemize{
	#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement
	#' }
	#' @param roleId Immutable ID of the role.
	#' @param customer Immutable ID of the Google Workspace account.
	#' @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
	roles.delete <- function(roleId, customer, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.roles.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[['directory.roles.delete']], params = params, base_url = 'https://admin.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)
	}

	#' Retrieves a role.
	#'
	#'  Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
	#'
	#' @seealso \href{http://developers.google.com/admin-sdk/}{Google Documentation}
	#'
	#' @details
	#' Authentication scopes used by this function are:
	#' \itemize{
	#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement
	#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly
	#' }
	#' @param customer Immutable ID of the Google Workspace account.
	#' @param roleId Immutable ID of the role.
	#' @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
	roles.get <- function(customer, roleId, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.roles.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[['directory.roles.get']], params = params, base_url = 'https://admin.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)
	}

	#' Creates a role.
	#'
	#'  Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
	#'
	#' @seealso \href{http://developers.google.com/admin-sdk/}{Google Documentation}
	#'
	#' @details
	#' Authentication scopes used by this function are:
	#' \itemize{
	#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement
	#' }
	#' @param customer Immutable ID of the Google Workspace account.
	#' @param isSuperAdminRole Returns `true` if the role is a super admin role.
	#' @param isSystemRole Returns `true` if this is a pre-defined system role.
	#' @param rolePrivileges The set of privileges that are granted to this role.
	#' @param roleName Name of the role.
	#' @param etag ETag of the resource.
	#' @param roleDescription A short description of the role.
	#' @param kind The type of the API resource. This is always `admin#directory#role`.
	#' @param roleId ID of the role.
	#' @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
	roles.insert <- function(customer, isSuperAdminRole = NULL, isSystemRole = NULL, rolePrivileges = NULL, roleName = NULL, etag = NULL, roleDescription = NULL, kind = NULL, roleId = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.roles.insert']]$scopes), return_response = F){
		params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
		req <- gargle::request_develop(endpoint = .endpoints[['directory.roles.insert']], params = params, base_url = 'https://admin.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)
	}

	#' Retrieves a paginated list of all the roles in a domain.
	#'
	#'  Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
	#'
	#' @seealso \href{http://developers.google.com/admin-sdk/}{Google Documentation}
	#'
	#' @details
	#' Authentication scopes used by this function are:
	#' \itemize{
	#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement
	#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly
	#' }
	#' @param customer Immutable ID of the Google Workspace account.
	#' @param pageToken Token to specify the next page in the list.
	#' @param maxResults Maximum number of results to return.
	#' @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
	roles.list <- function(customer, pageToken = NULL, maxResults = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.roles.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[['directory.roles.list']], params = params, base_url = 'https://admin.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)
	}

	#' NA
	#'
	#' NA Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
	#'
	#' @seealso \href{http://developers.google.com/admin-sdk/}{Google Documentation}
	#'
	#' @details
	#' Authentication scopes used by this function are:
	#' \itemize{
	#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement
	#' }
	#' @param customer Immutable ID of the Google Workspace account.
	#' @param roleId Immutable ID of the role.
	#' @param isSuperAdminRole Returns `true` if the role is a super admin role.
	#' @param isSystemRole Returns `true` if this is a pre-defined system role.
	#' @param rolePrivileges The set of privileges that are granted to this role.
	#' @param roleName Name of the role.
	#' @param etag ETag of the resource.
	#' @param roleDescription A short description of the role.
	#' @param kind The type of the API resource. This is always `admin#directory#role`.
	#' @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
	roles.patch <- function(customer, roleId, isSuperAdminRole = NULL, isSystemRole = NULL, rolePrivileges = NULL, roleName = NULL, etag = NULL, roleDescription = NULL, kind = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.roles.patch']]$scopes), return_response = F){
		params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
		req <- gargle::request_develop(endpoint = .endpoints[['directory.roles.patch']], params = params, base_url = 'https://admin.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 role.
	#'
	#'  Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
	#'
	#' @seealso \href{http://developers.google.com/admin-sdk/}{Google Documentation}
	#'
	#' @details
	#' Authentication scopes used by this function are:
	#' \itemize{
	#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement
	#' }
	#' @param customer Immutable ID of the Google Workspace account.
	#' @param roleId Immutable ID of the role.
	#' @param isSuperAdminRole Returns `true` if the role is a super admin role.
	#' @param isSystemRole Returns `true` if this is a pre-defined system role.
	#' @param rolePrivileges The set of privileges that are granted to this role.
	#' @param roleName Name of the role.
	#' @param etag ETag of the resource.
	#' @param roleDescription A short description of the role.
	#' @param kind The type of the API resource. This is always `admin#directory#role`.
	#' @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
	roles.update <- function(customer, roleId, isSuperAdminRole = NULL, isSystemRole = NULL, rolePrivileges = NULL, roleName = NULL, etag = NULL, roleDescription = NULL, kind = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.roles.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[['directory.roles.update']], params = params, base_url = 'https://admin.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)
	}
samterfa/googlePackageMaker documentation built on May 18, 2022, 10:58 a.m.