samples/AdminDirectoryV1/R/orgunits.R

	#' Removes an organizational unit.
	#'
	#'  Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
	#'
	#' @seealso \href{http://developers.google.com/admin-sdk/}{Google Documentation}
	#'
	#' @details
	#' Authentication scopes used by this function are:
	#' \itemize{
	#' \item https://www.googleapis.com/auth/admin.directory.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 gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
	#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
	#' @export
	orgunits.delete <- function(customerId, orgUnitPath, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.delete']]$scopes), return_response = F){
		params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
		req <- gargle::request_develop(endpoint = .endpoints[['directory.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)
		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{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
	#' }
	#' @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 gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
	#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
	#' @export
	orgunits.get <- function(orgUnitPath, customerId, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.get']]$scopes), return_response = F){
		params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
		req <- gargle::request_develop(endpoint = .endpoints[['directory.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)
		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{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
	#' }
	#' @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 orgUnitId The unique ID of the organizational unit.
	#' @param parentOrgUnitId The unique ID of the parent organizational unit. Required, unless `parentOrgUnitPath` is set.
	#' @param etag ETag of the resource.
	#' @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 kind The type of the API resource. For Orgunits resources, the value is `admin#directory#orgUnit`.
	#' @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](http://support.google.com/a/bin/answer.py?answer=182433&topic=1227584&ctx=topic). 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 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](http://support.google.com/a/bin/answer.py?answer=182442&topic=1227584&ctx=topic).
	#' @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 gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
	#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
	#' @export
	orgunits.insert <- function(customerId, orgUnitId = NULL, parentOrgUnitId = NULL, etag = NULL, name = NULL, kind = NULL, orgUnitPath = NULL, description = NULL, blockInheritance = NULL, parentOrgUnitPath = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.insert']]$scopes), return_response = F){
		params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
		req <- gargle::request_develop(endpoint = .endpoints[['directory.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)
		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{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
	#' }
	#' @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 type Whether to return all sub-organizations or just immediate children.
	#' @param orgUnitPath The full path to the organizational unit or its unique ID. Returns the children of the specified organizational unit.
	#' @param gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
	#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
	#' @export
	orgunits.list <- function(customerId, type = NULL, orgUnitPath = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.list']]$scopes), return_response = F){
		params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
		req <- gargle::request_develop(endpoint = .endpoints[['directory.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)
		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{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
	#' }
	#' @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 orgUnitId The unique ID of the organizational unit.
	#' @param parentOrgUnitId The unique ID of the parent organizational unit. Required, unless `parentOrgUnitPath` is set.
	#' @param etag ETag of the resource.
	#' @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 kind The type of the API resource. For Orgunits resources, the value is `admin#directory#orgUnit`.
	#' @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](http://support.google.com/a/bin/answer.py?answer=182442&topic=1227584&ctx=topic).
	#' @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 gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
	#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
	#' @export
	orgunits.patch <- function(orgUnitPath, customerId, orgUnitId = NULL, parentOrgUnitId = NULL, etag = NULL, name = NULL, kind = NULL, description = NULL, blockInheritance = NULL, parentOrgUnitPath = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.patch']]$scopes), return_response = F){
		params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
		req <- gargle::request_develop(endpoint = .endpoints[['directory.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)
		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{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
	#' }
	#' @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 orgUnitId The unique ID of the organizational unit.
	#' @param parentOrgUnitId The unique ID of the parent organizational unit. Required, unless `parentOrgUnitPath` is set.
	#' @param etag ETag of the resource.
	#' @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 kind The type of the API resource. For Orgunits resources, the value is `admin#directory#orgUnit`.
	#' @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](http://support.google.com/a/bin/answer.py?answer=182442&topic=1227584&ctx=topic).
	#' @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 gargle_token A token prepared by one of gargle's token generating functions. Defaults to gargle::token_fetch(...) with appropriate scopes. See \code{\link[gargle]{token_fetch}} for more info.
	#' @param return_response Whether to return the response or the response content. Defaults to FALSE (return response content).
	#' @export
	orgunits.update <- function(customerId, orgUnitPath, orgUnitId = NULL, parentOrgUnitId = NULL, etag = NULL, name = NULL, kind = NULL, description = NULL, blockInheritance = NULL, parentOrgUnitPath = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.orgunits.update']]$scopes), return_response = F){
		params <- as.list(environment())[!names(as.list(environment())) %in% c('return_response', 'gargle_token')]
		req <- gargle::request_develop(endpoint = .endpoints[['directory.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)
		res <- gargle::request_make(req, encode = 'json')
		if(return_response) return(res)
		httr::content(res)
	}
samterfa/googlePackageMaker documentation built on May 18, 2022, 10:58 a.m.