pub struct WorkspaceService { /* private fields */ }Expand description
Workspace service for managing collaborative workspaces
Implementations§
Source§impl WorkspaceService
impl WorkspaceService
Sourcepub async fn create_workspace(
&self,
name: String,
description: Option<String>,
owner_id: Uuid,
) -> Result<TeamWorkspace>
pub async fn create_workspace( &self, name: String, description: Option<String>, owner_id: Uuid, ) -> Result<TeamWorkspace>
Create a new workspace
Sourcepub async fn get_workspace(&self, workspace_id: Uuid) -> Result<TeamWorkspace>
pub async fn get_workspace(&self, workspace_id: Uuid) -> Result<TeamWorkspace>
Get a workspace by ID
Sourcepub async fn update_workspace(
&self,
workspace_id: Uuid,
user_id: Uuid,
name: Option<String>,
description: Option<String>,
config: Option<Value>,
) -> Result<TeamWorkspace>
pub async fn update_workspace( &self, workspace_id: Uuid, user_id: Uuid, name: Option<String>, description: Option<String>, config: Option<Value>, ) -> Result<TeamWorkspace>
Update a workspace
Sourcepub async fn delete_workspace(
&self,
workspace_id: Uuid,
user_id: Uuid,
) -> Result<()>
pub async fn delete_workspace( &self, workspace_id: Uuid, user_id: Uuid, ) -> Result<()>
Delete (archive) a workspace
Sourcepub async fn add_member(
&self,
workspace_id: Uuid,
user_id: Uuid,
new_member_id: Uuid,
role: UserRole,
) -> Result<WorkspaceMember>
pub async fn add_member( &self, workspace_id: Uuid, user_id: Uuid, new_member_id: Uuid, role: UserRole, ) -> Result<WorkspaceMember>
Add a member to a workspace
Sourcepub async fn remove_member(
&self,
workspace_id: Uuid,
user_id: Uuid,
member_to_remove: Uuid,
) -> Result<()>
pub async fn remove_member( &self, workspace_id: Uuid, user_id: Uuid, member_to_remove: Uuid, ) -> Result<()>
Remove a member from a workspace
Sourcepub async fn change_role(
&self,
workspace_id: Uuid,
user_id: Uuid,
member_id: Uuid,
new_role: UserRole,
) -> Result<WorkspaceMember>
pub async fn change_role( &self, workspace_id: Uuid, user_id: Uuid, member_id: Uuid, new_role: UserRole, ) -> Result<WorkspaceMember>
Change a member’s role
Sourcepub async fn get_member(
&self,
workspace_id: Uuid,
user_id: Uuid,
) -> Result<WorkspaceMember>
pub async fn get_member( &self, workspace_id: Uuid, user_id: Uuid, ) -> Result<WorkspaceMember>
Get a workspace member
Sourcepub async fn list_members(
&self,
workspace_id: Uuid,
) -> Result<Vec<WorkspaceMember>>
pub async fn list_members( &self, workspace_id: Uuid, ) -> Result<Vec<WorkspaceMember>>
List all members of a workspace
Sourcepub async fn list_user_workspaces(
&self,
user_id: Uuid,
) -> Result<Vec<TeamWorkspace>>
pub async fn list_user_workspaces( &self, user_id: Uuid, ) -> Result<Vec<TeamWorkspace>>
List all workspaces for a user
Auto Trait Implementations§
impl Freeze for WorkspaceService
impl !RefUnwindSafe for WorkspaceService
impl Send for WorkspaceService
impl Sync for WorkspaceService
impl Unpin for WorkspaceService
impl !UnwindSafe for WorkspaceService
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more