#[non_exhaustive]pub struct CreateIncidentNotificationTemplateRequest {
pub data: IncidentNotificationTemplateCreateData,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Create request for 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.data: IncidentNotificationTemplateCreateData
Notification template data for a create request.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CreateIncidentNotificationTemplateRequest
impl CreateIncidentNotificationTemplateRequest
Sourcepub fn new(
data: IncidentNotificationTemplateCreateData,
) -> CreateIncidentNotificationTemplateRequest
pub fn new( data: IncidentNotificationTemplateCreateData, ) -> CreateIncidentNotificationTemplateRequest
Examples found in repository?
examples/v2_incidents_CreateIncidentNotificationTemplate.rs (lines 17-43)
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 CreateIncidentNotificationTemplateRequest
impl Clone for CreateIncidentNotificationTemplateRequest
Source§fn clone(&self) -> CreateIncidentNotificationTemplateRequest
fn clone(&self) -> CreateIncidentNotificationTemplateRequest
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 CreateIncidentNotificationTemplateRequest
impl<'de> Deserialize<'de> for CreateIncidentNotificationTemplateRequest
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 CreateIncidentNotificationTemplateRequest
impl PartialEq for CreateIncidentNotificationTemplateRequest
Source§fn eq(&self, other: &CreateIncidentNotificationTemplateRequest) -> bool
fn eq(&self, other: &CreateIncidentNotificationTemplateRequest) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for CreateIncidentNotificationTemplateRequest
Auto Trait Implementations§
impl Freeze for CreateIncidentNotificationTemplateRequest
impl RefUnwindSafe for CreateIncidentNotificationTemplateRequest
impl Send for CreateIncidentNotificationTemplateRequest
impl Sync for CreateIncidentNotificationTemplateRequest
impl Unpin for CreateIncidentNotificationTemplateRequest
impl UnwindSafe for CreateIncidentNotificationTemplateRequest
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