Skip to contents

Represents a Synapse Team. The user-definable fields are documented in the arguments below.

Usage

Team(id=NULL, name=NULL, description=NULL, icon=NULL, can_public_join=FALSE, can_request_membership=TRUE, etag=NULL, created_on=NULL, modified_on=NULL, created_by=NULL, modified_by=NULL)

Format

An S3-style class object.

Arguments

id

(Optional[int]) The ID of the team

name

(Optional[str]) The name of the team

description

(Optional[str]) A short description of the team

icon

(Optional[str]) A file handle ID for the icon image of the team

can_public_join

(Optional[bool]) TRUE if members can join without an invitation or approval

can_request_membership

(Optional[bool]) TRUE if users can create a membership request to join

etag

(Optional[str]) Synapse employs an Optimistic Concurrency Control (OCC) scheme to handle concurrent updates. Since the E-Tag changes every time an entity is updated it is used to detect when a client's current representation of an entity is out-of-date.

created_on

(Optional[str]) The date this team was created

modified_on

(Optional[str]) The date this team was last modified

created_by

(Optional[str]) The ID of the user that created this team

modified_by

(Optional[str]) The ID of the user that last modified this team

Value

NULL

Methods

  • Team(id=NULL, name=NULL, description=NULL, icon=NULL, can_public_join=FALSE, can_request_membership=TRUE, etag=NULL, created_on=NULL, modified_on=NULL, created_by=NULL, modified_by=NULL): Constructor for Team

  • synCreate(instance, synapse_client=NULL): Creates a new team on Synapse.

  • synGetFromId(cls, id, synapse_client=NULL): Gets Team object using its integer id.

  • synGetFromName(cls, name, synapse_client=NULL): Gets Team object using its string name.

    Note: You will be unable to retrieve a team by name immediately after its creation because the fragment service is eventually consistent. If you need to retrieve a team immediately following creation you should use the synGetFromId() function instead.

  • synGetUserMembershipStatus(instance, user_id, synapse_client=NULL): Retrieve a user's Team Membership Status bundle for this team.

  • synInviteToTeam(instance, user, message, force=TRUE, synapse_client=NULL): Invites a user to a team given the ID field on the Team instance.

  • synGetTeamMembers(instance, synapse_client=NULL): Gets the TeamMembers associated with a team given the ID field on the Team instance.

  • synGetOpenInvitations(instance, synapse_client=NULL): Gets all open invitations for a team given the ID field on the Team instance.

  • synDeleteInvitation(invitation_id, synapse_client=NULL): Deletes an open invitation to a team. Note: The client must be an administrator of the Team referenced by the invitation, or the invitee, to make this request.

Examples

if (FALSE) { # \dontrun{
## Example 1: Create a new team
    library(synapser)
    synLogin()

    team = Team(
        name = "My Uniquely Named Team",
        description = "A team for my project collaborators"
    ) |> synCreate()

## Example 2: Get a team by ID or name
    library(synapser)
    synLogin()

    team_by_id = Team() |> synGetFromId(id = 123456L)
    team_by_name = Team() |> synGetFromName(name = "My Uniquely Named Team")

    # Or fill in a Team that already has an id or a name. If both are set, the id is used.
    team_by_id = Team(id = 123456L) |> synGet()
    team_by_name = Team(name = "My Uniquely Named Team") |> synGet()

## Example 3: List the members of a team and invite a new one
    library(synapser)
    synLogin()

    team = Team() |> synGetFromId(id = 123456L)
    members = team |> synGetTeamMembers()
    for (member in members) {
        cat(sprintf("%s (admin: %s)\n", member$member$user_name, member$is_admin))
    }

    team |> synInviteToTeam(user = "my_username", message = "Please join my team!")

## Example 4: Delete a team
    library(synapser)
    synLogin()

    team = Team() |> synGetFromId(id = 123456L)
    team |> synDelete()
} # }