#[non_exhaustive]pub struct CreatePageRequestData {
pub attributes: Option<CreatePageRequestDataAttributes>,
pub type_: CreatePageRequestDataType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The main request body, including attributes and resource type.
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.attributes: Option<CreatePageRequestDataAttributes>
Details about the On-Call Page you want to create.
type_: CreatePageRequestDataType
The type of resource used when creating an On-Call Page.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CreatePageRequestData
impl CreatePageRequestData
Sourcepub fn new(type_: CreatePageRequestDataType) -> CreatePageRequestData
pub fn new(type_: CreatePageRequestDataType) -> CreatePageRequestData
Examples found in repository?
examples/v2_on-call-paging_CreateOnCallPage.rs (line 15)
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 attributes(self, value: CreatePageRequestDataAttributes) -> Self
pub fn attributes(self, value: CreatePageRequestDataAttributes) -> Self
Examples found in repository?
examples/v2_on-call-paging_CreateOnCallPage.rs (lines 15-25)
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 CreatePageRequestData
impl Clone for CreatePageRequestData
Source§fn clone(&self) -> CreatePageRequestData
fn clone(&self) -> CreatePageRequestData
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 CreatePageRequestData
impl Debug for CreatePageRequestData
Source§impl<'de> Deserialize<'de> for CreatePageRequestData
impl<'de> Deserialize<'de> for CreatePageRequestData
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 CreatePageRequestData
impl PartialEq for CreatePageRequestData
Source§impl Serialize for CreatePageRequestData
impl Serialize for CreatePageRequestData
impl StructuralPartialEq for CreatePageRequestData
Auto Trait Implementations§
impl Freeze for CreatePageRequestData
impl RefUnwindSafe for CreatePageRequestData
impl Send for CreatePageRequestData
impl Sync for CreatePageRequestData
impl Unpin for CreatePageRequestData
impl UnwindSafe for CreatePageRequestData
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