#' Removes an organizational unit.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @seealso \href{https://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
#' }
#' @param orgUnitPath The full path of the organizational unit or its unique ID.
#' @param customerId The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).
#' @param callback JSONP
#' @param fields Selector specifying which fields to include in a partial response.
#' @param uploadType Legacy upload protocol for media (e.g. "media", "multipart").
#' @param upload_protocol Upload protocol for media (e.g. "raw", "multipart").
#' @param prettyPrint Returns response with indentations and line breaks.
#' @param quotaUser Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
#' @param alt Data format for response.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_request Whether to return the request without making it. Defaults to FALSE. See \code{\link[gargle]{request_build}} for more info on the returned request object.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
orgunits.delete <- function(orgUnitPath, customerId, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.delete']]$scopes[[1]]), return_request = F, return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_request', 'return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['directory.orgunits.delete']], params = params, base_url = 'https://admin.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
if(return_request) return(req)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
#' Retrieves an organizational unit.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @seealso \href{https://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
#' }
#' @param orgUnitPath The full path of the organizational unit or its unique ID.
#' @param customerId The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).
#' @param callback JSONP
#' @param fields Selector specifying which fields to include in a partial response.
#' @param uploadType Legacy upload protocol for media (e.g. "media", "multipart").
#' @param upload_protocol Upload protocol for media (e.g. "raw", "multipart").
#' @param prettyPrint Returns response with indentations and line breaks.
#' @param quotaUser Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
#' @param alt Data format for response.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_request Whether to return the request without making it. Defaults to FALSE. See \code{\link[gargle]{request_build}} for more info on the returned request object.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
orgunits.get <- function(orgUnitPath, customerId, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.get']]$scopes[[1]]), return_request = F, return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_request', 'return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['directory.orgunits.get']], params = params, base_url = 'https://admin.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
if(return_request) return(req)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
#' Adds an organizational unit.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @seealso \href{https://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
#' }
#' @param customerId The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).
#' @param name The organizational unit's path name. For example, an organizational unit's name within the /corp/support/sales_support parent path is sales_support. Required.
#' @param description Description of the organizational unit.
#' @param blockInheritance Determines if a sub-organizational unit can inherit the settings of the parent organization. The default value is `false`, meaning a sub-organizational unit inherits the settings of the nearest parent organizational unit. For more information on inheritance and users in an organization structure, see the [administration help center](https://support.google.com/a/answer/4352075).
#' @param parentOrgUnitId The unique ID of the parent organizational unit. Required, unless `parentOrgUnitPath` is set.
#' @param kind The type of the API resource. For Orgunits resources, the value is `admin#directory#orgUnit`.
#' @param orgUnitId The unique ID of the organizational unit.
#' @param parentOrgUnitPath The organizational unit's parent path. For example, /corp/sales is the parent path for /corp/sales/sales_support organizational unit. Required, unless `parentOrgUnitId` is set.
#' @param etag ETag of the resource.
#' @param orgUnitPath The full path to the organizational unit. The `orgUnitPath` is a derived property. When listed, it is derived from `parentOrgunitPath` and organizational unit's `name`. For example, for an organizational unit named 'apps' under parent organization '/engineering', the orgUnitPath is '/engineering/apps'. In order to edit an `orgUnitPath`, either update the name of the organization or the `parentOrgunitPath`. A user's organizational unit determines which Google Workspace services the user has access to. If the user is moved to a new organization, the user's access changes. For more information about organization structures, see the [administration help center](https://support.google.com/a/answer/4352075). For more information about moving a user to a different organization, see [Update a user](/admin-sdk/directory/v1/guides/manage-users.html#update_user).
#' @param callback JSONP
#' @param fields Selector specifying which fields to include in a partial response.
#' @param uploadType Legacy upload protocol for media (e.g. "media", "multipart").
#' @param upload_protocol Upload protocol for media (e.g. "raw", "multipart").
#' @param prettyPrint Returns response with indentations and line breaks.
#' @param quotaUser Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
#' @param alt Data format for response.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_request Whether to return the request without making it. Defaults to FALSE. See \code{\link[gargle]{request_build}} for more info on the returned request object.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
orgunits.insert <- function(customerId, name = NULL, description = NULL, blockInheritance = NULL, parentOrgUnitId = NULL, kind = NULL, orgUnitId = NULL, parentOrgUnitPath = NULL, etag = NULL, orgUnitPath = NULL, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.insert']]$scopes[[1]]), return_request = F, return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_request', 'return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['directory.orgunits.insert']], params = params, base_url = 'https://admin.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
if(return_request) return(req)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
#' Retrieves a list of all organizational units for an account.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @seealso \href{https://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
#' }
#' @param customerId The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).
#' @param orgUnitPath The full path to the organizational unit or its unique ID. Returns the children of the specified organizational unit.
#' @param type Whether to return all sub-organizations or just immediate children.
#' @param callback JSONP
#' @param fields Selector specifying which fields to include in a partial response.
#' @param uploadType Legacy upload protocol for media (e.g. "media", "multipart").
#' @param upload_protocol Upload protocol for media (e.g. "raw", "multipart").
#' @param prettyPrint Returns response with indentations and line breaks.
#' @param quotaUser Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
#' @param alt Data format for response.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_request Whether to return the request without making it. Defaults to FALSE. See \code{\link[gargle]{request_build}} for more info on the returned request object.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
orgunits.list <- function(customerId, orgUnitPath = NULL, type = NULL, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.list']]$scopes[[1]]), return_request = F, return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_request', 'return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['directory.orgunits.list']], params = params, base_url = 'https://admin.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
if(return_request) return(req)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
#' Updates an organizational unit.
#'
#' This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch) Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @seealso \href{https://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
#' }
#' @param orgUnitPath The full path of the organizational unit or its unique ID.
#' @param customerId The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).
#' @param name The organizational unit's path name. For example, an organizational unit's name within the /corp/support/sales_support parent path is sales_support. Required.
#' @param description Description of the organizational unit.
#' @param blockInheritance Determines if a sub-organizational unit can inherit the settings of the parent organization. The default value is `false`, meaning a sub-organizational unit inherits the settings of the nearest parent organizational unit. For more information on inheritance and users in an organization structure, see the [administration help center](https://support.google.com/a/answer/4352075).
#' @param parentOrgUnitId The unique ID of the parent organizational unit. Required, unless `parentOrgUnitPath` is set.
#' @param kind The type of the API resource. For Orgunits resources, the value is `admin#directory#orgUnit`.
#' @param orgUnitId The unique ID of the organizational unit.
#' @param parentOrgUnitPath The organizational unit's parent path. For example, /corp/sales is the parent path for /corp/sales/sales_support organizational unit. Required, unless `parentOrgUnitId` is set.
#' @param etag ETag of the resource.
#' @param callback JSONP
#' @param fields Selector specifying which fields to include in a partial response.
#' @param uploadType Legacy upload protocol for media (e.g. "media", "multipart").
#' @param upload_protocol Upload protocol for media (e.g. "raw", "multipart").
#' @param prettyPrint Returns response with indentations and line breaks.
#' @param quotaUser Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
#' @param alt Data format for response.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_request Whether to return the request without making it. Defaults to FALSE. See \code{\link[gargle]{request_build}} for more info on the returned request object.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
orgunits.patch <- function(orgUnitPath, customerId, name = NULL, description = NULL, blockInheritance = NULL, parentOrgUnitId = NULL, kind = NULL, orgUnitId = NULL, parentOrgUnitPath = NULL, etag = NULL, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.patch']]$scopes[[1]]), return_request = F, return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_request', 'return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['directory.orgunits.patch']], params = params, base_url = 'https://admin.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
if(return_request) return(req)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
#' Updates an organizational unit.
#'
#' Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
#'
#' @seealso \href{https://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
#' }
#' @param customerId The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).
#' @param orgUnitPath The full path of the organizational unit or its unique ID.
#' @param name The organizational unit's path name. For example, an organizational unit's name within the /corp/support/sales_support parent path is sales_support. Required.
#' @param description Description of the organizational unit.
#' @param blockInheritance Determines if a sub-organizational unit can inherit the settings of the parent organization. The default value is `false`, meaning a sub-organizational unit inherits the settings of the nearest parent organizational unit. For more information on inheritance and users in an organization structure, see the [administration help center](https://support.google.com/a/answer/4352075).
#' @param parentOrgUnitId The unique ID of the parent organizational unit. Required, unless `parentOrgUnitPath` is set.
#' @param kind The type of the API resource. For Orgunits resources, the value is `admin#directory#orgUnit`.
#' @param orgUnitId The unique ID of the organizational unit.
#' @param parentOrgUnitPath The organizational unit's parent path. For example, /corp/sales is the parent path for /corp/sales/sales_support organizational unit. Required, unless `parentOrgUnitId` is set.
#' @param etag ETag of the resource.
#' @param callback JSONP
#' @param fields Selector specifying which fields to include in a partial response.
#' @param uploadType Legacy upload protocol for media (e.g. "media", "multipart").
#' @param upload_protocol Upload protocol for media (e.g. "raw", "multipart").
#' @param prettyPrint Returns response with indentations and line breaks.
#' @param quotaUser Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
#' @param alt Data format for response.
#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
#' @param return_request Whether to return the request without making it. Defaults to FALSE. See \code{\link[gargle]{request_build}} for more info on the returned request object.
#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
#' @export
orgunits.update <- function(customerId, orgUnitPath, name = NULL, description = NULL, blockInheritance = NULL, parentOrgUnitId = NULL, kind = NULL, orgUnitId = NULL, parentOrgUnitPath = NULL, etag = NULL, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.update']]$scopes[[1]]), return_request = F, return_response = F){
params <- as.list(environment())[!names(as.list(environment())) %in% c('return_request', 'return_response', 'gargle_token')]
req <- gargle::request_develop(endpoint = .endpoints[['directory.orgunits.update']], params = params, base_url = 'https://admin.googleapis.com/')
req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
if(return_request) return(req)
res <- gargle::request_make(req, encode = 'json')
if(return_response) return(res)
httr::content(res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.