| Division | R Documentation |
R6 Class representing a central resource for managing divisions.
sevenbridges2::Item -> Division
URLList of URL endpoints for this resource.
idThe ID of the division.
nameDivision's name.
new()Create a new Division object.
Division$new(res = NA, ...)
resResponse containing the Division object information.
...Other response arguments.
print()Print method for Division class.
Division$print()
\dontrun{
division_object <- Division$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
division_object$print()
}
reload()Reload Division object information.
Division$reload(...)
...Other arguments that can be passed to core api() function
like 'fields', etc.
@importFrom rlang inform
Division object.
\dontrun{
division_object <- Division$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
division_object$reload()
}
list_teams()This call retrieves a list of all teams in a division that you are a member of. Each team's ID and name will be returned.
Division$list_teams(list_all = FALSE, ...)
list_allBoolean. Set this field to TRUE if you want to list
all teams within the division (regardless of whether you are a member
of a team or not). Default value is FALSE.
...Other arguments that can be passed to core api() function
like 'fields', etc.
A Collection of Team objects.
\dontrun{
# Get details of a specific division
division_obj <- a$divisions$get(id = "division-id")
# Retrieve a list of division teams you are a member of
division_obj$list_teams()
# Retrieve a list of all teams within the division regardless of
# whether you are a member of a team or not
division_obj$list_teams(list_all = TRUE)
}
list_members()This call retrieves a list of all members of a division. In addition, you can list members with a specific role, e.g. all administrators within a division.
Division$list_members(
role = NULL,
limit = getOption("sevenbridges2")$limit,
offset = getOption("sevenbridges2")$offset,
...
)roleFilter members by role. Supported roles are ADMIN,
MEMBER, and EXTERNAL_COLLABORATOR. If NULL (default), members of
all roles will be retrieved.
limitThe maximum number of collection items to return
for a single request. Minimum value is 1.
The maximum value is 100 and the default value is 50.
This is a pagination-specific attribute.
offsetThe 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 other query parameters or 'fields', etc.
A Collection of User objects.
\dontrun{
# Get details of a specific division
division_obj <- a$divisions$get(id = "division-id")
# Retrieve a list of all division members
division_obj$list_members()
# Or filter members by role. The following roles are supported:
# "MEMBER", "ADMIN", and "EXTERNAL_COLLABORATOR"
division_obj$list_members(role = "ADMIN")
}
remove_member()Removes a specified user from a division. This action
revokes the user's membership in the division but does not delete their
Platform account. Note that only users with the ADMIN role in the
division can perform this action.
Division$remove_member(user)
userThe Seven Bridges Platform username of the user to be
removed, specified in the format division-name/username, or an object
of class User that contains the username.
\dontrun{
# Retrieve details of a specific division
division_obj <- a$divisions$get(id = "division-id")
# Remove a member using their username
division_obj$remove_member(user = "division-name/username")
# Remove a member using a User object
members <- division_obj$list_members(role = "MEMBER")
member_to_remove <- members$items[[1]]
division_obj$remove_member(user = member_to_remove)
}
clone()The objects of this class are cloneable with this method.
Division$clone(deep = FALSE)
deepWhether to make a deep clone.
## ------------------------------------------------
## Method `Division$print`
## ------------------------------------------------
## Not run:
division_object <- Division$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
division_object$print()
## End(Not run)
## ------------------------------------------------
## Method `Division$reload`
## ------------------------------------------------
## Not run:
division_object <- Division$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
division_object$reload()
## End(Not run)
## ------------------------------------------------
## Method `Division$list_teams`
## ------------------------------------------------
## Not run:
# Get details of a specific division
division_obj <- a$divisions$get(id = "division-id")
# Retrieve a list of division teams you are a member of
division_obj$list_teams()
# Retrieve a list of all teams within the division regardless of
# whether you are a member of a team or not
division_obj$list_teams(list_all = TRUE)
## End(Not run)
## ------------------------------------------------
## Method `Division$list_members`
## ------------------------------------------------
## Not run:
# Get details of a specific division
division_obj <- a$divisions$get(id = "division-id")
# Retrieve a list of all division members
division_obj$list_members()
# Or filter members by role. The following roles are supported:
# "MEMBER", "ADMIN", and "EXTERNAL_COLLABORATOR"
division_obj$list_members(role = "ADMIN")
## End(Not run)
## ------------------------------------------------
## Method `Division$remove_member`
## ------------------------------------------------
## Not run:
# Retrieve details of a specific division
division_obj <- a$divisions$get(id = "division-id")
# Remove a member using their username
division_obj$remove_member(user = "division-name/username")
# Remove a member using a User object
members <- division_obj$list_members(role = "MEMBER")
member_to_remove <- members$items[[1]]
division_obj$remove_member(user = member_to_remove)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.