R6 Class representing a central resource for managing divisions.
Super class
sevenbridges2::Item
-> Division
Public fields
URL
List of URL endpoints for this resource.
id
The ID of the division.
name
Division's name.
Methods
Method print()
Print method for Division class.
Method reload()
Reload Division object information.
Arguments
...
Other arguments that can be passed to core
api()
function like 'fields', etc.@importFrom rlang inform
Method 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.
Arguments
list_all
Boolean. 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 isFALSE
....
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
A Collection
of Team
objects.
Examples
\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)
}
Method 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.
Arguments
role
Filter members by role. Supported roles are
ADMIN
,MEMBER
, andEXTERNAL_COLLABORATOR
. IfNULL
(default), members of all roles will be retrieved.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 other query parameters or 'fields', etc.
Returns
A Collection
of User
objects.
Examples
\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")
}
Method 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.
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 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)
}
Examples
## ------------------------------------------------
## Method `Division$print`
## ------------------------------------------------
if (FALSE) { # \dontrun{
division_object <- Division$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
division_object$print()
} # }
## ------------------------------------------------
## Method `Division$reload`
## ------------------------------------------------
if (FALSE) { # \dontrun{
division_object <- Division$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
division_object$reload()
} # }
## ------------------------------------------------
## Method `Division$list_teams`
## ------------------------------------------------
if (FALSE) { # \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)
} # }
## ------------------------------------------------
## Method `Division$list_members`
## ------------------------------------------------
if (FALSE) { # \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")
} # }
## ------------------------------------------------
## Method `Division$remove_member`
## ------------------------------------------------
if (FALSE) { # \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)
} # }