#' Deletes a user.
#'
#' 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.user
#' }
#' @param userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user 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
users.delete <- function(userKey, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.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.users.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 user.
#'
#' 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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' }
#' @param userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.
#' @param customFieldMask A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`.
#' @param viewType Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).
#' @param projection What subset of fields to fetch for this user.
#' @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
users.get <- function(userKey, customFieldMask = NULL, viewType = NULL, projection = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.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.users.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 user.
#'
#' 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.user
#' }
#' @param recoveryPhone Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
#' @param notes Notes for the user.
#' @param sshPublicKeys A list of SSH public keys.
#' @param customSchemas Custom fields of the user.
#' @param suspended Indicates if user is suspended.
#' @param phones A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
#' @param password User's password
#' @param organizations A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
#' @param relations A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
#' @param name Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
#' @param archived Indicates if user is archived.
#' @param websites The user's websites. The maximum allowed data size for this field is 2Kb.
#' @param locations The user's locations. The maximum allowed data size for this field is 10Kb.
#' @param posixAccounts A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
#' @param keywords The user's keywords. The maximum allowed data size for this field is 1Kb.
#' @param externalIds A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
#' @param gender The user's gender. The maximum allowed data size for this field is 1Kb.
#' @param addresses A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
#' @param recoveryEmail Recovery email of the user.
#' @param primaryEmail The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
#' @param orgUnitPath The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
#' @param ims The user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2Kb.
#' @param emails A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
#' @param languages The user's languages. The maximum allowed data size for this field is 1Kb.
#' @param changePasswordAtNextLogin Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
#' @param includeInGlobalAddressList Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=1285988).
#' @param ipWhitelisted If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
#' @param hashFunction Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
#' @param id The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
#' @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
users.insert <- function(recoveryPhone = NULL, notes = NULL, sshPublicKeys = NULL, customSchemas = NULL, suspended = NULL, phones = NULL, password = NULL, organizations = NULL, relations = NULL, name = NULL, archived = NULL, websites = NULL, locations = NULL, posixAccounts = NULL, keywords = NULL, externalIds = NULL, gender = NULL, addresses = NULL, recoveryEmail = NULL, primaryEmail = NULL, orgUnitPath = NULL, ims = NULL, emails = NULL, languages = NULL, changePasswordAtNextLogin = NULL, includeInGlobalAddressList = NULL, ipWhitelisted = NULL, hashFunction = NULL, id = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.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.users.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 paginated list of either deleted users or all users in a domain.
#'
#' 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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' \item https://www.googleapis.com/auth/cloud-platform
#' }
#' @param sortOrder Whether to return results in ascending or descending order.
#' @param orderBy Property to use for sorting results.
#' @param pageToken Token to specify next page in the list
#' @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. 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). Either the `customer` or the `domain` parameter must be provided.
#' @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. Either the `customer` or the `domain` parameter must be provided.
#' @param query Query string for searching user fields. For more information on constructing user queries, see [Search for Users](/admin-sdk/directory/v1/guides/search-users).
#' @param viewType Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).
#' @param projection What subset of fields to fetch for this user.
#' @param maxResults Maximum number of results to return.
#' @param customFieldMask A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`.
#' @param showDeleted If set to `true`, retrieves the list of deleted users. (Default: `false`)
#' @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
users.list <- function(sortOrder = NULL, orderBy = NULL, pageToken = NULL, customer = NULL, domain = NULL, query = NULL, viewType = NULL, projection = NULL, maxResults = NULL, customFieldMask = NULL, showDeleted = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.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.users.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)
}
#' Makes a user a super administrator.
#'
#' 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.user
#' }
#' @param userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.
#' @param status Indicates the administrator status of the user.
#' @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
users.makeAdmin <- function(userKey, status = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.makeAdmin']]$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.users.makeAdmin']], 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 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[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.user
#' }
#' @param userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.
#' @param recoveryPhone Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
#' @param notes Notes for the user.
#' @param sshPublicKeys A list of SSH public keys.
#' @param customSchemas Custom fields of the user.
#' @param suspended Indicates if user is suspended.
#' @param phones A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
#' @param password User's password
#' @param organizations A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
#' @param relations A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
#' @param name Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
#' @param archived Indicates if user is archived.
#' @param websites The user's websites. The maximum allowed data size for this field is 2Kb.
#' @param locations The user's locations. The maximum allowed data size for this field is 10Kb.
#' @param posixAccounts A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
#' @param keywords The user's keywords. The maximum allowed data size for this field is 1Kb.
#' @param externalIds A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
#' @param gender The user's gender. The maximum allowed data size for this field is 1Kb.
#' @param addresses A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
#' @param recoveryEmail Recovery email of the user.
#' @param primaryEmail The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
#' @param orgUnitPath The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
#' @param ims The user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2Kb.
#' @param emails A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
#' @param languages The user's languages. The maximum allowed data size for this field is 1Kb.
#' @param changePasswordAtNextLogin Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
#' @param includeInGlobalAddressList Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=1285988).
#' @param ipWhitelisted If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
#' @param hashFunction Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
#' @param id The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
#' @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
users.patch <- function(userKey, recoveryPhone = NULL, notes = NULL, sshPublicKeys = NULL, customSchemas = NULL, suspended = NULL, phones = NULL, password = NULL, organizations = NULL, relations = NULL, name = NULL, archived = NULL, websites = NULL, locations = NULL, posixAccounts = NULL, keywords = NULL, externalIds = NULL, gender = NULL, addresses = NULL, recoveryEmail = NULL, primaryEmail = NULL, orgUnitPath = NULL, ims = NULL, emails = NULL, languages = NULL, changePasswordAtNextLogin = NULL, includeInGlobalAddressList = NULL, ipWhitelisted = NULL, hashFunction = NULL, id = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.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.users.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)
}
#' 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[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.user.security
#' }
#' @param userKey Identifies the target user in the API request. The value can be the user's primary email address, alias email address, or unique user 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
users.signOut <- function(userKey, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.signOut']]$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.users.signOut']], 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)
}
#' Undeletes a deleted user.
#'
#' 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.user
#' }
#' @param userKey The immutable id of the user
#' @param orgUnitPath OrgUnit of User
#' @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
users.undelete <- function(userKey, orgUnitPath = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.undelete']]$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.users.undelete']], 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 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[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.user
#' }
#' @param userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.
#' @param recoveryPhone Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
#' @param notes Notes for the user.
#' @param sshPublicKeys A list of SSH public keys.
#' @param customSchemas Custom fields of the user.
#' @param suspended Indicates if user is suspended.
#' @param phones A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
#' @param password User's password
#' @param organizations A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
#' @param relations A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
#' @param name Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
#' @param archived Indicates if user is archived.
#' @param websites The user's websites. The maximum allowed data size for this field is 2Kb.
#' @param locations The user's locations. The maximum allowed data size for this field is 10Kb.
#' @param posixAccounts A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
#' @param keywords The user's keywords. The maximum allowed data size for this field is 1Kb.
#' @param externalIds A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
#' @param gender The user's gender. The maximum allowed data size for this field is 1Kb.
#' @param addresses A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
#' @param recoveryEmail Recovery email of the user.
#' @param primaryEmail The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
#' @param orgUnitPath The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
#' @param ims The user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2Kb.
#' @param emails A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
#' @param languages The user's languages. The maximum allowed data size for this field is 1Kb.
#' @param changePasswordAtNextLogin Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
#' @param includeInGlobalAddressList Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=1285988).
#' @param ipWhitelisted If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
#' @param hashFunction Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
#' @param id The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
#' @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
users.update <- function(userKey, recoveryPhone = NULL, notes = NULL, sshPublicKeys = NULL, customSchemas = NULL, suspended = NULL, phones = NULL, password = NULL, organizations = NULL, relations = NULL, name = NULL, archived = NULL, websites = NULL, locations = NULL, posixAccounts = NULL, keywords = NULL, externalIds = NULL, gender = NULL, addresses = NULL, recoveryEmail = NULL, primaryEmail = NULL, orgUnitPath = NULL, ims = NULL, emails = NULL, languages = NULL, changePasswordAtNextLogin = NULL, includeInGlobalAddressList = NULL, ipWhitelisted = NULL, hashFunction = NULL, id = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.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.users.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)
}
#' 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.user
#' \item https://www.googleapis.com/auth/admin.directory.user.readonly
#' \item https://www.googleapis.com/auth/cloud-platform
#' }
#' @param pageToken Token to specify next page in the list
#' @param sortOrder Whether to return results in ascending or descending order.
#' @param showDeleted If set to true, retrieves the list of deleted users. (Default: false)
#' @param projection What subset of fields to fetch for this user.
#' @param customFieldMask Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.
#' @param query Query string search. Should be of the form "". Complete documentation is at https: //developers.google.com/admin-sdk/directory/v1/guides/search-users
#' @param domain Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead."
#' @param maxResults Maximum number of results to return.
#' @param customer Immutable ID of the Google Workspace account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.
#' @param orderBy Column to use for sorting results
#' @param event Events to watch for.
#' @param viewType Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).
#' @param params Additional parameters controlling delivery channel behavior. Optional.
#' @param token An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
#' @param payload A Boolean value to indicate whether payload is wanted. Optional.
#' @param resourceId An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
#' @param type The type of delivery mechanism used for this channel.
#' @param expiration Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
#' @param id A UUID or similar unique string that identifies this channel.
#' @param resourceUri A version-specific identifier for the watched resource.
#' @param address The address where notifications are delivered for this channel.
#' @param kind Identifies this as a notification channel used to watch for changes to a resource, which is `api#channel`.
#' @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
users.watch <- function(pageToken = NULL, sortOrder = NULL, showDeleted = NULL, projection = NULL, customFieldMask = NULL, query = NULL, domain = NULL, maxResults = NULL, customer = NULL, orderBy = NULL, event = NULL, viewType = NULL, params = NULL, token = NULL, payload = NULL, resourceId = NULL, type = NULL, expiration = NULL, id = NULL, resourceUri = NULL, address = NULL, kind = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.users.watch']]$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.users.watch']], 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.