Team {sevenbridges2} | R Documentation |
R6 Class representing a Team
Description
R6 Class representing a central resource for managing teams.
Super class
sevenbridges2::Item
-> Team
Public fields
URL
List of URL endpoints for this resource.
id
The ID of the team.
name
Team's name.
Methods
Public methods
Method new()
Create a new Team object.
Usage
Team$new(res = NA, ...)
Arguments
res
Response containing the Team object information.
...
Other response arguments.
Method print()
Print method for Team class.
Usage
Team$print()
Examples
\dontrun{ team_object <- Team$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) team_object$print() }
Method reload()
Reload Team object information.
Usage
Team$reload(...)
Arguments
...
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
Team
object.
Examples
\dontrun{ team_object <- Team$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) team_object$reload() }
Method list_members()
This call retrieves a list of all team members within a specified team. Each member's username will be returned.
Usage
Team$list_members( limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
Arguments
limit
The maximum number of collection items to return for a single request. Minimum value is
1
. The maximum value is100
and the default value is50
. This is a pagination-specific attribute.offset
The zero-based starting index in the entire collection of the first item to return. The default value is
0
. This is a pagination-specific attribute....
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
A Collection
of User
objects.
Examples
\dontrun{ # Retrieve details of a specified team my_team <- a$teams$get(id = "team-id") # Retrieve a list of all team members my_team$list_members() }
Method add_member()
This call adds a division member to the specified team.
This action requires ADMIN
privileges.
Usage
Team$add_member(user)
Arguments
user
User ID of the division member you are adding to the team using the following format:
division_id/username
. Alternatively, aUser
object can be provided.
Examples
\dontrun{ # Retrieve details of a specified team my_team <- a$teams$get(id = "team-id") # Add new member to the team my_team$add_member(user = "user-id") }
Method remove_member()
This call removes a member from a team. By removing a
member, you remove the user's membership to the team, but do not
remove their account from the division.
This action requires ADMIN
privileges.
Usage
Team$remove_member(user)
Arguments
user
The Seven Bridges Platform username of the user to be removed, specified in the format
division-name/username
, or an object of classUser
that contains the username.
Examples
\dontrun{ # Retrieve details of a specified team my_team <- a$teams$get(id = "team-id") # Remove a member from the team my_team$remove_member(user = "user-id") }
Method rename()
This call renames the specified team. This action requires
ADMIN
privileges.
Usage
Team$rename(name = NULL)
Arguments
name
The new name for the team.
Examples
\dontrun{ # Retrieve details of a specified team my_team <- a$teams$get(id = "team-id") # Rename the team my_team$rename(name = "new-team-name") }
Method delete()
This call deletes a team. By deleting a team, you remove
the users' membership to the team, but do not remove their accounts
from the division.
This action requires ADMIN
privileges.
Usage
Team$delete()
Examples
\dontrun{ # Retrieve details of a specified team my_team <- a$teams$get(id = "team-id") # Delete a team my_team$delete() }
Method clone()
The objects of this class are cloneable with this method.
Usage
Team$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
## ------------------------------------------------
## Method `Team$print`
## ------------------------------------------------
## Not run:
team_object <- Team$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
team_object$print()
## End(Not run)
## ------------------------------------------------
## Method `Team$reload`
## ------------------------------------------------
## Not run:
team_object <- Team$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
team_object$reload()
## End(Not run)
## ------------------------------------------------
## Method `Team$list_members`
## ------------------------------------------------
## Not run:
# Retrieve details of a specified team
my_team <- a$teams$get(id = "team-id")
# Retrieve a list of all team members
my_team$list_members()
## End(Not run)
## ------------------------------------------------
## Method `Team$add_member`
## ------------------------------------------------
## Not run:
# Retrieve details of a specified team
my_team <- a$teams$get(id = "team-id")
# Add new member to the team
my_team$add_member(user = "user-id")
## End(Not run)
## ------------------------------------------------
## Method `Team$remove_member`
## ------------------------------------------------
## Not run:
# Retrieve details of a specified team
my_team <- a$teams$get(id = "team-id")
# Remove a member from the team
my_team$remove_member(user = "user-id")
## End(Not run)
## ------------------------------------------------
## Method `Team$rename`
## ------------------------------------------------
## Not run:
# Retrieve details of a specified team
my_team <- a$teams$get(id = "team-id")
# Rename the team
my_team$rename(name = "new-team-name")
## End(Not run)
## ------------------------------------------------
## Method `Team$delete`
## ------------------------------------------------
## Not run:
# Retrieve details of a specified team
my_team <- a$teams$get(id = "team-id")
# Delete a team
my_team$delete()
## End(Not run)