pub struct ZoneMembers<'a> { /* private fields */ }Expand description
Who has access to a zone, from Client::zone_members.
Implementations§
Source§impl<'a> ZoneMembers<'a>
impl<'a> ZoneMembers<'a>
Sourcepub async fn list(&self, zone_id: Uuid) -> Result<Vec<ZoneMember>>
pub async fn list(&self, zone_id: Uuid) -> Result<Vec<ZoneMember>>
The zone’s Owner and Administrators, each with their email. Anyone with access to the zone may read it.
GET /api/v1/zone-members?zone_id=...
Sourcepub async fn add(&self, zone_id: Uuid, email: &str) -> Result<()>
pub async fn add(&self, zone_id: Uuid, email: &str) -> Result<()>
Gives the registered user with this email (case-insensitive) Administrator access
to the zone. Owner, Admin or the zone key only.
Core answers the same way whether the user was added, already was a member (the
role stays as it was) or the email is not registered (dropped, no invitation), so it
never reveals which emails exist. Read the outcome with ZoneMembers::list.
POST /api/v1/zone-members
§Errors
ErrorCode::Validationfor a malformed email.ErrorCode::Forbiddenwithout Owner rights.
Sourcepub async fn remove(&self, zone_id: Uuid, user_id: Uuid) -> Result<()>
pub async fn remove(&self, zone_id: Uuid, user_id: Uuid) -> Result<()>
Takes away a user’s access to the zone. Owner, Admin or the zone key only; the Owner cannot be removed.
DELETE /api/v1/zone-members/:zone_id/:user_id
§Errors
ErrorCode::NotFoundif the user is not a member.ErrorCode::Forbiddenwithout Owner rights, or for the Owner’s own membership.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ZoneMembers<'a>
impl<'a> !UnwindSafe for ZoneMembers<'a>
impl<'a> Freeze for ZoneMembers<'a>
impl<'a> Send for ZoneMembers<'a>
impl<'a> Sync for ZoneMembers<'a>
impl<'a> Unpin for ZoneMembers<'a>
impl<'a> UnsafeUnpin for ZoneMembers<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more