#' Admin SDK API
#' Admin SDK lets administrators of enterprise domains to view and manage resources like user, groups etc. It also provides audit and usage reports of domain.
#'
#' Auto-generated code by googleAuthR::gar_create_api_skeleton
#' at 2020-12-12 11:12:08
#' filename: admin_dir.R
#' api_json: discovery_api admin directory_v1
#'
#' @details
#' Authentication scopes used are:
#' \itemize{
#' \item https://www.googleapis.com/auth/admin.directory.orgunit
#' \item https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly
#' \item https://www.googleapis.com/auth/admin.directory.group.readonly
#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.readonly
#' \item https://www.googleapis.com/auth/admin.directory.userschema
#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly
#' \item https://www.googleapis.com/auth/admin.directory.device.chromeos
#' \item https://www.googleapis.com/auth/admin.directory.orgunit.readonly
#' \item https://www.googleapis.com/auth/admin.directory.user
#' \item https://www.googleapis.com/auth/admin.directory.customer
#' \item https://www.googleapis.com/auth/admin.directory.device.mobile
#' \item https://www.googleapis.com/auth/admin.directory.domain.readonly
#' \item https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly
#' \item https://www.googleapis.com/auth/admin.directory.group.member
#' \item https://www.googleapis.com/auth/admin.directory.group
#' \item https://www.googleapis.com/auth/admin.directory.user.alias
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' \item https://www.googleapis.com/auth/admin.directory.userschema.readonly
#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.action
#' \item https://www.googleapis.com/auth/admin.directory.user.alias.readonly
#' \item https://www.googleapis.com/auth/admin.directory.resource.calendar
#' \item https://www.googleapis.com/auth/admin.directory.customer.readonly
#' \item https://www.googleapis.com/auth/admin.directory.rolemanagement
#' \item https://www.googleapis.com/auth/admin.directory.group.member.readonly
#' \item https://www.googleapis.com/auth/admin.directory.user.security
#' \item https://www.googleapis.com/auth/admin.directory.domain
#' \item https://www.googleapis.com/auth/cloud-platform
#' }
#'
#' @docType package
#' @name admin_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)
}
#' Updates a customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.customer
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.customer)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Customer The \link{Customer} object to pass to this method
#' @param customerKey Id of the customer to be updated
#' @importFrom googleAuthR gar_api_generator
#' @family Customer functions
#' @export
directory.customers.update <- function(Customer, customerKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customers/%s",
customerKey)
# directory.customers.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(Customer, "gar_Customer"))
f(the_body = Customer)
}
#' Retrieves a customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.customer
#' \item https://www.googleapis.com/auth/admin.directory.customer.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.customer, https://www.googleapis.com/auth/admin.directory.customer.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerKey Id of the customer to be retrieved
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.customers.get <- function(customerKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customers/%s",
customerKey)
# directory.customers.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Patch Customers via Apiary Patch Orchestration
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.customer
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.customer)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Customer The \link{Customer} object to pass to this method
#' @param customerKey Id of the customer to be updated
#' @importFrom googleAuthR gar_api_generator
#' @family Customer functions
#' @export
directory.customers.patch <- function(Customer, customerKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customers/%s",
customerKey)
# directory.customers.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(Customer, "gar_Customer"))
f(the_body = Customer)
}
#' Stop watching resources through this channel.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.alias
#' \item https://www.googleapis.com/auth/admin.directory.user.alias.readonly
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' \item https://www.googleapis.com/auth/cloud-platform
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.alias, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/cloud-platform)}
#' 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://admin.googleapis.com/admin/directory_v1/channels/stop"
# admin.channels.stop
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(Channel, "gar_Channel"))
f(the_body = Channel)
}
#' Removes a mobile device.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.mobile
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.mobile)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId The unique ID for the customer's G Suite account
#' @param resourceId The unique ID the API service uses to identify the mobile device
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.mobiledevices.delete <- function(customerId, resourceId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/mobile/%s",
customerId, resourceId)
# directory.mobiledevices.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Takes an action that affects a mobile device. For example, remotely wiping a device.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.mobile
#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.action
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.mobile, https://www.googleapis.com/auth/admin.directory.device.mobile.action)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param MobileDeviceAction The \link{MobileDeviceAction} object to pass to this method
#' @param customerId The unique ID for the customer's G Suite account
#' @param resourceId The unique ID the API service uses to identify the mobile device
#' @importFrom googleAuthR gar_api_generator
#' @family MobileDeviceAction functions
#' @export
directory.mobiledevices.action <- function(MobileDeviceAction, customerId, resourceId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/mobile/%s/action",
customerId, resourceId)
# directory.mobiledevices.action
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(MobileDeviceAction, "gar_MobileDeviceAction"))
f(the_body = MobileDeviceAction)
}
#' Retrieves a paginated list of all mobile devices for an account.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.mobile
#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.action
#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.mobile, https://www.googleapis.com/auth/admin.directory.device.mobile.action, https://www.googleapis.com/auth/admin.directory.device.mobile.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId The unique ID for the customer's G Suite account
#' @param orderBy Device property to use for sorting results
#' @param sortOrder Whether to return results in ascending or descending order
#' @param projection Restrict information returned to a set of selected fields
#' @param pageToken Token to specify next page in the list
#' @param maxResults Maximum number of results to return
#' @param query Search string in the format given at http://support
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.mobiledevices.list <- function(customerId, orderBy = NULL, sortOrder = NULL,
projection = NULL, pageToken = NULL, maxResults = NULL, query = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/mobile",
customerId)
# directory.mobiledevices.list
pars = list(orderBy = orderBy, sortOrder = sortOrder, projection = projection,
pageToken = pageToken, maxResults = maxResults, query = query)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Retrieves a mobile device's properties.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.mobile
#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.action
#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.mobile, https://www.googleapis.com/auth/admin.directory.device.mobile.action, https://www.googleapis.com/auth/admin.directory.device.mobile.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId The unique ID for the customer's G Suite account
#' @param resourceId The unique ID the API service uses to identify the mobile device
#' @param projection Restrict information returned to a set of selected fields
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.mobiledevices.get <- function(customerId, resourceId, projection = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/mobile/%s",
customerId, resourceId)
# directory.mobiledevices.get
pars = list(projection = projection)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Updates a group's properties.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Group The \link{Group} object to pass to this method
#' @param groupKey Identifies the group in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family Group functions
#' @export
directory.groups.update <- function(Group, groupKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s", groupKey)
# directory.groups.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(Group, "gar_Group"))
f(the_body = Group)
}
#' Creates a group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Group The \link{Group} object to pass to this method
#' #' @importFrom googleAuthR gar_api_generator
#' @family Group functions
#' @export
directory.groups.insert <- function(Group) {
url <- "https://admin.googleapis.com/admin/directory/v1/groups"
# directory.groups.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(Group, "gar_Group"))
f(the_body = Group)
}
#' Updates a group's properties. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Group The \link{Group} object to pass to this method
#' @param groupKey Identifies the group in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family Group functions
#' @export
directory.groups.patch <- function(Group, groupKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s", groupKey)
# directory.groups.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(Group, "gar_Group"))
f(the_body = Group)
}
#' Deletes a group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param groupKey Identifies the group in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.groups.delete <- function(groupKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s", groupKey)
# directory.groups.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Retrieves a group's properties.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param groupKey Identifies the group in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.groups.get <- function(groupKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s", groupKey)
# directory.groups.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Retrieve all groups of a domain or of a user given a userKey (paginated)
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param sortOrder Whether to return results in ascending or descending order
#' @param orderBy Column to use for sorting results
#' @param query Query string search
#' @param userKey Email or immutable ID of the user if only those groups are to be listed, the given user is a member of
#' @param customer The unique ID for the customer's G Suite account
#' @param domain The domain name
#' @param pageToken Token to specify next page in the list
#' @param maxResults Maximum number of results to return
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.groups.list <- function(sortOrder = NULL, orderBy = NULL, query = NULL,
userKey = NULL, customer = NULL, domain = NULL, pageToken = NULL, maxResults = NULL) {
url <- "https://admin.googleapis.com/admin/directory/v1/groups"
# directory.groups.list
pars = list(sortOrder = sortOrder, orderBy = orderBy, query = query, userKey = userKey,
customer = customer, domain = domain, pageToken = pageToken, maxResults = maxResults)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Removes an alias.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param groupKey Identifies the group in the API request
#' @param alias The alias to be removed
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.groups.aliases.delete <- function(groupKey, alias) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/aliases/%s",
groupKey, alias)
# directory.groups.aliases.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Adds an alias for the group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Alias The \link{Alias} object to pass to this method
#' @param groupKey Identifies the group in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family Alias functions
#' @export
directory.groups.aliases.insert <- function(Alias, groupKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/aliases",
groupKey)
# directory.groups.aliases.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(Alias, "gar_Alias"))
f(the_body = Alias)
}
#' Lists all aliases for a group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param groupKey Identifies the group in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.groups.aliases.list <- function(groupKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/aliases",
groupKey)
# directory.groups.aliases.list
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Retrieves a user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @param customFieldMask A comma-separated list of schema names
#' @param projection What subset of fields to fetch for this user
#' @param viewType Whether to fetch the administrator-only or domain-wide public view of the user
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.users.get <- function(userKey, customFieldMask = NULL, projection = NULL,
viewType = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s", userKey)
# directory.users.get
pars = list(customFieldMask = customFieldMask, projection = projection, viewType = viewType)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Updates a user using patch semantics. The update method should be used instead, since it also supports patch semantics and has better performance. This method is unable to clear fields that contain repeated objects (`addresses`, `phones`, etc). Use the update method instead.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param User The \link{User} object to pass to this method
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family User functions
#' @export
directory.users.patch <- function(User, userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s", userKey)
# directory.users.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(User, "gar_User"))
f(the_body = User)
}
#' Updates a user. This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved, and fields set to `null` will be cleared.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param User The \link{User} object to pass to this method
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family User functions
#' @export
directory.users.update <- function(User, userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s", userKey)
# directory.users.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(User, "gar_User"))
f(the_body = User)
}
#' Undeletes a deleted user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param UserUndelete The \link{UserUndelete} object to pass to this method
#' @param userKey The immutable id of the user
#' @importFrom googleAuthR gar_api_generator
#' @family UserUndelete functions
#' @export
directory.users.undelete <- function(UserUndelete, userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/undelete",
userKey)
# directory.users.undelete
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(UserUndelete, "gar_UserUndelete"))
f(the_body = UserUndelete)
}
#' Makes a user a super administrator.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param UserMakeAdmin The \link{UserMakeAdmin} object to pass to this method
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family UserMakeAdmin functions
#' @export
directory.users.makeAdmin <- function(UserMakeAdmin, userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/makeAdmin",
userKey)
# directory.users.makeAdmin
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(UserMakeAdmin, "gar_UserMakeAdmin"))
f(the_body = UserMakeAdmin)
}
#' Retrieves a paginated list of either deleted users or all users in a domain.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' \item https://www.googleapis.com/auth/cloud-platform
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/cloud-platform)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param viewType Whether to fetch the administrator-only or domain-wide public view of the user
#' @param projection What subset of fields to fetch for this user
#' @param sortOrder Whether to return results in ascending or descending order
#' @param orderBy Property to use for sorting results
#' @param customFieldMask A comma-separated list of schema names
#' @param customer The unique ID for the customer's G Suite account
#' @param query Query string for searching user fields
#' @param pageToken Token to specify next page in the list
#' @param maxResults Maximum number of results to return
#' @param domain The domain name
#' @param showDeleted If set to `true`, retrieves the list of deleted users
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.users.list <- function(viewType = NULL, projection = NULL, sortOrder = NULL,
orderBy = NULL, customFieldMask = NULL, customer = NULL, query = NULL, pageToken = NULL,
maxResults = NULL, domain = NULL, showDeleted = NULL) {
url <- "https://admin.googleapis.com/admin/directory/v1/users"
# directory.users.list
pars = list(viewType = viewType, projection = projection, sortOrder = sortOrder,
orderBy = orderBy, customFieldMask = customFieldMask, customer = customer,
query = query, pageToken = pageToken, maxResults = maxResults, domain = domain,
showDeleted = showDeleted)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Sign a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the target user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.users.signOut <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/signOut",
userKey)
# directory.users.signOut
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
f()
}
#' Creates a user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param User The \link{User} object to pass to this method
#' #' @importFrom googleAuthR gar_api_generator
#' @family User functions
#' @export
directory.users.insert <- function(User) {
url <- "https://admin.googleapis.com/admin/directory/v1/users"
# directory.users.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(User, "gar_User"))
f(the_body = User)
}
#' Watch for changes in users list
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' \item https://www.googleapis.com/auth/cloud-platform
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/cloud-platform)}
#' 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 query Query string search
#' @param domain Name of the domain
#' @param orderBy Column to use for sorting results
#' @param maxResults Maximum number of results to return
#' @param sortOrder Whether to return results in ascending or descending order
#' @param event Events to watch for
#' @param showDeleted If set to true, retrieves the list of deleted users
#' @param viewType Whether to fetch the administrator-only or domain-wide public view of the user
#' @param customer Immutable ID of the G Suite account
#' @param pageToken Token to specify next page in the list
#' @param customFieldMask Comma-separated list of schema names
#' @param projection What subset of fields to fetch for this user
#' @importFrom googleAuthR gar_api_generator
#' @family Channel functions
#' @export
directory.users.watch <- function(Channel, query = NULL, domain = NULL, orderBy = NULL,
maxResults = NULL, sortOrder = NULL, event = NULL, showDeleted = NULL, viewType = NULL,
customer = NULL, pageToken = NULL, customFieldMask = NULL, projection = NULL) {
url <- "https://admin.googleapis.com/admin/directory/v1/users/watch"
# directory.users.watch
pars = list(query = query, domain = domain, orderBy = orderBy, maxResults = maxResults,
sortOrder = sortOrder, event = event, showDeleted = showDeleted, viewType = viewType,
customer = customer, pageToken = pageToken, customFieldMask = customFieldMask,
projection = projection)
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)
}
#' Deletes a user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.users.delete <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s", userKey)
# directory.users.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Adds an alias.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.alias
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.alias)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Alias The \link{Alias} object to pass to this method
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family Alias functions
#' @export
directory.users.aliases.insert <- function(Alias, userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/aliases",
userKey)
# directory.users.aliases.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(Alias, "gar_Alias"))
f(the_body = Alias)
}
#' Lists all aliases for a user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.alias
#' \item https://www.googleapis.com/auth/admin.directory.user.alias.readonly
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.alias, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.users.aliases.list <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/aliases",
userKey)
# directory.users.aliases.list
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Removes an alias.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.alias
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.alias)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @param alias The alias to be removed
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.users.aliases.delete <- function(userKey, alias) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/aliases/%s",
userKey, alias)
# directory.users.aliases.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Watch for changes in users list.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.alias
#' \item https://www.googleapis.com/auth/admin.directory.user.alias.readonly
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.alias, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/admin.directory.user.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 userKey Email or immutable ID of the user
#' @param event Events to watch for
#' @importFrom googleAuthR gar_api_generator
#' @family Channel functions
#' @export
directory.users.aliases.watch <- function(Channel, userKey, event = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/aliases/watch",
userKey)
# directory.users.aliases.watch
pars = list(event = event)
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)
}
#' Adds a photo for the user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param UserPhoto The \link{UserPhoto} object to pass to this method
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family UserPhoto functions
#' @export
directory.users.photos.update <- function(UserPhoto, userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/photos/thumbnail",
userKey)
# directory.users.photos.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(UserPhoto, "gar_UserPhoto"))
f(the_body = UserPhoto)
}
#' Removes the user's photo.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.users.photos.delete <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/photos/thumbnail",
userKey)
# directory.users.photos.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Retrieves the user's photo.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.user.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.users.photos.get <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/photos/thumbnail",
userKey)
# directory.users.photos.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Adds a photo for the user. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param UserPhoto The \link{UserPhoto} object to pass to this method
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family UserPhoto functions
#' @export
directory.users.photos.patch <- function(UserPhoto, userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/photos/thumbnail",
userKey)
# directory.users.photos.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(UserPhoto, "gar_UserPhoto"))
f(the_body = UserPhoto)
}
#' Retrieves a role.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement, https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param roleId Immutable ID of the role
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.roles.get <- function(customer, roleId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roles/%s",
customer, roleId)
# directory.roles.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Creates a role.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Role The \link{Role} object to pass to this method
#' @param customer Immutable ID of the G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @family Role functions
#' @export
directory.roles.insert <- function(Role, customer) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roles",
customer)
# directory.roles.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(Role, "gar_Role"))
f(the_body = Role)
}
#' Patch role via Apiary Patch Orchestration
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Role The \link{Role} object to pass to this method
#' @param customer Immutable ID of the G Suite account
#' @param roleId Immutable ID of the role
#' @importFrom googleAuthR gar_api_generator
#' @family Role functions
#' @export
directory.roles.patch <- function(Role, customer, roleId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roles/%s",
customer, roleId)
# directory.roles.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(Role, "gar_Role"))
f(the_body = Role)
}
#' Retrieves a paginated list of all the roles in a domain.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement, https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param maxResults Maximum number of results to return
#' @param pageToken Token to specify the next page in the list
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.roles.list <- function(customer, maxResults = NULL, pageToken = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roles",
customer)
# directory.roles.list
pars = list(maxResults = maxResults, pageToken = pageToken)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Updates a role.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Role The \link{Role} object to pass to this method
#' @param customer Immutable ID of the G Suite account
#' @param roleId Immutable ID of the role
#' @importFrom googleAuthR gar_api_generator
#' @family Role functions
#' @export
directory.roles.update <- function(Role, customer, roleId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roles/%s",
customer, roleId)
# directory.roles.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(Role, "gar_Role"))
f(the_body = Role)
}
#' Deletes a role.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param roleId Immutable ID of the role
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.roles.delete <- function(customer, roleId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roles/%s",
customer, roleId)
# directory.roles.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Deletes a domain Alias of the customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.domain
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.domain)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param domainAliasName Name of domain alias to be retrieved
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.domainAliases.delete <- function(customer, domainAliasName) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/domainaliases/%s",
customer, domainAliasName)
# directory.domainAliases.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Inserts a domain alias of the customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.domain
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.domain)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param DomainAlias The \link{DomainAlias} object to pass to this method
#' @param customer Immutable ID of the G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @family DomainAlias functions
#' @export
directory.domainAliases.insert <- function(DomainAlias, customer) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/domainaliases",
customer)
# directory.domainAliases.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(DomainAlias, "gar_DomainAlias"))
f(the_body = DomainAlias)
}
#' Lists the domain aliases of the customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.domain
#' \item https://www.googleapis.com/auth/admin.directory.domain.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.domain, https://www.googleapis.com/auth/admin.directory.domain.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param parentDomainName Name of the parent domain for which domain aliases are to be fetched
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.domainAliases.list <- function(customer, parentDomainName = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/domainaliases",
customer)
# directory.domainAliases.list
pars = list(parentDomainName = parentDomainName)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Retrieves a domain alias of the customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.domain
#' \item https://www.googleapis.com/auth/admin.directory.domain.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.domain, https://www.googleapis.com/auth/admin.directory.domain.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param domainAliasName Name of domain alias to be retrieved
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.domainAliases.get <- function(customer, domainAliasName) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/domainaliases/%s",
customer, domainAliasName)
# directory.domainAliases.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Delete all access tokens issued by a user for an application.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @param clientId The Client ID of the application the token is issued to
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.tokens.delete <- function(userKey, clientId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/tokens/%s",
userKey, clientId)
# directory.tokens.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Returns the set of tokens specified user has issued to 3rd party applications.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.tokens.list <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/tokens",
userKey)
# directory.tokens.list
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Get information about an access token issued by a user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @param clientId The Client ID of the application the token is issued to
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.tokens.get <- function(userKey, clientId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/tokens/%s",
userKey, clientId)
# directory.tokens.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' List the ASPs issued by a user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.asps.list <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/asps",
userKey)
# directory.asps.list
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Get information about an ASP issued by a user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @param codeId The unique ID of the ASP
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.asps.get <- function(userKey, codeId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/asps/%s",
userKey, codeId)
# directory.asps.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Delete an ASP issued by a user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @param codeId The unique ID of the ASP to be deleted
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.asps.delete <- function(userKey, codeId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/asps/%s",
userKey, codeId)
# directory.asps.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.chromeos
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.chromeos)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param ChromeOsDevice The \link{ChromeOsDevice} object to pass to this method
#' @param customerId The unique ID for the customer's G Suite account
#' @param deviceId The unique ID of the device
#' @param projection Restrict information returned to a set of selected fields
#' @importFrom googleAuthR gar_api_generator
#' @family ChromeOsDevice functions
#' @export
directory.chromeosdevices.update <- function(ChromeOsDevice, customerId, deviceId,
projection = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/chromeos/%s",
customerId, deviceId)
# directory.chromeosdevices.update
pars = list(projection = projection)
f <- googleAuthR::gar_api_generator(url, "PUT", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
stopifnot(inherits(ChromeOsDevice, "gar_ChromeOsDevice"))
f(the_body = ChromeOsDevice)
}
#' Move or insert multiple Chrome OS devices to an organizational unit. You can move up to 50 devices at once.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.chromeos
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.chromeos)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param ChromeOsMoveDevicesToOu The \link{ChromeOsMoveDevicesToOu} object to pass to this method
#' @param customerId Immutable ID of the G Suite account
#' @param orgUnitPath Full path of the target organizational unit or its ID
#' @importFrom googleAuthR gar_api_generator
#' @family ChromeOsMoveDevicesToOu functions
#' @export
directory.chromeosdevices.moveDevicesToOu <- function(ChromeOsMoveDevicesToOu, customerId,
orgUnitPath) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/chromeos/moveDevicesToOu",
customerId)
# directory.chromeosdevices.moveDevicesToOu
pars = list(orgUnitPath = orgUnitPath)
f <- googleAuthR::gar_api_generator(url, "POST", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
stopifnot(inherits(ChromeOsMoveDevicesToOu, "gar_ChromeOsMoveDevicesToOu"))
f(the_body = ChromeOsMoveDevicesToOu)
}
#' Retrieves a Chrome OS device's properties.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.chromeos
#' \item https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.chromeos, https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId The unique ID for the customer's G Suite account
#' @param deviceId The unique ID of the device
#' @param projection Determines whether the response contains the full list of properties or only a subset
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.chromeosdevices.get <- function(customerId, deviceId, projection = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/chromeos/%s",
customerId, deviceId)
# directory.chromeosdevices.get
pars = list(projection = projection)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Takes an action that affects a Chrome OS Device. This includes deprovisioning, disabling, and re-enabling devices. *Warning:* * Deprovisioning a device will stop device policy syncing and remove device-level printers. After a device is deprovisioned, it must be wiped before it can be re-enrolled. * Lost or stolen devices should use the disable action. * Re-enabling a disabled device will consume a device license. If you do not have sufficient licenses available when completing the re-enable action, you will receive an error. For more information about deprovisioning and disabling devices, visit the [help center](https://support.google.com/chrome/a/answer/3523633).
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.chromeos
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.chromeos)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param ChromeOsDeviceAction The \link{ChromeOsDeviceAction} object to pass to this method
#' @param customerId The unique ID for the customer's G Suite account
#' @param resourceId The unique ID of the device
#' @importFrom googleAuthR gar_api_generator
#' @family ChromeOsDeviceAction functions
#' @export
directory.chromeosdevices.action <- function(ChromeOsDeviceAction, customerId, resourceId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/chromeos/%s/action",
customerId, resourceId)
# directory.chromeosdevices.action
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(ChromeOsDeviceAction, "gar_ChromeOsDeviceAction"))
f(the_body = ChromeOsDeviceAction)
}
#' Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.chromeos
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.chromeos)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param ChromeOsDevice The \link{ChromeOsDevice} object to pass to this method
#' @param customerId The unique ID for the customer's G Suite account
#' @param deviceId The unique ID of the device
#' @param projection Restrict information returned to a set of selected fields
#' @importFrom googleAuthR gar_api_generator
#' @family ChromeOsDevice functions
#' @export
directory.chromeosdevices.patch <- function(ChromeOsDevice, customerId, deviceId,
projection = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/chromeos/%s",
customerId, deviceId)
# directory.chromeosdevices.patch
pars = list(projection = projection)
f <- googleAuthR::gar_api_generator(url, "PATCH", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
stopifnot(inherits(ChromeOsDevice, "gar_ChromeOsDevice"))
f(the_body = ChromeOsDevice)
}
#' Retrieves a paginated list of Chrome OS devices within an account.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.chromeos
#' \item https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.chromeos, https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId The unique ID for the customer's G Suite account
#' @param orderBy Device property to use for sorting results
#' @param orgUnitPath The full path of the organizational unit or its unique ID
#' @param sortOrder Whether to return results in ascending or descending order
#' @param maxResults Maximum number of results to return
#' @param query Search string in the format given at http://support
#' @param projection Restrict information returned to a set of selected fields
#' @param pageToken The `pageToken` query parameter is used to request the next page of query results
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.chromeosdevices.list <- function(customerId, orderBy = NULL, orgUnitPath = NULL,
sortOrder = NULL, maxResults = NULL, query = NULL, projection = NULL, pageToken = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/chromeos",
customerId)
# directory.chromeosdevices.list
pars = list(orderBy = orderBy, orgUnitPath = orgUnitPath, sortOrder = sortOrder,
maxResults = maxResults, query = query, projection = projection, pageToken = pageToken)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Generate new backup verification codes for the user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Email or immutable ID of the user
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.verificationCodes.generate <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/verificationCodes/generate",
userKey)
# directory.verificationCodes.generate
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
f()
}
#' Returns the current set of valid backup verification codes for the specified user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.verificationCodes.list <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/verificationCodes",
userKey)
# directory.verificationCodes.list
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Invalidate the current backup verification codes for the user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Email or immutable ID of the user
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.verificationCodes.invalidate <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/verificationCodes/invalidate",
userKey)
# directory.verificationCodes.invalidate
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
f()
}
#' Deletes a role assignment.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param roleAssignmentId Immutable ID of the role assignment
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.roleAssignments.delete <- function(customer, roleAssignmentId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roleassignments/%s",
customer, roleAssignmentId)
# directory.roleAssignments.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Creates a role assignment.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param RoleAssignment The \link{RoleAssignment} object to pass to this method
#' @param customer Immutable ID of the G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @family RoleAssignment functions
#' @export
directory.roleAssignments.insert <- function(RoleAssignment, customer) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roleassignments",
customer)
# directory.roleAssignments.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(RoleAssignment, "gar_RoleAssignment"))
f(the_body = RoleAssignment)
}
#' Retrieves a paginated list of all roleAssignments.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement, https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param pageToken Token to specify the next page in the list
#' @param roleId Immutable ID of a role
#' @param maxResults Maximum number of results to return
#' @param userKey The user's primary email address, alias email address, or unique user ID
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.roleAssignments.list <- function(customer, pageToken = NULL, roleId = NULL,
maxResults = NULL, userKey = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roleassignments",
customer)
# directory.roleAssignments.list
pars = list(pageToken = pageToken, roleId = roleId, maxResults = maxResults,
userKey = userKey)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Retrieve a role assignment.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement, https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param roleAssignmentId Immutable ID of the role assignment
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.roleAssignments.get <- function(customer, roleAssignmentId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roleassignments/%s",
customer, roleAssignmentId)
# directory.roleAssignments.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Patch Schema via Apiary Patch Orchestration
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.userschema
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.userschema)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Schema The \link{Schema} object to pass to this method
#' @param customerId Immutable ID of the G Suite account
#' @param schemaKey Name or immutable ID of the schema
#' @importFrom googleAuthR gar_api_generator
#' @family Schema functions
#' @export
directory.schemas.patch <- function(Schema, customerId, schemaKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/schemas/%s",
customerId, schemaKey)
# directory.schemas.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(Schema, "gar_Schema"))
f(the_body = Schema)
}
#' Create schema.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.userschema
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.userschema)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Schema The \link{Schema} object to pass to this method
#' @param customerId Immutable ID of the G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @family Schema functions
#' @export
directory.schemas.insert <- function(Schema, customerId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/schemas",
customerId)
# directory.schemas.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(Schema, "gar_Schema"))
f(the_body = Schema)
}
#' Delete schema
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.userschema
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.userschema)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId Immutable ID of the G Suite account
#' @param schemaKey Name or immutable ID of the schema
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.schemas.delete <- function(customerId, schemaKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/schemas/%s",
customerId, schemaKey)
# directory.schemas.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Retrieve all schemas for a customer
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.userschema
#' \item https://www.googleapis.com/auth/admin.directory.userschema.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.userschema, https://www.googleapis.com/auth/admin.directory.userschema.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId Immutable ID of the G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.schemas.list <- function(customerId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/schemas",
customerId)
# directory.schemas.list
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Retrieve schema
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.userschema
#' \item https://www.googleapis.com/auth/admin.directory.userschema.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.userschema, https://www.googleapis.com/auth/admin.directory.userschema.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId Immutable ID of the G Suite account
#' @param schemaKey Name or immutable ID of the schema
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.schemas.get <- function(customerId, schemaKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/schemas/%s",
customerId, schemaKey)
# directory.schemas.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Update schema
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.userschema
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.userschema)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Schema The \link{Schema} object to pass to this method
#' @param customerId Immutable ID of the G Suite account
#' @param schemaKey Name or immutable ID of the schema
#' @importFrom googleAuthR gar_api_generator
#' @family Schema functions
#' @export
directory.schemas.update <- function(Schema, customerId, schemaKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/schemas/%s",
customerId, schemaKey)
# directory.schemas.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(Schema, "gar_Schema"))
f(the_body = Schema)
}
#' Retrieves a list of all organizational units for an account.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.orgunit
#' \item https://www.googleapis.com/auth/admin.directory.orgunit.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.orgunit, https://www.googleapis.com/auth/admin.directory.orgunit.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId The unique ID for the customer's G Suite account
#' @param type Whether to return all sub-organizations or just immediate children
#' @param orgUnitPath The full path to the organizational unit or its unique ID
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.orgunits.list <- function(customerId, type = NULL, orgUnitPath = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/orgunits",
customerId)
# directory.orgunits.list
pars = list(type = type, orgUnitPath = orgUnitPath)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Updates an organizational unit.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.orgunit
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.orgunit)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param OrgUnit The \link{OrgUnit} object to pass to this method
#' @param customerId The unique ID for the customer's G Suite account
#' @param orgUnitPath The full path of the organizational unit or its unique ID
#' @importFrom googleAuthR gar_api_generator
#' @family OrgUnit functions
#' @export
directory.orgunits.update <- function(OrgUnit, customerId, orgUnitPath) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/orgunits/{+orgUnitPath}",
customerId, orgUnitPath)
# directory.orgunits.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(OrgUnit, "gar_OrgUnit"))
f(the_body = OrgUnit)
}
#' Removes an organizational unit.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.orgunit
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.orgunit)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId The unique ID for the customer's G Suite account
#' @param orgUnitPath The full path of the organizational unit or its unique ID
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.orgunits.delete <- function(customerId, orgUnitPath) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/orgunits/{+orgUnitPath}",
customerId, orgUnitPath)
# directory.orgunits.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Adds an organizational unit.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.orgunit
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.orgunit)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param OrgUnit The \link{OrgUnit} object to pass to this method
#' @param customerId The unique ID for the customer's G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @family OrgUnit functions
#' @export
directory.orgunits.insert <- function(OrgUnit, customerId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/orgunits",
customerId)
# directory.orgunits.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(OrgUnit, "gar_OrgUnit"))
f(the_body = OrgUnit)
}
#' Updates an organizational unit. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch)
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.orgunit
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.orgunit)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param OrgUnit The \link{OrgUnit} object to pass to this method
#' @param customerId The unique ID for the customer's G Suite account
#' @param orgUnitPath The full path of the organizational unit or its unique ID
#' @importFrom googleAuthR gar_api_generator
#' @family OrgUnit functions
#' @export
directory.orgunits.patch <- function(OrgUnit, customerId, orgUnitPath) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/orgunits/{+orgUnitPath}",
customerId, orgUnitPath)
# directory.orgunits.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(OrgUnit, "gar_OrgUnit"))
f(the_body = OrgUnit)
}
#' Retrieves an organizational unit.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.orgunit
#' \item https://www.googleapis.com/auth/admin.directory.orgunit.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.orgunit, https://www.googleapis.com/auth/admin.directory.orgunit.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId The unique ID for the customer's G Suite account
#' @param orgUnitPath The full path of the organizational unit or its unique ID
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.orgunits.get <- function(customerId, orgUnitPath) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/orgunits/{+orgUnitPath}",
customerId, orgUnitPath)
# directory.orgunits.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Inserts a feature.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Feature The \link{Feature} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @family Feature functions
#' @export
directory.resources.features.insert <- function(Feature, customer) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/features",
customer)
# directory.resources.features.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(Feature, "gar_Feature"))
f(the_body = Feature)
}
#' Deletes a feature.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer The unique ID for the customer's G Suite account
#' @param featureKey The unique ID of the feature to delete
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.resources.features.delete <- function(customer, featureKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/features/%s",
customer, featureKey)
# directory.resources.features.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Renames a feature.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param FeatureRename The \link{FeatureRename} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @param oldName The unique ID of the feature to rename
#' @importFrom googleAuthR gar_api_generator
#' @family FeatureRename functions
#' @export
directory.resources.features.rename <- function(FeatureRename, customer, oldName) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/features/%s/rename",
customer, oldName)
# directory.resources.features.rename
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(FeatureRename, "gar_FeatureRename"))
f(the_body = FeatureRename)
}
#' Retrieves a feature.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' \item https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar, https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer The unique ID for the customer's G Suite account
#' @param featureKey The unique ID of the feature to retrieve
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.resources.features.get <- function(customer, featureKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/features/%s",
customer, featureKey)
# directory.resources.features.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Updates a feature.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Feature The \link{Feature} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @param featureKey The unique ID of the feature to update
#' @importFrom googleAuthR gar_api_generator
#' @family Feature functions
#' @export
directory.resources.features.update <- function(Feature, customer, featureKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/features/%s",
customer, featureKey)
# directory.resources.features.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(Feature, "gar_Feature"))
f(the_body = Feature)
}
#' Patches a feature via Apiary Patch Orchestration.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Feature The \link{Feature} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @param featureKey The unique ID of the feature to update
#' @importFrom googleAuthR gar_api_generator
#' @family Feature functions
#' @export
directory.resources.features.patch <- function(Feature, customer, featureKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/features/%s",
customer, featureKey)
# directory.resources.features.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(Feature, "gar_Feature"))
f(the_body = Feature)
}
#' Retrieves a list of features for an account.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' \item https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar, https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer The unique ID for the customer's G Suite account
#' @param pageToken Token to specify the next page in the list
#' @param maxResults Maximum number of results to return
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.resources.features.list <- function(customer, pageToken = NULL, maxResults = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/features",
customer)
# directory.resources.features.list
pars = list(pageToken = pageToken, maxResults = maxResults)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Deletes a calendar resource.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer The unique ID for the customer's G Suite account
#' @param calendarResourceId The unique ID of the calendar resource to delete
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.resources.calendars.delete <- function(customer, calendarResourceId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/calendars/%s",
customer, calendarResourceId)
# directory.resources.calendars.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Patches a calendar resource via Apiary Patch Orchestration.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param CalendarResource The \link{CalendarResource} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @param calendarResourceId The unique ID of the calendar resource to update
#' @importFrom googleAuthR gar_api_generator
#' @family CalendarResource functions
#' @export
directory.resources.calendars.patch <- function(CalendarResource, customer, calendarResourceId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/calendars/%s",
customer, calendarResourceId)
# directory.resources.calendars.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(CalendarResource, "gar_CalendarResource"))
f(the_body = CalendarResource)
}
#' Inserts a calendar resource.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param CalendarResource The \link{CalendarResource} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @family CalendarResource functions
#' @export
directory.resources.calendars.insert <- function(CalendarResource, customer) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/calendars",
customer)
# directory.resources.calendars.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(CalendarResource, "gar_CalendarResource"))
f(the_body = CalendarResource)
}
#' Retrieves a calendar resource.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' \item https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar, https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer The unique ID for the customer's G Suite account
#' @param calendarResourceId The unique ID of the calendar resource to retrieve
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.resources.calendars.get <- function(customer, calendarResourceId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/calendars/%s",
customer, calendarResourceId)
# directory.resources.calendars.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Retrieves a list of calendar resources for an account.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' \item https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar, https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer The unique ID for the customer's G Suite account
#' @param pageToken Token to specify the next page in the list
#' @param maxResults Maximum number of results to return
#' @param orderBy Field(s) to sort results by in either ascending or descending order
#' @param query String query used to filter results
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.resources.calendars.list <- function(customer, pageToken = NULL, maxResults = NULL,
orderBy = NULL, query = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/calendars",
customer)
# directory.resources.calendars.list
pars = list(pageToken = pageToken, maxResults = maxResults, orderBy = orderBy,
query = query)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Updates a calendar resource. This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param CalendarResource The \link{CalendarResource} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @param calendarResourceId The unique ID of the calendar resource to update
#' @importFrom googleAuthR gar_api_generator
#' @family CalendarResource functions
#' @export
directory.resources.calendars.update <- function(CalendarResource, customer, calendarResourceId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/calendars/%s",
customer, calendarResourceId)
# directory.resources.calendars.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(CalendarResource, "gar_CalendarResource"))
f(the_body = CalendarResource)
}
#' Retrieves a building.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' \item https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar, https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer The unique ID for the customer's G Suite account
#' @param buildingId The unique ID of the building to retrieve
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.resources.buildings.get <- function(customer, buildingId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/buildings/%s",
customer, buildingId)
# directory.resources.buildings.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Deletes a building.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer The unique ID for the customer's G Suite account
#' @param buildingId The id of the building to delete
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.resources.buildings.delete <- function(customer, buildingId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/buildings/%s",
customer, buildingId)
# directory.resources.buildings.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Patches a building via Apiary Patch Orchestration.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Building The \link{Building} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @param buildingId The id of the building to update
#' @param coordinatesSource Source from which Building
#' @importFrom googleAuthR gar_api_generator
#' @family Building functions
#' @export
directory.resources.buildings.patch <- function(Building, customer, buildingId, coordinatesSource = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/buildings/%s",
customer, buildingId)
# directory.resources.buildings.patch
pars = list(coordinatesSource = coordinatesSource)
f <- googleAuthR::gar_api_generator(url, "PATCH", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
stopifnot(inherits(Building, "gar_Building"))
f(the_body = Building)
}
#' Updates a building.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Building The \link{Building} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @param buildingId The id of the building to update
#' @param coordinatesSource Source from which Building
#' @importFrom googleAuthR gar_api_generator
#' @family Building functions
#' @export
directory.resources.buildings.update <- function(Building, customer, buildingId,
coordinatesSource = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/buildings/%s",
customer, buildingId)
# directory.resources.buildings.update
pars = list(coordinatesSource = coordinatesSource)
f <- googleAuthR::gar_api_generator(url, "PUT", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
stopifnot(inherits(Building, "gar_Building"))
f(the_body = Building)
}
#' Retrieves a list of buildings for an account.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' \item https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar, https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer The unique ID for the customer's G Suite account
#' @param maxResults Maximum number of results to return
#' @param pageToken Token to specify the next page in the list
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.resources.buildings.list <- function(customer, maxResults = NULL, pageToken = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/buildings",
customer)
# directory.resources.buildings.list
pars = list(maxResults = maxResults, pageToken = pageToken)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Inserts a building.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.resource.calendar
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.resource.calendar)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Building The \link{Building} object to pass to this method
#' @param customer The unique ID for the customer's G Suite account
#' @param coordinatesSource Source from which Building
#' @importFrom googleAuthR gar_api_generator
#' @family Building functions
#' @export
directory.resources.buildings.insert <- function(Building, customer, coordinatesSource = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/resources/buildings",
customer)
# directory.resources.buildings.insert
pars = list(coordinatesSource = coordinatesSource)
f <- googleAuthR::gar_api_generator(url, "POST", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
stopifnot(inherits(Building, "gar_Building"))
f(the_body = Building)
}
#' Turn off 2-Step Verification for user.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.user.security
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.user.security)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param userKey Identifies the user in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.twoStepVerification.turnOff <- function(userKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/users/%s/twoStepVerification/turnOff",
userKey)
# directory.twoStepVerification.turnOff
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
f()
}
#' Issues a command for the device to execute.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.chromeos
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.chromeos)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param DirectoryChromeosdevicesIssueCommandRequest The \link{DirectoryChromeosdevicesIssueCommandRequest} object to pass to this method
#' @param customerId Immutable
#' @param deviceId Immutable
#' @importFrom googleAuthR gar_api_generator
#' @family DirectoryChromeosdevicesIssueCommandRequest functions
#' @export
customer.devices.chromeos.issueCommand <- function(DirectoryChromeosdevicesIssueCommandRequest,
customerId, deviceId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/chromeos/%s:issueCommand",
customerId, deviceId)
# admin.customer.devices.chromeos.issueCommand
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(DirectoryChromeosdevicesIssueCommandRequest, "gar_DirectoryChromeosdevicesIssueCommandRequest"))
f(the_body = DirectoryChromeosdevicesIssueCommandRequest)
}
#' Gets command data a specific command issued to the device.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.device.chromeos
#' \item https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.device.chromeos, https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customerId Immutable
#' @param deviceId Immutable
#' @param commandId Immutable
#' @importFrom googleAuthR gar_api_generator
#' @export
customer.devices.chromeos.commands.get <- function(customerId, deviceId, commandId) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/devices/chromeos/%s/commands/%s",
customerId, deviceId, commandId)
# admin.customer.devices.chromeos.commands.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Updates the membership properties of a user in the specified group. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.member
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.member)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Member The \link{Member} object to pass to this method
#' @param groupKey Identifies the group in the API request
#' @param memberKey Identifies the group member in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family Member functions
#' @export
directory.members.patch <- function(Member, groupKey, memberKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/members/%s",
groupKey, memberKey)
# directory.members.patch
f <- googleAuthR::gar_api_generator(url, "PATCH", data_parse_function = function(x) x)
stopifnot(inherits(Member, "gar_Member"))
f(the_body = Member)
}
#' Checks whether the given user is a member of the group. Membership can be direct or nested.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.member
#' \item https://www.googleapis.com/auth/admin.directory.group.member.readonly
#' \item https://www.googleapis.com/auth/admin.directory.group.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.member, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param groupKey Identifies the group in the API request
#' @param memberKey Identifies the user member in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.members.hasMember <- function(groupKey, memberKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/hasMember/%s",
groupKey, memberKey)
# directory.members.hasMember
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Adds a user to the specified group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.member
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.member)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Member The \link{Member} object to pass to this method
#' @param groupKey Identifies the group in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family Member functions
#' @export
directory.members.insert <- function(Member, groupKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/members",
groupKey)
# directory.members.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(Member, "gar_Member"))
f(the_body = Member)
}
#' Retrieves a paginated list of all members in a group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.member
#' \item https://www.googleapis.com/auth/admin.directory.group.member.readonly
#' \item https://www.googleapis.com/auth/admin.directory.group.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.member, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param groupKey Identifies the group in the API request
#' @param pageToken Token to specify next page in the list
#' @param roles The `roles` query parameter allows you to retrieve group members by role
#' @param maxResults Maximum number of results to return
#' @param includeDerivedMembership Whether to list indirect memberships
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.members.list <- function(groupKey, pageToken = NULL, roles = NULL, maxResults = NULL,
includeDerivedMembership = NULL) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/members",
groupKey)
# directory.members.list
pars = list(pageToken = pageToken, roles = roles, maxResults = maxResults, includeDerivedMembership = includeDerivedMembership)
f <- googleAuthR::gar_api_generator(url, "GET", pars_args = rmNullObs(pars),
data_parse_function = function(x) x)
f()
}
#' Removes a member from a group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.member
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.member)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param groupKey Identifies the group in the API request
#' @param memberKey Identifies the group member in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.members.delete <- function(groupKey, memberKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/members/%s",
groupKey, memberKey)
# directory.members.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Updates the membership of a user in the specified group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.member
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.member)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Member The \link{Member} object to pass to this method
#' @param groupKey Identifies the group in the API request
#' @param memberKey Identifies the group member in the API request
#' @importFrom googleAuthR gar_api_generator
#' @family Member functions
#' @export
directory.members.update <- function(Member, groupKey, memberKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/members/%s",
groupKey, memberKey)
# directory.members.update
f <- googleAuthR::gar_api_generator(url, "PUT", data_parse_function = function(x) x)
stopifnot(inherits(Member, "gar_Member"))
f(the_body = Member)
}
#' Retrieves a group member's properties.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.group
#' \item https://www.googleapis.com/auth/admin.directory.group.member
#' \item https://www.googleapis.com/auth/admin.directory.group.member.readonly
#' \item https://www.googleapis.com/auth/admin.directory.group.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.group.member, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param groupKey Identifies the group in the API request
#' @param memberKey Identifies the group member in the API request
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.members.get <- function(groupKey, memberKey) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/groups/%s/members/%s",
groupKey, memberKey)
# directory.members.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Lists the domains of the customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.domain
#' \item https://www.googleapis.com/auth/admin.directory.domain.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.domain, https://www.googleapis.com/auth/admin.directory.domain.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.domains.list <- function(customer) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/domains",
customer)
# directory.domains.list
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Deletes a domain of the customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.domain
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.domain)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param domainName Name of domain to be deleted
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.domains.delete <- function(customer, domainName) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/domains/%s",
customer, domainName)
# directory.domains.delete
f <- googleAuthR::gar_api_generator(url, "DELETE", data_parse_function = function(x) x)
f()
}
#' Retrieves a domain of the customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.domain
#' \item https://www.googleapis.com/auth/admin.directory.domain.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.domain, https://www.googleapis.com/auth/admin.directory.domain.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @param domainName Name of domain to be retrieved
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.domains.get <- function(customer, domainName) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/domains/%s",
customer, domainName)
# directory.domains.get
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
#' Inserts a domain of the customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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.domain
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.domain)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Domains The \link{Domains} object to pass to this method
#' @param customer Immutable ID of the G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @family Domains functions
#' @export
directory.domains.insert <- function(Domains, customer) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/domains",
customer)
# directory.domains.insert
f <- googleAuthR::gar_api_generator(url, "POST", data_parse_function = function(x) x)
stopifnot(inherits(Domains, "gar_Domains"))
f(the_body = Domains)
}
#' Retrieves a paginated list of all privileges for a customer.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @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
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/admin.directory.rolemanagement, https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param customer Immutable ID of the G Suite account
#' @importFrom googleAuthR gar_api_generator
#' @export
directory.privileges.list <- function(customer) {
url <- sprintf("https://admin.googleapis.com/admin/directory/v1/customer/%s/roles/ALL/privileges",
customer)
# directory.privileges.list
f <- googleAuthR::gar_api_generator(url, "GET", data_parse_function = function(x) x)
f()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.