#[non_exhaustive]pub struct IncidentNotificationTemplateCreateAttributes {
pub category: String,
pub content: String,
pub name: String,
pub subject: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The attributes for creating a notification template.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.category: String
The category of the notification template.
content: String
The content body of the notification template.
name: String
The name of the notification template.
subject: String
The subject line of the notification template.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl IncidentNotificationTemplateCreateAttributes
impl IncidentNotificationTemplateCreateAttributes
Sourcepub fn new(
category: String,
content: String,
name: String,
subject: String,
) -> IncidentNotificationTemplateCreateAttributes
pub fn new( category: String, content: String, name: String, subject: String, ) -> IncidentNotificationTemplateCreateAttributes
Examples found in repository?
examples/v2_incidents_CreateIncidentNotificationTemplate.rs (lines 19-32)
14async fn main() {
15 // there is a valid "incident_type" in the system
16 let incident_type_data_id = std::env::var("INCIDENT_TYPE_DATA_ID").unwrap();
17 let body = CreateIncidentNotificationTemplateRequest::new(
18 IncidentNotificationTemplateCreateData::new(
19 IncidentNotificationTemplateCreateAttributes::new(
20 "alert".to_string(),
21 r#"An incident has been declared.
22
23Title: Sample Incident Title
24Severity: SEV-2
25Affected Services: web-service, database-service
26Status: active
27
28Please join the incident channel for updates."#
29 .to_string(),
30 "Example-Incident".to_string(),
31 "SEV-2 Incident: Sample Incident Title".to_string(),
32 ),
33 IncidentNotificationTemplateType::NOTIFICATION_TEMPLATES,
34 )
35 .relationships(
36 IncidentNotificationTemplateCreateDataRelationships::new().incident_type(
37 RelationshipToIncidentType::new(RelationshipToIncidentTypeData::new(
38 incident_type_data_id.clone(),
39 IncidentTypeType::INCIDENT_TYPES,
40 )),
41 ),
42 ),
43 );
44 let mut configuration = datadog::Configuration::new();
45 configuration.set_unstable_operation_enabled("v2.CreateIncidentNotificationTemplate", true);
46 let api = IncidentsAPI::with_config(configuration);
47 let resp = api.create_incident_notification_template(body).await;
48 if let Ok(value) = resp {
49 println!("{:#?}", value);
50 } else {
51 println!("{:#?}", resp.unwrap_err());
52 }
53}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for IncidentNotificationTemplateCreateAttributes
impl Clone for IncidentNotificationTemplateCreateAttributes
Source§fn clone(&self) -> IncidentNotificationTemplateCreateAttributes
fn clone(&self) -> IncidentNotificationTemplateCreateAttributes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de> Deserialize<'de> for IncidentNotificationTemplateCreateAttributes
impl<'de> Deserialize<'de> for IncidentNotificationTemplateCreateAttributes
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for IncidentNotificationTemplateCreateAttributes
impl PartialEq for IncidentNotificationTemplateCreateAttributes
Source§fn eq(&self, other: &IncidentNotificationTemplateCreateAttributes) -> bool
fn eq(&self, other: &IncidentNotificationTemplateCreateAttributes) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for IncidentNotificationTemplateCreateAttributes
Auto Trait Implementations§
impl Freeze for IncidentNotificationTemplateCreateAttributes
impl RefUnwindSafe for IncidentNotificationTemplateCreateAttributes
impl Send for IncidentNotificationTemplateCreateAttributes
impl Sync for IncidentNotificationTemplateCreateAttributes
impl Unpin for IncidentNotificationTemplateCreateAttributes
impl UnwindSafe for IncidentNotificationTemplateCreateAttributes
Blanket Implementations§
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