#[non_exhaustive]pub struct NullableRelationshipToUserData {
pub id: String,
pub type_: UsersType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Relationship to user object.
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.id: String
A unique identifier that represents the user.
type_: UsersType
Users resource type.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl NullableRelationshipToUserData
impl NullableRelationshipToUserData
Sourcepub fn new(id: String, type_: UsersType) -> NullableRelationshipToUserData
pub fn new(id: String, type_: UsersType) -> NullableRelationshipToUserData
Examples found in repository?
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}
More examples
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 NullableRelationshipToUserData
impl Clone for NullableRelationshipToUserData
Source§fn clone(&self) -> NullableRelationshipToUserData
fn clone(&self) -> NullableRelationshipToUserData
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 NullableRelationshipToUserData
impl<'de> Deserialize<'de> for NullableRelationshipToUserData
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 NullableRelationshipToUserData
impl PartialEq for NullableRelationshipToUserData
Source§fn eq(&self, other: &NullableRelationshipToUserData) -> bool
fn eq(&self, other: &NullableRelationshipToUserData) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for NullableRelationshipToUserData
Auto Trait Implementations§
impl Freeze for NullableRelationshipToUserData
impl RefUnwindSafe for NullableRelationshipToUserData
impl Send for NullableRelationshipToUserData
impl Sync for NullableRelationshipToUserData
impl Unpin for NullableRelationshipToUserData
impl UnwindSafe for NullableRelationshipToUserData
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