#[non_exhaustive]pub struct CaseCreateRelationships {
pub assignee: Option<Option<NullableUserRelationship>>,
pub project: ProjectRelationship,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Relationships formed with the case on creation
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.assignee: Option<Option<NullableUserRelationship>>
Relationship to user.
project: ProjectRelationship
Relationship to project
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CaseCreateRelationships
impl CaseCreateRelationships
Sourcepub fn new(project: ProjectRelationship) -> CaseCreateRelationships
pub fn new(project: ProjectRelationship) -> CaseCreateRelationships
Examples found in repository?
examples/v2_case-management_CreateCase.rs (lines 32-35)
19async fn main() {
20 // there is a valid "user" in the system
21 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
22 let body = CaseCreateRequest::new(
23 CaseCreate::new(
24 CaseCreateAttributes::new(
25 "Security breach investigation in 0cfbc5cbc676ee71".to_string(),
26 CaseType::STANDARD,
27 )
28 .priority(CasePriority::NOT_DEFINED),
29 CaseResourceType::CASE,
30 )
31 .relationships(
32 CaseCreateRelationships::new(ProjectRelationship::new(ProjectRelationshipData::new(
33 "d4bbe1af-f36e-42f1-87c1-493ca35c320e".to_string(),
34 ProjectResourceType::PROJECT,
35 )))
36 .assignee(Some(NullableUserRelationship::new(Some(
37 NullableUserRelationshipData::new(user_data_id.clone(), UserResourceType::USER),
38 )))),
39 ),
40 );
41 let configuration = datadog::Configuration::new();
42 let api = CaseManagementAPI::with_config(configuration);
43 let resp = api.create_case(body).await;
44 if let Ok(value) = resp {
45 println!("{:#?}", value);
46 } else {
47 println!("{:#?}", resp.unwrap_err());
48 }
49}
Sourcepub fn assignee(self, value: Option<NullableUserRelationship>) -> Self
pub fn assignee(self, value: Option<NullableUserRelationship>) -> Self
Examples found in repository?
examples/v2_case-management_CreateCase.rs (lines 36-38)
19async fn main() {
20 // there is a valid "user" in the system
21 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
22 let body = CaseCreateRequest::new(
23 CaseCreate::new(
24 CaseCreateAttributes::new(
25 "Security breach investigation in 0cfbc5cbc676ee71".to_string(),
26 CaseType::STANDARD,
27 )
28 .priority(CasePriority::NOT_DEFINED),
29 CaseResourceType::CASE,
30 )
31 .relationships(
32 CaseCreateRelationships::new(ProjectRelationship::new(ProjectRelationshipData::new(
33 "d4bbe1af-f36e-42f1-87c1-493ca35c320e".to_string(),
34 ProjectResourceType::PROJECT,
35 )))
36 .assignee(Some(NullableUserRelationship::new(Some(
37 NullableUserRelationshipData::new(user_data_id.clone(), UserResourceType::USER),
38 )))),
39 ),
40 );
41 let configuration = datadog::Configuration::new();
42 let api = CaseManagementAPI::with_config(configuration);
43 let resp = api.create_case(body).await;
44 if let Ok(value) = resp {
45 println!("{:#?}", value);
46 } else {
47 println!("{:#?}", resp.unwrap_err());
48 }
49}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CaseCreateRelationships
impl Clone for CaseCreateRelationships
Source§fn clone(&self) -> CaseCreateRelationships
fn clone(&self) -> CaseCreateRelationships
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 CaseCreateRelationships
impl Debug for CaseCreateRelationships
Source§impl<'de> Deserialize<'de> for CaseCreateRelationships
impl<'de> Deserialize<'de> for CaseCreateRelationships
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 CaseCreateRelationships
impl PartialEq for CaseCreateRelationships
Source§impl Serialize for CaseCreateRelationships
impl Serialize for CaseCreateRelationships
impl StructuralPartialEq for CaseCreateRelationships
Auto Trait Implementations§
impl Freeze for CaseCreateRelationships
impl RefUnwindSafe for CaseCreateRelationships
impl Send for CaseCreateRelationships
impl Sync for CaseCreateRelationships
impl Unpin for CaseCreateRelationships
impl UnwindSafe for CaseCreateRelationships
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