Documentation
¶
Index ¶
- type CreateMembershipOption
- type CreateMembershipOptions
- type CreateOption
- type CreateOptions
- type ListMembershipsOption
- type ListMembershipsOptions
- type ListOption
- type ListOptions
- type Teams
- func (srv *Teams) Create(TeamId string, Name string, optionalSetters ...CreateOption) (*models.Team, error)
- func (srv *Teams) CreateMembership(TeamId string, Roles []string, optionalSetters ...CreateMembershipOption) (*models.Membership, error)
- func (srv *Teams) Delete(TeamId string) (*interface{}, error)
- func (srv *Teams) DeleteMembership(TeamId string, MembershipId string) (*interface{}, error)
- func (srv *Teams) Get(TeamId string) (*models.Team, error)
- func (srv *Teams) GetMembership(TeamId string, MembershipId string) (*models.Membership, error)
- func (srv *Teams) GetPrefs(TeamId string) (*models.Preferences, error)
- func (srv *Teams) List(optionalSetters ...ListOption) (*models.TeamList, error)
- func (srv *Teams) ListMemberships(TeamId string, optionalSetters ...ListMembershipsOption) (*models.MembershipList, error)
- func (srv *Teams) UpdateMembership(TeamId string, MembershipId string, Roles []string) (*models.Membership, error)
- func (srv *Teams) UpdateMembershipStatus(TeamId string, MembershipId string, UserId string, Secret string) (*models.Membership, error)
- func (srv *Teams) UpdateName(TeamId string, Name string) (*models.Team, error)
- func (srv *Teams) UpdatePrefs(TeamId string, Prefs interface{}) (*models.Preferences, error)
- func (srv *Teams) WithCreateMembershipEmail(v string) CreateMembershipOption
- func (srv *Teams) WithCreateMembershipName(v string) CreateMembershipOption
- func (srv *Teams) WithCreateMembershipPhone(v string) CreateMembershipOption
- func (srv *Teams) WithCreateMembershipUrl(v string) CreateMembershipOption
- func (srv *Teams) WithCreateMembershipUserId(v string) CreateMembershipOption
- func (srv *Teams) WithCreateRoles(v []string) CreateOption
- func (srv *Teams) WithListMembershipsQueries(v []string) ListMembershipsOption
- func (srv *Teams) WithListMembershipsSearch(v string) ListMembershipsOption
- func (srv *Teams) WithListMembershipsTotal(v bool) ListMembershipsOption
- func (srv *Teams) WithListQueries(v []string) ListOption
- func (srv *Teams) WithListSearch(v string) ListOption
- func (srv *Teams) WithListTotal(v bool) ListOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateMembershipOption ¶
type CreateMembershipOption func(*CreateMembershipOptions)
type CreateMembershipOptions ¶
type CreateMembershipOptions struct {
Email string
UserId string
Phone string
Url string
Name string
// contains filtered or unexported fields
}
func (CreateMembershipOptions) New ¶
func (options CreateMembershipOptions) New() *CreateMembershipOptions
type CreateOption ¶
type CreateOption func(*CreateOptions)
type CreateOptions ¶
type CreateOptions struct {
Roles []string
// contains filtered or unexported fields
}
func (CreateOptions) New ¶
func (options CreateOptions) New() *CreateOptions
type ListMembershipsOption ¶
type ListMembershipsOption func(*ListMembershipsOptions)
type ListMembershipsOptions ¶
type ListMembershipsOptions struct {
Queries []string
Search string
Total bool
// contains filtered or unexported fields
}
func (ListMembershipsOptions) New ¶
func (options ListMembershipsOptions) New() *ListMembershipsOptions
type ListOption ¶
type ListOption func(*ListOptions)
type ListOptions ¶
type ListOptions struct {
Queries []string
Search string
Total bool
// contains filtered or unexported fields
}
func (ListOptions) New ¶
func (options ListOptions) New() *ListOptions
type Teams ¶
type Teams struct {
// contains filtered or unexported fields
}
Teams service
func (*Teams) Create ¶
func (srv *Teams) Create(TeamId string, Name string, optionalSetters ...CreateOption) (*models.Team, error)
Create create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
func (*Teams) CreateMembership ¶
func (srv *Teams) CreateMembership(TeamId string, Roles []string, optionalSetters ...CreateMembershipOption) (*models.Membership, error)
CreateMembership invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
func (*Teams) Delete ¶
Delete delete a team using its ID. Only team members with the owner role can delete the team.
func (*Teams) DeleteMembership ¶
DeleteMembership this endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
func (*Teams) GetMembership ¶
GetMembership get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
func (*Teams) GetPrefs ¶
func (srv *Teams) GetPrefs(TeamId string) (*models.Preferences, error)
GetPrefs get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
func (*Teams) List ¶
func (srv *Teams) List(optionalSetters ...ListOption) (*models.TeamList, error)
List get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
func (*Teams) ListMemberships ¶
func (srv *Teams) ListMemberships(TeamId string, optionalSetters ...ListMembershipsOption) (*models.MembershipList, error)
ListMemberships use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
func (*Teams) UpdateMembership ¶
func (srv *Teams) UpdateMembership(TeamId string, MembershipId string, Roles []string) (*models.Membership, error)
UpdateMembership modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
func (*Teams) UpdateMembershipStatus ¶
func (srv *Teams) UpdateMembershipStatus(TeamId string, MembershipId string, UserId string, Secret string) (*models.Membership, error)
UpdateMembershipStatus use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
If the request is successful, a session for the user is automatically created.
func (*Teams) UpdateName ¶
UpdateName update the team's name by its unique ID.
func (*Teams) UpdatePrefs ¶
func (srv *Teams) UpdatePrefs(TeamId string, Prefs interface{}) (*models.Preferences, error)
UpdatePrefs update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
func (*Teams) WithCreateMembershipEmail ¶
func (srv *Teams) WithCreateMembershipEmail(v string) CreateMembershipOption
func (*Teams) WithCreateMembershipName ¶
func (srv *Teams) WithCreateMembershipName(v string) CreateMembershipOption
func (*Teams) WithCreateMembershipPhone ¶
func (srv *Teams) WithCreateMembershipPhone(v string) CreateMembershipOption
func (*Teams) WithCreateMembershipUrl ¶
func (srv *Teams) WithCreateMembershipUrl(v string) CreateMembershipOption
func (*Teams) WithCreateMembershipUserId ¶
func (srv *Teams) WithCreateMembershipUserId(v string) CreateMembershipOption
func (*Teams) WithCreateRoles ¶
func (srv *Teams) WithCreateRoles(v []string) CreateOption
func (*Teams) WithListMembershipsQueries ¶
func (srv *Teams) WithListMembershipsQueries(v []string) ListMembershipsOption
func (*Teams) WithListMembershipsSearch ¶
func (srv *Teams) WithListMembershipsSearch(v string) ListMembershipsOption
func (*Teams) WithListMembershipsTotal ¶
func (srv *Teams) WithListMembershipsTotal(v bool) ListMembershipsOption
func (*Teams) WithListQueries ¶
func (srv *Teams) WithListQueries(v []string) ListOption
func (*Teams) WithListSearch ¶
func (srv *Teams) WithListSearch(v string) ListOption
func (*Teams) WithListTotal ¶
func (srv *Teams) WithListTotal(v bool) ListOption