pub struct Workspace {
pub id: Uuid,
pub name: String,
pub owner_id: Uuid,
pub created_at: DateTime<Utc>,
pub last_modified_at: DateTime<Utc>,
pub domains: Vec<DomainReference>,
pub assets: Vec<AssetReference>,
pub relationships: Vec<Relationship>,
}Expand description
Workspace - Top-level container for domains, assets, and relationships
Workspaces organize domains, systems, and their associated assets.
All files use a flat naming convention: {workspace}_{domain}_{system}_{resource}.xxx.yaml
Fields§
§id: UuidUnique identifier for the workspace
name: StringWorkspace name (used in file naming)
owner_id: UuidOwner/creator user identifier
created_at: DateTime<Utc>Creation timestamp
last_modified_at: DateTime<Utc>Last modification timestamp
domains: Vec<DomainReference>Domain references with their systems
assets: Vec<AssetReference>All asset references in this workspace
relationships: Vec<Relationship>Relationships between assets in this workspace
Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn with_id(id: Uuid, name: String, owner_id: Uuid) -> Workspace
pub fn with_id(id: Uuid, name: String, owner_id: Uuid) -> Workspace
Create a workspace with a specific ID
Sourcepub fn add_relationship(&mut self, relationship: Relationship)
pub fn add_relationship(&mut self, relationship: Relationship)
Add a relationship to the workspace
Sourcepub fn remove_relationship(&mut self, relationship_id: Uuid) -> bool
pub fn remove_relationship(&mut self, relationship_id: Uuid) -> bool
Remove a relationship by ID
Sourcepub fn get_relationships_for_source(
&self,
source_table_id: Uuid,
) -> Vec<&Relationship>
pub fn get_relationships_for_source( &self, source_table_id: Uuid, ) -> Vec<&Relationship>
Get relationships by source table ID
Sourcepub fn get_relationships_for_target(
&self,
target_table_id: Uuid,
) -> Vec<&Relationship>
pub fn get_relationships_for_target( &self, target_table_id: Uuid, ) -> Vec<&Relationship>
Get relationships by target table ID
Sourcepub fn add_domain(&mut self, domain_id: Uuid, domain_name: String)
pub fn add_domain(&mut self, domain_id: Uuid, domain_name: String)
Add a domain reference to the workspace
Sourcepub fn add_domain_with_description(
&mut self,
domain_id: Uuid,
domain_name: String,
description: Option<String>,
)
pub fn add_domain_with_description( &mut self, domain_id: Uuid, domain_name: String, description: Option<String>, )
Add a domain with description
Sourcepub fn add_system_to_domain(
&mut self,
domain_name: &str,
system_id: Uuid,
system_name: String,
description: Option<String>,
) -> bool
pub fn add_system_to_domain( &mut self, domain_name: &str, system_id: Uuid, system_name: String, description: Option<String>, ) -> bool
Add a system to a domain
Sourcepub fn remove_domain(&mut self, domain_id: Uuid) -> bool
pub fn remove_domain(&mut self, domain_id: Uuid) -> bool
Remove a domain reference by ID
Sourcepub fn get_domain(&self, domain_id: Uuid) -> Option<&DomainReference>
pub fn get_domain(&self, domain_id: Uuid) -> Option<&DomainReference>
Get a domain reference by ID
Sourcepub fn get_domain_by_name(&self, name: &str) -> Option<&DomainReference>
pub fn get_domain_by_name(&self, name: &str) -> Option<&DomainReference>
Get a domain reference by name
Sourcepub fn add_asset(&mut self, asset: AssetReference)
pub fn add_asset(&mut self, asset: AssetReference)
Add an asset reference
Sourcepub fn remove_asset(&mut self, asset_id: Uuid) -> bool
pub fn remove_asset(&mut self, asset_id: Uuid) -> bool
Remove an asset by ID
Sourcepub fn get_asset(&self, asset_id: Uuid) -> Option<&AssetReference>
pub fn get_asset(&self, asset_id: Uuid) -> Option<&AssetReference>
Get an asset by ID
Sourcepub fn get_assets_by_domain(&self, domain_name: &str) -> Vec<&AssetReference>
pub fn get_assets_by_domain(&self, domain_name: &str) -> Vec<&AssetReference>
Get assets by domain
Sourcepub fn get_assets_by_type(&self, asset_type: &AssetType) -> Vec<&AssetReference>
pub fn get_assets_by_type(&self, asset_type: &AssetType) -> Vec<&AssetReference>
Get assets by type
Sourcepub fn generate_asset_filename(&self, asset: &AssetReference) -> String
pub fn generate_asset_filename(&self, asset: &AssetReference) -> String
Generate filename for an asset using the naming convention Format: {workspace}{domain}{system}_{resource}.{extension}
Sourcepub fn parse_asset_filename(
filename: &str,
) -> Option<(String, Option<String>, String, AssetType)>
pub fn parse_asset_filename( filename: &str, ) -> Option<(String, Option<String>, String, AssetType)>
Parse a filename to extract workspace, domain, system, and resource names Returns (domain, system, resource_name) or None if parsing fails
Sourcepub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Export workspace to pretty JSON