#[non_exhaustive]pub struct NullableRelationshipToUser {
pub data: Option<NullableRelationshipToUserData>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Relationship to user.
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<NullableRelationshipToUserData>
Relationship to user object.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl NullableRelationshipToUser
impl NullableRelationshipToUser
Sourcepub fn new(
data: Option<NullableRelationshipToUserData>,
) -> NullableRelationshipToUser
pub fn new( data: Option<NullableRelationshipToUserData>, ) -> NullableRelationshipToUser
Examples found in repository?
examples/v2_incidents_UpdateIncident_1009194038.rs (line 18)
12async fn main() {
13 // there is a valid "incident" in the system
14 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
15 let body = IncidentUpdateRequest::new(
16 IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).relationships(
17 IncidentUpdateRelationships::new()
18 .commander_user(Some(NullableRelationshipToUser::new(None))),
19 ),
20 );
21 let mut configuration = datadog::Configuration::new();
22 configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
23 let api = IncidentsAPI::with_config(configuration);
24 let resp = api
25 .update_incident(
26 incident_data_id.clone(),
27 body,
28 UpdateIncidentOptionalParams::default(),
29 )
30 .await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
More examples
examples/v2_incidents_UpdateIncident_3369341440.rs (lines 23-26)
14async fn main() {
15 // there is a valid "incident" in the system
16 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
17
18 // there is a valid "user" in the system
19 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
20 let body = IncidentUpdateRequest::new(
21 IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).relationships(
22 IncidentUpdateRelationships::new().commander_user(Some(
23 NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(
24 user_data_id.clone(),
25 UsersType::USERS,
26 ))),
27 )),
28 ),
29 );
30 let mut configuration = datadog::Configuration::new();
31 configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
32 let api = IncidentsAPI::with_config(configuration);
33 let resp = api
34 .update_incident(
35 incident_data_id.clone(),
36 body,
37 UpdateIncidentOptionalParams::default(),
38 )
39 .await;
40 if let Ok(value) = resp {
41 println!("{:#?}", value);
42 } else {
43 println!("{:#?}", resp.unwrap_err());
44 }
45}
examples/v2_incidents_CreateIncident.rs (lines 36-39)
18async fn main() {
19 // there is a valid "user" in the system
20 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
21 let body = IncidentCreateRequest::new(
22 IncidentCreateData::new(
23 IncidentCreateAttributes::new(false, "Example-Incident".to_string()).fields(
24 BTreeMap::from([(
25 "state".to_string(),
26 IncidentFieldAttributes::IncidentFieldAttributesSingleValue(Box::new(
27 IncidentFieldAttributesSingleValue::new()
28 .type_(IncidentFieldAttributesSingleValueType::DROPDOWN)
29 .value(Some("resolved".to_string())),
30 )),
31 )]),
32 ),
33 IncidentType::INCIDENTS,
34 )
35 .relationships(IncidentCreateRelationships::new(Some(
36 NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(
37 user_data_id.clone(),
38 UsersType::USERS,
39 ))),
40 ))),
41 );
42 let mut configuration = datadog::Configuration::new();
43 configuration.set_unstable_operation_enabled("v2.CreateIncident", true);
44 let api = IncidentsAPI::with_config(configuration);
45 let resp = api.create_incident(body).await;
46 if let Ok(value) = resp {
47 println!("{:#?}", value);
48 } else {
49 println!("{:#?}", resp.unwrap_err());
50 }
51}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for NullableRelationshipToUser
impl Clone for NullableRelationshipToUser
Source§fn clone(&self) -> NullableRelationshipToUser
fn clone(&self) -> NullableRelationshipToUser
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 NullableRelationshipToUser
impl Debug for NullableRelationshipToUser
Source§impl<'de> Deserialize<'de> for NullableRelationshipToUser
impl<'de> Deserialize<'de> for NullableRelationshipToUser
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
impl StructuralPartialEq for NullableRelationshipToUser
Auto Trait Implementations§
impl Freeze for NullableRelationshipToUser
impl RefUnwindSafe for NullableRelationshipToUser
impl Send for NullableRelationshipToUser
impl Sync for NullableRelationshipToUser
impl Unpin for NullableRelationshipToUser
impl UnwindSafe for NullableRelationshipToUser
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