Skip to contents

R6 Class representing teams resource endpoints.

Super class

sevenbridges2::Resource -> Teams

Public fields

URL

List of URL endpoints for this resource.

Methods


Method new()

Create new Teams resource object.

Usage

Teams$new(...)

Arguments

...

Other response arguments.


Method query()

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.

Usage

Teams$query(division, list_all = FALSE, ...)

Arguments

division

The string ID of the division or Division object you are querying.

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 is FALSE.

...

Other arguments that can be passed to core api() function like 'fields', etc.

Returns

A Collection of Team objects.

Examples

\dontrun{
  # Retrieve a list of all teams within the division regardless of
  # whether you are a member of a team or not
  a$teams$query(division = "division-id", list_all = TRUE)
}


Method get()

This call returns the details of a specified team. You can only get details of a team you are a member of.

Usage

Teams$get(id, ...)

Arguments

id

The ID of the team you are querying. The function also accepts a Team object and extracts the ID.

...

Other arguments that can be passed to core api() function like 'fields', etc.

Returns

Team object.

Examples

\dontrun{
  # Retrieve details of a specified team
  a$teams$get(id = "team-id")
}


Method create()

This call creates a new team within a specified division.

Usage

Teams$create(division, name)

Arguments

division

The string ID of the division or Division object where you want to create a team.

name

Enter the name for the new team.

Returns

A Team object.

Examples

\dontrun{
  # Create new team
  a$teams$create(division = "division-id", name = "my-new-team")
}


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.

Usage

Teams$delete(team, ...)

Arguments

team

The team ID or Team object that you want to delete.

...

Other arguments that can be passed to core api() function.

Examples

\dontrun{
  # Delete a team
  a$teams$delete(team = "team-id")
}


Method clone()

The objects of this class are cloneable with this method.

Usage

Teams$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `Teams$query`
## ------------------------------------------------

if (FALSE) { # \dontrun{
  # Retrieve a list of all teams within the division regardless of
  # whether you are a member of a team or not
  a$teams$query(division = "division-id", list_all = TRUE)
} # }


## ------------------------------------------------
## Method `Teams$get`
## ------------------------------------------------

if (FALSE) { # \dontrun{
  # Retrieve details of a specified team
  a$teams$get(id = "team-id")
} # }

## ------------------------------------------------
## Method `Teams$create`
## ------------------------------------------------

if (FALSE) { # \dontrun{
  # Create new team
  a$teams$create(division = "division-id", name = "my-new-team")
} # }


## ------------------------------------------------
## Method `Teams$delete`
## ------------------------------------------------

if (FALSE) { # \dontrun{
  # Delete a team
  a$teams$delete(team = "team-id")
} # }