#[non_exhaustive]pub struct CreatePageRequest {
pub data: Option<CreatePageRequestData>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Full request to trigger an On-Call Page.
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: Option<CreatePageRequestData>
The main request body, including attributes and resource type.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CreatePageRequest
impl CreatePageRequest
Sourcepub fn new() -> CreatePageRequest
pub fn new() -> CreatePageRequest
Examples found in repository?
examples/v2_on-call-paging_CreateOnCallPage.rs (line 14)
13async fn main() {
14 let body = CreatePageRequest::new().data(
15 CreatePageRequestData::new(CreatePageRequestDataType::PAGES).attributes(
16 CreatePageRequestDataAttributes::new(
17 CreatePageRequestDataAttributesTarget::new()
18 .identifier("my-team".to_string())
19 .type_(OnCallPageTargetType::TEAM_HANDLE),
20 "Page title".to_string(),
21 PageUrgency::LOW,
22 )
23 .description("Page details.".to_string())
24 .tags(vec!["service:test".to_string()]),
25 ),
26 );
27 let configuration = datadog::Configuration::new();
28 let api = OnCallPagingAPI::with_config(configuration);
29 let resp = api.create_on_call_page(body).await;
30 if let Ok(value) = resp {
31 println!("{:#?}", value);
32 } else {
33 println!("{:#?}", resp.unwrap_err());
34 }
35}
Sourcepub fn data(self, value: CreatePageRequestData) -> Self
pub fn data(self, value: CreatePageRequestData) -> Self
Examples found in repository?
examples/v2_on-call-paging_CreateOnCallPage.rs (lines 14-26)
13async fn main() {
14 let body = CreatePageRequest::new().data(
15 CreatePageRequestData::new(CreatePageRequestDataType::PAGES).attributes(
16 CreatePageRequestDataAttributes::new(
17 CreatePageRequestDataAttributesTarget::new()
18 .identifier("my-team".to_string())
19 .type_(OnCallPageTargetType::TEAM_HANDLE),
20 "Page title".to_string(),
21 PageUrgency::LOW,
22 )
23 .description("Page details.".to_string())
24 .tags(vec!["service:test".to_string()]),
25 ),
26 );
27 let configuration = datadog::Configuration::new();
28 let api = OnCallPagingAPI::with_config(configuration);
29 let resp = api.create_on_call_page(body).await;
30 if let Ok(value) = resp {
31 println!("{:#?}", value);
32 } else {
33 println!("{:#?}", resp.unwrap_err());
34 }
35}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CreatePageRequest
impl Clone for CreatePageRequest
Source§fn clone(&self) -> CreatePageRequest
fn clone(&self) -> CreatePageRequest
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 Debug for CreatePageRequest
impl Debug for CreatePageRequest
Source§impl Default for CreatePageRequest
impl Default for CreatePageRequest
Source§impl<'de> Deserialize<'de> for CreatePageRequest
impl<'de> Deserialize<'de> for CreatePageRequest
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 CreatePageRequest
impl PartialEq for CreatePageRequest
Source§impl Serialize for CreatePageRequest
impl Serialize for CreatePageRequest
impl StructuralPartialEq for CreatePageRequest
Auto Trait Implementations§
impl Freeze for CreatePageRequest
impl RefUnwindSafe for CreatePageRequest
impl Send for CreatePageRequest
impl Sync for CreatePageRequest
impl Unpin for CreatePageRequest
impl UnwindSafe for CreatePageRequest
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