R/members.R

Defines functions members.update members.patch members.list members.insert members.hasMember members.get members.delete

Documented in members.delete members.get members.hasMember members.insert members.list members.patch members.update

	#' Removes a member from a group.
	#'
	#'  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.group
	#' \item https://www.googleapis.com/auth/admin.directory.group.member
	#' }
	#' @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 memberKey Identifies the group member in the API request. A group member can be a user or another group. The value can be the member's (group or user) primary email address, alias, or unique ID.
	#' @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
	members.delete <- function(groupKey, memberKey, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.members.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.members.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 a group member's properties.
	#'
	#'  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.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
	#' }
	#' @param memberKey Identifies the group member in the API request. A group member can be a user or another group. The value can be the member's (group or user) primary email address, alias, or unique ID.
	#' @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 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
	members.get <- function(memberKey, groupKey, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.members.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.members.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)
	}

	#' Checks whether the given user is a member of the group.
	#'
	#' Membership can be direct or nested. 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.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
	#' }
	#' @param memberKey Identifies the user member in the API request. The value can be the user's primary email address, alias, or unique ID.
	#' @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 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
	members.hasMember <- function(memberKey, groupKey, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.members.hasMember']]$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.members.hasMember']], 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 a user to the specified group.
	#'
	#'  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.group
	#' \item https://www.googleapis.com/auth/admin.directory.group.member
	#' }
	#' @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 etag ETag of the resource.
	#' @param status Status of member (Immutable)
	#' @param role The member's role in a group. The API returns an error for cycles in group memberships. For example, if `group1` is a member of `group2`, `group2` cannot be a member of `group1`. For more information about a member's role, see the [administration help center](https://support.google.com/a/answer/167094).
	#' @param delivery_settings Defines mail delivery preferences of member. This is only supported by create/update/get.
	#' @param type The type of group member.
	#' @param id The unique ID of the group member. A member `id` can be used as a member request URI's `memberKey`.
	#' @param email The member's email address. A member can be a user or another group. This property is required when adding a member to a group. The `email` must be unique and cannot be an alias of another group. If the email address is changed, the API automatically reflects the email address changes.
	#' @param kind The type of the API resource. For Members resources, the value is `admin#directory#member`.
	#' @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
	members.insert <- function(groupKey, etag = NULL, status = NULL, role = NULL, delivery_settings = NULL, type = NULL, id = NULL, email = NULL, kind = NULL, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.members.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.members.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 paginated list of all members in a group.
	#'
	#'  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.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
	#' }
	#' @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 includeDerivedMembership Whether to list indirect memberships. Default: false.
	#' @param roles The `roles` query parameter allows you to retrieve group members by role. Allowed values are `OWNER`, `MANAGER`, and `MEMBER`.
	#' @param pageToken Token to specify next page in the list.
	#' @param maxResults Maximum number of results to return. Max allowed value is 200.
	#' @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
	members.list <- function(groupKey, includeDerivedMembership = NULL, roles = NULL, pageToken = NULL, maxResults = NULL, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.members.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.members.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 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[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.group
	#' \item https://www.googleapis.com/auth/admin.directory.group.member
	#' }
	#' @param memberKey Identifies the group member in the API request. A group member can be a user or another group. The value can be the member's (group or user) primary email address, alias, or unique ID.
	#' @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 etag ETag of the resource.
	#' @param status Status of member (Immutable)
	#' @param role The member's role in a group. The API returns an error for cycles in group memberships. For example, if `group1` is a member of `group2`, `group2` cannot be a member of `group1`. For more information about a member's role, see the [administration help center](https://support.google.com/a/answer/167094).
	#' @param delivery_settings Defines mail delivery preferences of member. This is only supported by create/update/get.
	#' @param type The type of group member.
	#' @param id The unique ID of the group member. A member `id` can be used as a member request URI's `memberKey`.
	#' @param email The member's email address. A member can be a user or another group. This property is required when adding a member to a group. The `email` must be unique and cannot be an alias of another group. If the email address is changed, the API automatically reflects the email address changes.
	#' @param kind The type of the API resource. For Members resources, the value is `admin#directory#member`.
	#' @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
	members.patch <- function(memberKey, groupKey, etag = NULL, status = NULL, role = NULL, delivery_settings = NULL, type = NULL, id = NULL, email = NULL, kind = NULL, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.members.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.members.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 the membership of a user in the specified group.
	#'
	#'  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.group
	#' \item https://www.googleapis.com/auth/admin.directory.group.member
	#' }
	#' @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 memberKey Identifies the group member in the API request. A group member can be a user or another group. The value can be the member's (group or user) primary email address, alias, or unique ID.
	#' @param etag ETag of the resource.
	#' @param status Status of member (Immutable)
	#' @param role The member's role in a group. The API returns an error for cycles in group memberships. For example, if `group1` is a member of `group2`, `group2` cannot be a member of `group1`. For more information about a member's role, see the [administration help center](https://support.google.com/a/answer/167094).
	#' @param delivery_settings Defines mail delivery preferences of member. This is only supported by create/update/get.
	#' @param type The type of group member.
	#' @param id The unique ID of the group member. A member `id` can be used as a member request URI's `memberKey`.
	#' @param email The member's email address. A member can be a user or another group. This property is required when adding a member to a group. The `email` must be unique and cannot be an alias of another group. If the email address is changed, the API automatically reflects the email address changes.
	#' @param kind The type of the API resource. For Members resources, the value is `admin#directory#member`.
	#' @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
	members.update <- function(groupKey, memberKey, etag = NULL, status = NULL, role = NULL, delivery_settings = NULL, type = NULL, id = NULL, email = NULL, kind = NULL, callback = NULL, fields = NULL, uploadType = NULL, upload_protocol = NULL, prettyPrint = NULL, quotaUser = NULL, alt = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.members.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.members.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)
	}
samterfa/gapiAdminSDK documentation built on Dec. 22, 2021, 10:11 p.m.