Skip to main content

nominal_api/conjure/objects/scout/integrations/api/
alert_message_fields.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 AlertMessageFields {
16    #[builder(into)]
17    #[serde(rename = "assetTitle")]
18    asset_title: String,
19    #[builder(into)]
20    #[serde(rename = "checkTitle")]
21    check_title: String,
22    #[builder(into)]
23    #[serde(rename = "checkDescription")]
24    check_description: String,
25    #[builder(into)]
26    #[serde(rename = "checklistTitle")]
27    checklist_title: String,
28    #[serde(rename = "assetRid")]
29    asset_rid: super::super::super::rids::api::AssetRid,
30    #[serde(rename = "checkLineageRid")]
31    check_lineage_rid: super::super::super::rids::api::CheckLineageRid,
32    #[builder(default, into)]
33    #[serde(rename = "workbookUrl", skip_serializing_if = "Option::is_none", default)]
34    workbook_url: Option<String>,
35    #[builder(default, into)]
36    #[serde(rename = "alertUrl", skip_serializing_if = "Option::is_none", default)]
37    alert_url: Option<String>,
38    #[serde(rename = "eventType")]
39    event_type: super::super::super::super::event::EventType,
40    #[serde(rename = "priority")]
41    priority: super::super::super::api::Priority,
42    #[builder(default, list(item(type = super::super::super::super::api::Label)))]
43    #[serde(rename = "labels", skip_serializing_if = "Vec::is_empty", default)]
44    labels: Vec<super::super::super::super::api::Label>,
45    #[serde(rename = "alertType")]
46    alert_type: super::AlertType,
47}
48impl AlertMessageFields {
49    #[inline]
50    pub fn asset_title(&self) -> &str {
51        &*self.asset_title
52    }
53    #[inline]
54    pub fn check_title(&self) -> &str {
55        &*self.check_title
56    }
57    #[inline]
58    pub fn check_description(&self) -> &str {
59        &*self.check_description
60    }
61    #[inline]
62    pub fn checklist_title(&self) -> &str {
63        &*self.checklist_title
64    }
65    #[inline]
66    pub fn asset_rid(&self) -> &super::super::super::rids::api::AssetRid {
67        &self.asset_rid
68    }
69    #[inline]
70    pub fn check_lineage_rid(&self) -> &super::super::super::rids::api::CheckLineageRid {
71        &self.check_lineage_rid
72    }
73    /// Appended to the end of the message as a button (if supported) or as a text hyperlink.
74    #[inline]
75    pub fn workbook_url(&self) -> Option<&str> {
76        self.workbook_url.as_ref().map(|o| &**o)
77    }
78    /// Appended to the end of the message as a button (if supported) or as a text hyperlink.
79    #[inline]
80    pub fn alert_url(&self) -> Option<&str> {
81        self.alert_url.as_ref().map(|o| &**o)
82    }
83    /// Will be prefixed in title and indicated by an icon.
84    #[inline]
85    pub fn event_type(&self) -> &super::super::super::super::event::EventType {
86        &self.event_type
87    }
88    #[inline]
89    pub fn priority(&self) -> &super::super::super::api::Priority {
90        &self.priority
91    }
92    /// Currently exposed as 'tags' on the frontend to match Opsgenie naming. Used by some integrations to filter/route messages.
93    #[inline]
94    pub fn labels(&self) -> &[super::super::super::super::api::Label] {
95        &*self.labels
96    }
97    /// Determines execution status of the alert, between success, failure, and execution error.
98    #[inline]
99    pub fn alert_type(&self) -> &super::AlertType {
100        &self.alert_type
101    }
102}