samples/AdminDirectoryV1/R/mobiledevices.R

	#' Takes an action that affects a mobile device.
	#'
	#' For example, remotely wiping a device. 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.device.mobile
	#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.action
	#' }
	#' @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 resourceId The unique ID the API service uses to identify the mobile device.
	#' @param action The action to be performed on the device.
	#' @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
	mobiledevices.action <- function(customerId, resourceId, action = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.mobiledevices.action']]$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.mobiledevices.action']], 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)
	}

	#' Removes a mobile device.
	#'
	#'  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.device.mobile
	#' }
	#' @param resourceId The unique ID the API service uses to identify the mobile device.
	#' @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
	mobiledevices.delete <- function(resourceId, customerId, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.mobiledevices.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.mobiledevices.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 mobile device'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.device.mobile
	#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.action
	#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.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 resourceId The unique ID the API service uses to identify the mobile device.
	#' @param projection Restrict information returned to a set of selected fields.
	#' @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
	mobiledevices.get <- function(customerId, resourceId, projection = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.mobiledevices.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.mobiledevices.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)
	}

	#' Retrieves a paginated list of all mobile devices 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.device.mobile
	#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.action
	#' \item https://www.googleapis.com/auth/admin.directory.device.mobile.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 pageToken Token to specify next page in the list
	#' @param query Search string in the format given at https://developers.google.com/admin-sdk/directory/v1/search-operators
	#' @param projection Restrict information returned to a set of selected fields.
	#' @param orderBy Device property to use for sorting results.
	#' @param sortOrder Whether to return results in ascending or descending order. Must be used with the `orderBy` parameter.
	#' @param maxResults Maximum number of results to return. Max allowed value is 100.
	#' @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
	mobiledevices.list <- function(customerId, pageToken = NULL, query = NULL, projection = NULL, orderBy = NULL, sortOrder = NULL, maxResults = NULL, gargle_token = gargle::token_fetch(scopes = .endpoints[['directory.mobiledevices.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.mobiledevices.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)
	}
samterfa/googlePackageMaker documentation built on May 18, 2022, 10:58 a.m.