Teams

Struct Teams 

Source
pub struct Teams { /* private fields */ }

Implementations§

Source§

impl Teams

Source

pub fn new(client: &Client) -> Self

Source

pub fn list( &self, search: Option<&str>, limit: Option<i64>, offset: Option<i64>, cursor: Option<&str>, cursor_direction: Option<&str>, order_type: Option<&str>, ) -> Result<TeamList, AppwriteException>

Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.

In admin mode, this endpoint returns a list of all the teams in the current project. Learn more about different API modes.

Source

pub fn create( &self, team_id: &str, name: &str, roles: Option<&[&str]>, ) -> Result<Team, AppwriteException>

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.

Source

pub fn get(&self, team_id: &str) -> Result<Team, AppwriteException>

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

Source

pub fn update( &self, team_id: &str, name: &str, ) -> Result<Team, AppwriteException>

Update a team using its ID. Only members with the owner role can update the team.

Source

pub fn delete(&self, team_id: &str) -> Result<Value, AppwriteException>

Delete a team using its ID. Only team members with the owner role can delete the team.

Source

pub fn get_memberships( &self, team_id: &str, search: Option<&str>, limit: Option<i64>, offset: Option<i64>, cursor: Option<&str>, cursor_direction: Option<&str>, order_type: Option<&str>, ) -> Result<MembershipList, AppwriteException>

Use this endpoint to list a team’s members using the team’s ID. All team members have read access to this endpoint.

Source

pub fn create_membership( &self, team_id: &str, email: &str, roles: &[&str], url: &str, name: Option<&str>, ) -> Result<Membership, AppwriteException>

Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member’s email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.

Use the ‘url’ parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the Update Team Membership Status endpoint to allow the user to accept the invitation to the team.

Please note that to avoid a Redirect Attack the only valid redirect URL’s are the once from domains you have set when adding your platforms in the console interface.

Source

pub fn get_membership( &self, team_id: &str, membership_id: &str, ) -> Result<MembershipList, AppwriteException>

Get a team member by the membership unique id. All team members have read access for this resource.

Source

pub fn update_membership_roles( &self, team_id: &str, membership_id: &str, roles: &[&str], ) -> Result<Membership, AppwriteException>

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.

Source

pub fn delete_membership( &self, team_id: &str, membership_id: &str, ) -> Result<Value, AppwriteException>

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.

Source

pub fn update_membership_status( &self, team_id: &str, membership_id: &str, user_id: &str, secret: &str, ) -> Result<Membership, AppwriteException>

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.

Trait Implementations§

Source§

impl Clone for Teams

Source§

fn clone(&self) -> Teams

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Teams

§

impl !RefUnwindSafe for Teams

§

impl Send for Teams

§

impl Sync for Teams

§

impl Unpin for Teams

§

impl !UnwindSafe for Teams

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,