pub struct CloudWorkspace {Show 14 fields
pub id: Uuid,
pub org_id: Uuid,
pub name: String,
pub description: String,
pub is_active: bool,
pub settings: Value,
pub created_by: Uuid,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub sort_order: i32,
pub encryption_enabled: bool,
pub encryption_algorithm: String,
pub encryption_config: Value,
pub encryption_key_rotated_at: Option<DateTime<Utc>>,
}Fields§
§id: Uuid§org_id: Uuid§name: String§description: String§is_active: bool§settings: Value§created_by: Uuid§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§sort_order: i32§encryption_enabled: bool§encryption_algorithm: String§encryption_config: Value§encryption_key_rotated_at: Option<DateTime<Utc>>Implementations§
Source§impl Workspace
impl Workspace
Sourcepub async fn create(
pool: &Pool<Postgres>,
org_id: Uuid,
created_by: Uuid,
name: &str,
description: &str,
) -> Result<Workspace, Error>
pub async fn create( pool: &Pool<Postgres>, org_id: Uuid, created_by: Uuid, name: &str, description: &str, ) -> Result<Workspace, Error>
Create a new workspace
Sourcepub async fn find_by_id(
pool: &Pool<Postgres>,
id: Uuid,
) -> Result<Option<Workspace>, Error>
pub async fn find_by_id( pool: &Pool<Postgres>, id: Uuid, ) -> Result<Option<Workspace>, Error>
Find a workspace by ID
Sourcepub async fn find_by_org(
pool: &Pool<Postgres>,
org_id: Uuid,
) -> Result<Vec<Workspace>, Error>
pub async fn find_by_org( pool: &Pool<Postgres>, org_id: Uuid, ) -> Result<Vec<Workspace>, Error>
Find all workspaces for an organization.
sort_order (added in migration 20250101000038) honors drag-to-reorder; ties fall back
to created_at DESC so new workspaces surface first until a user reorders.
Sourcepub async fn update(
pool: &Pool<Postgres>,
id: Uuid,
name: Option<&str>,
description: Option<&str>,
is_active: Option<bool>,
settings: Option<&Value>,
) -> Result<Option<Workspace>, Error>
pub async fn update( pool: &Pool<Postgres>, id: Uuid, name: Option<&str>, description: Option<&str>, is_active: Option<bool>, settings: Option<&Value>, ) -> Result<Option<Workspace>, Error>
Update a workspace
Sourcepub async fn set_encryption_enabled(
pool: &Pool<Postgres>,
id: Uuid,
enabled: bool,
) -> Result<Option<Workspace>, Error>
pub async fn set_encryption_enabled( pool: &Pool<Postgres>, id: Uuid, enabled: bool, ) -> Result<Option<Workspace>, Error>
Flip encryption_enabled and stamp key_rotated_at when turning on.
Sourcepub async fn set_encryption_config(
pool: &Pool<Postgres>,
id: Uuid,
config: &Value,
) -> Result<Option<Workspace>, Error>
pub async fn set_encryption_config( pool: &Pool<Postgres>, id: Uuid, config: &Value, ) -> Result<Option<Workspace>, Error>
Overwrite the JSONB encryption_config blob.
Sourcepub fn to_summary(&self) -> WorkspaceSummaryResponse
pub fn to_summary(&self) -> WorkspaceSummaryResponse
Convert to summary response (frontend-compatible format)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Workspace
impl<'de> Deserialize<'de> for Workspace
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Workspace, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Workspace, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, R> FromRow<'a, R> for Workspacewhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
String: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
bool: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Value: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
i32: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<DateTime<Utc>>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
impl<'a, R> FromRow<'a, R> for Workspacewhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
String: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
bool: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Value: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
i32: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<DateTime<Utc>>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Source§impl Serialize for Workspace
impl Serialize for Workspace
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
impl UnwindSafe for Workspace
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.