samples/AdminDirectoryV1/R/groups.R

	#' Deletes a group.
	#'
	#'  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.group
	#' }
	#' @param groupKey Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group 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
	groups.delete <- function(groupKey, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.groups.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.groups.delete']], params = params, base_url = 'https://admin.googleapis.com/')
		req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
		res <- gargle::request_make(req, encode = 'json')
		if(return_response) return(res)
		httr::content(res)
	}

	#' Retrieves a group's properties.
	#'
	#'  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.group
	#' \item https://www.googleapis.com/auth/admin.directory.group.readonly
	#' }
	#' @param groupKey Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group 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
	groups.get <- function(groupKey, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.groups.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.groups.get']], params = params, base_url = 'https://admin.googleapis.com/')
		req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
		res <- gargle::request_make(req, encode = 'json')
		if(return_response) return(res)
		httr::content(res)
	}

	#' Creates a group.
	#'
	#'  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.group
	#' }
	#' @param directMembersCount The number of users that are direct members of the group. If a group is a member (child) of this group (the parent), members of the child group are not counted in the `directMembersCount` property of the parent group.
	#' @param adminCreated Value is `true` if this group was created by an administrator rather than a user.
	#' @param nonEditableAliases List of the group's non-editable alias email addresses that are outside of the account's primary domain or subdomains. These are functioning email addresses used by the group. This is a read-only property returned in the API's response for a group. If edited in a group's POST or PUT request, the edit is ignored by the API service.
	#' @param etag ETag of the resource.
	#' @param id The unique ID of a group. A group `id` can be used as a group request URI's `groupKey`.
	#' @param email The group's email address. If your account has multiple domains, select the appropriate domain for the email address. The `email` must be unique. This property is required when creating a group. Group email addresses are subject to the same character usage rules as usernames, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=33386) for the details.
	#' @param aliases List of a group's alias email addresses.
	#' @param name The group's display name.
	#' @param kind The type of the API resource. For Groups resources, the value is `admin#directory#group`.
	#' @param description An extended description to help users determine the purpose of a group. For example, you can include information about who should join the group, the types of messages to send to the group, links to FAQs about the group, or related groups. Maximum length is `4,096` characters.
	#' @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
	groups.insert <- function(directMembersCount = NULL, adminCreated = NULL, nonEditableAliases = NULL, etag = NULL, id = NULL, email = NULL, aliases = NULL, name = NULL, kind = NULL, description = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.groups.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.groups.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)
	}

	#' NA
	#'
	#' NA Autogenerated via \code{\link[googlePackageMaker]{package_make}}.
	#'
	#' @seealso \href{http://developers.google.com/admin-sdk/}{Google Documentation}
	#'
	#' @details
	#' Authentication scopes used by this function are:
	#' \itemize{
	#' \item https://www.googleapis.com/auth/admin.directory.group
	#' \item https://www.googleapis.com/auth/admin.directory.group.readonly
	#' }
	#' @param userKey Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If it's an ID, it should match with the ID of the user object.
	#' @param orderBy Column to use for sorting results
	#' @param pageToken Token to specify next page in the list
	#' @param maxResults Maximum number of results to return. Max allowed value is 200.
	#' @param domain The domain name. Use this field to get fields from only one domain. To return all domains for a customer account, use the `customer` query parameter instead.
	#' @param customer The unique ID for the customer's Google Workspace account. In case of a multi-domain account, to fetch all groups for a customer, fill this field instead of domain. 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](/admin-sdk/directory/v1/reference/users)
	#' @param sortOrder Whether to return results in ascending or descending order. Only of use when orderBy is also used
	#' @param query Query string search. Should be of the form "". Complete documentation is at https: //developers.google.com/admin-sdk/directory/v1/guides/search-groups
	#' @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
	groups.list <- function(userKey = NULL, orderBy = NULL, pageToken = NULL, maxResults = NULL, domain = NULL, customer = NULL, sortOrder = NULL, query = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.groups.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.groups.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 a group's properties.
	#'
	#' 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.group
	#' }
	#' @param groupKey Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
	#' @param directMembersCount The number of users that are direct members of the group. If a group is a member (child) of this group (the parent), members of the child group are not counted in the `directMembersCount` property of the parent group.
	#' @param adminCreated Value is `true` if this group was created by an administrator rather than a user.
	#' @param nonEditableAliases List of the group's non-editable alias email addresses that are outside of the account's primary domain or subdomains. These are functioning email addresses used by the group. This is a read-only property returned in the API's response for a group. If edited in a group's POST or PUT request, the edit is ignored by the API service.
	#' @param etag ETag of the resource.
	#' @param id The unique ID of a group. A group `id` can be used as a group request URI's `groupKey`.
	#' @param email The group's email address. If your account has multiple domains, select the appropriate domain for the email address. The `email` must be unique. This property is required when creating a group. Group email addresses are subject to the same character usage rules as usernames, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=33386) for the details.
	#' @param aliases List of a group's alias email addresses.
	#' @param name The group's display name.
	#' @param kind The type of the API resource. For Groups resources, the value is `admin#directory#group`.
	#' @param description An extended description to help users determine the purpose of a group. For example, you can include information about who should join the group, the types of messages to send to the group, links to FAQs about the group, or related groups. Maximum length is `4,096` characters.
	#' @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
	groups.patch <- function(groupKey, directMembersCount = NULL, adminCreated = NULL, nonEditableAliases = NULL, etag = NULL, id = NULL, email = NULL, aliases = NULL, name = NULL, kind = NULL, description = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.groups.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.groups.patch']], params = params, base_url = 'https://admin.googleapis.com/')
		req <- gargle::request_build(method = req$method, path = req$path, params = req$params, body = req$body, token = httr::config(token = gargle_token), base_url = req$base_url)
		res <- gargle::request_make(req, encode = 'json')
		if(return_response) return(res)
		httr::content(res)
	}

	#' Updates a group's properties.
	#'
	#'  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.group
	#' }
	#' @param groupKey Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
	#' @param directMembersCount The number of users that are direct members of the group. If a group is a member (child) of this group (the parent), members of the child group are not counted in the `directMembersCount` property of the parent group.
	#' @param adminCreated Value is `true` if this group was created by an administrator rather than a user.
	#' @param nonEditableAliases List of the group's non-editable alias email addresses that are outside of the account's primary domain or subdomains. These are functioning email addresses used by the group. This is a read-only property returned in the API's response for a group. If edited in a group's POST or PUT request, the edit is ignored by the API service.
	#' @param etag ETag of the resource.
	#' @param id The unique ID of a group. A group `id` can be used as a group request URI's `groupKey`.
	#' @param email The group's email address. If your account has multiple domains, select the appropriate domain for the email address. The `email` must be unique. This property is required when creating a group. Group email addresses are subject to the same character usage rules as usernames, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=33386) for the details.
	#' @param aliases List of a group's alias email addresses.
	#' @param name The group's display name.
	#' @param kind The type of the API resource. For Groups resources, the value is `admin#directory#group`.
	#' @param description An extended description to help users determine the purpose of a group. For example, you can include information about who should join the group, the types of messages to send to the group, links to FAQs about the group, or related groups. Maximum length is `4,096` characters.
	#' @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
	groups.update <- function(groupKey, directMembersCount = NULL, adminCreated = NULL, nonEditableAliases = NULL, etag = NULL, id = NULL, email = NULL, aliases = NULL, name = NULL, kind = NULL, description = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.groups.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.groups.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.