Skip to main content

nominal_api/conjure/objects/security/api/workspace/
workspace.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct Workspace {
16    #[serde(rename = "id")]
17    id: super::super::super::super::api::ids::WorkspaceId,
18    #[serde(rename = "rid")]
19    rid: super::super::super::super::api::rids::WorkspaceRid,
20    #[serde(rename = "org")]
21    org: super::super::super::super::authentication::api::OrgRid,
22    #[builder(default, into)]
23    #[serde(rename = "displayName", skip_serializing_if = "Option::is_none", default)]
24    display_name: Option<String>,
25    #[builder(
26        default,
27        custom(
28            type = impl
29            Into<Option<super::WorkspaceSymbol>>,
30            convert = |v|v.into().map(Box::new)
31        )
32    )]
33    #[serde(rename = "symbol", skip_serializing_if = "Option::is_none", default)]
34    symbol: Option<Box<super::WorkspaceSymbol>>,
35    #[builder(custom(type = super::WorkspaceSettings, convert = Box::new))]
36    #[serde(rename = "settings")]
37    settings: Box<super::WorkspaceSettings>,
38}
39impl Workspace {
40    /// A unique identifier for the workspace within the organization. The workspace ID must be lower case alphanumeric characters, optionally separated by hyphens.
41    #[inline]
42    pub fn id(&self) -> &super::super::super::super::api::ids::WorkspaceId {
43        &self.id
44    }
45    #[inline]
46    pub fn rid(&self) -> &super::super::super::super::api::rids::WorkspaceRid {
47        &self.rid
48    }
49    #[inline]
50    pub fn org(&self) -> &super::super::super::super::authentication::api::OrgRid {
51        &self.org
52    }
53    #[inline]
54    pub fn display_name(&self) -> Option<&str> {
55        self.display_name.as_ref().map(|o| &**o)
56    }
57    #[inline]
58    pub fn symbol(&self) -> Option<&super::WorkspaceSymbol> {
59        self.symbol.as_ref().map(|o| &**o)
60    }
61    #[inline]
62    pub fn settings(&self) -> &super::WorkspaceSettings {
63        &*self.settings
64    }
65}