Skip to main content

nominal_api/conjure/objects/scout/integrations/api/
integration.rs

1/// Configuration details used to connect to an external service.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct Integration {
17    #[serde(rename = "rid")]
18    rid: super::IntegrationRid,
19    #[builder(into)]
20    #[serde(rename = "name")]
21    name: String,
22    #[builder(default, into)]
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
24    description: Option<String>,
25    #[builder(custom(type = super::IntegrationDetails, convert = Box::new))]
26    #[serde(rename = "integrationDetails")]
27    integration_details: Box<super::IntegrationDetails>,
28    #[serde(rename = "createdAt")]
29    created_at: conjure_object::DateTime<conjure_object::Utc>,
30    #[serde(rename = "createdBy")]
31    created_by: conjure_object::ResourceIdentifier,
32    #[serde(rename = "isArchived")]
33    is_archived: bool,
34}
35impl Integration {
36    #[inline]
37    pub fn rid(&self) -> &super::IntegrationRid {
38        &self.rid
39    }
40    #[inline]
41    pub fn name(&self) -> &str {
42        &*self.name
43    }
44    #[inline]
45    pub fn description(&self) -> Option<&str> {
46        self.description.as_ref().map(|o| &**o)
47    }
48    #[inline]
49    pub fn integration_details(&self) -> &super::IntegrationDetails {
50        &*self.integration_details
51    }
52    #[inline]
53    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
54        self.created_at
55    }
56    #[inline]
57    pub fn created_by(&self) -> &conjure_object::ResourceIdentifier {
58        &self.created_by
59    }
60    #[inline]
61    pub fn is_archived(&self) -> bool {
62        self.is_archived
63    }
64}