Users-class: 'Users' objects and resources

Description Details Constructor Author(s) References See Also Examples

Description

Class to manage the Users resource.

Details

The Users resource allows the client to get basic information about the user that is currently using the application.

To query this resource we use the Users() method.

Constructor

Users(): Instantiates an empty Users object. Same as new("Users").

Users(x): x is an AppAuth object. The function returns a Response object of class Users.

Author(s)

Adrian Alexa

References

https://developer.basespace.illumina.com/docs/content/documentation/rest-api/api-reference

See Also

AppAuth, Response.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
data(aAuth)

## Empty instance
Users()

## Quering the Users resource using the AppAuth handler
u <- Users(aAuth)
## Printing the object shows the response elements
u


## Accesors
Id(u)
Name(u)
## Using the general '$' accesor, same interface as 'list'
u$Id
u$Email # there is no accesor method Email(), so '$' is useful here!
u$fakeElement # returns NULL (to keep the same semantic as 'list')


## Quering the resource unsing a Response object
Users(u) # u is of class Users which extends Response


## Specifying a user ID. ID can be specify either as an integer or as a string
Users(aAuth, id = 1463464) # must work if given as an integer(even of mode numeric)
Users(aAuth, id = "1463464") # must work

## This should fail since is not the current user
tryCatch(Users(aAuth, id = "660666"), error = function(e) cat("No access to this user data!\n"))

BaseSpaceR documentation built on Nov. 8, 2020, 5:12 p.m.