AppwriteElixir.Services.Teams (appwrite_elixir v0.1.4-rc)

The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources, such as database documents or storage files. Each user who creates a team becomes the team owner and can delegate the ownership role by inviting a new team member. Only team owners can invite new users to their team.

Link to this section Summary

Functions

Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.

Creates team membership by team ID,email,user roles,redirect url and name

Delete a team by its unique ID. Only team owners have write access for this resource.

Delete Team Membership by Team unique ID and Membership ID.

Get a list of all of the project's teams. You can use the query params to filter your results.

Get a team by its unique ID. All team members have read access for this resource.

Get a team members by the team unique ID. All team members have read access for this list of resources. You can use the query params to filter your results.

Update a team by its unique ID. Only team owners have write access for this resource.

Update membership roles by team ID,membership ID,user roles

Update Team Membership Status by Team unique ID,Membership ID,User unique ID and Secret key.

Link to this section Types

Link to this type

membership_object()

Specs

membership_object() :: %{
  id: String.t(),
  userId: String.t(),
  teamId: String.t(),
  name: String.t(),
  email: String.t(),
  invited: integer(),
  joined: integer(),
  confirm: boolean(),
  roles: [String.t()]
}
Link to this type

membership_object_list()

Specs

membership_object_list() :: [sum: integer(), memberships: [membership_object()]]
Link to this type

team_object()

Specs

team_object() :: %{
  id: String.t(),
  name: String.t(),
  dateCreated: integer(),
  sum: integer()
}

$id: Team ID.

name: Team name.

dateCreated: Team creation date in Unix timestamp.

sum: Total sum of team members.

Link to this type

team_object_list()

Specs

team_object_list() :: [sum: integer(), teams: [team_object()]]

Link to this section Functions

Link to this function

create_team(name, roles \\ [])

Specs

create_team(String.t(), []) :: team_object()

Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.

Link to this function

create_team_membership(teamId, email, roles, url, name \\ "")

Specs

create_team_membership(String.t(), String.t(), [...], String.t(), String.t()) ::
  membership_object()

Creates team membership by team ID,email,user roles,redirect url and name

Link to this function

delete_team(teamId)

Specs

delete_team(String.t()) :: nil

Delete a team by its unique ID. Only team owners have write access for this resource.

Link to this function

delete_team_membership(teamId, membershipId)

Specs

delete_team_membership(String.t(), String.t()) :: nil

Delete Team Membership by Team unique ID and Membership ID.

Link to this function

get_all_teams(search \\ "", limit \\ 25, offset \\ 0, orderType \\ "ASC")

Specs

get_all_teams(String.t(), integer(), integer(), String.t()) ::
  team_object_list()

Get a list of all of the project's teams. You can use the query params to filter your results.

Link to this function

get_team(teamId)

Specs

get_team(String.t()) :: team_object()

Get a team by its unique ID. All team members have read access for this resource.

Link to this function

get_team_members(teamId, search \\ "", limit \\ 25, offset \\ 0, orderType \\ "ASC")

Specs

get_team_members(String.t(), String.t(), integer(), integer(), String.t()) ::
  membership_object_list()

Get a team members by the team unique ID. All team members have read access for this list of resources. You can use the query params to filter your results.

Link to this function

update_team(teamId, name)

Specs

update_team(String.t(), String.t()) :: team_object()

Update a team by its unique ID. Only team owners have write access for this resource.

Link to this function

update_team_membership_roles(teamId, membershipId, roles)

Specs

update_team_membership_roles(String.t(), String.t(), [...]) ::
  membership_object()

Update membership roles by team ID,membership ID,user roles

Link to this function

update_team_membership_status(teamId, membershipId, userId, secretKey)

Specs

update_team_membership_status(String.t(), String.t(), String.t(), String.t()) ::
  membership_object()

Update Team Membership Status by Team unique ID,Membership ID,User unique ID and Secret key.