@@ -11,6 +11,10 @@ use std::fmt::{self, Formatter};
1111#[ skip_serializing_none]
1212#[ derive( Clone , Debug , PartialEq , Serialize ) ]
1313pub struct CaseCreateAttributes {
14+ /// Case custom attributes
15+ #[ serde( rename = "custom_attributes" ) ]
16+ pub custom_attributes :
17+ Option < std:: collections:: BTreeMap < String , crate :: datadogV2:: model:: CustomAttributeValue > > ,
1418 /// Description
1519 #[ serde( rename = "description" ) ]
1620 pub description : Option < String > ,
@@ -33,6 +37,7 @@ pub struct CaseCreateAttributes {
3337impl CaseCreateAttributes {
3438 pub fn new ( title : String , type_id : String ) -> CaseCreateAttributes {
3539 CaseCreateAttributes {
40+ custom_attributes : None ,
3641 description : None ,
3742 priority : None ,
3843 title,
@@ -42,6 +47,14 @@ impl CaseCreateAttributes {
4247 }
4348 }
4449
50+ pub fn custom_attributes (
51+ mut self ,
52+ value : std:: collections:: BTreeMap < String , crate :: datadogV2:: model:: CustomAttributeValue > ,
53+ ) -> Self {
54+ self . custom_attributes = Some ( value) ;
55+ self
56+ }
57+
4558 pub fn description ( mut self , value : String ) -> Self {
4659 self . description = Some ( value) ;
4760 self
@@ -78,6 +91,12 @@ impl<'de> Deserialize<'de> for CaseCreateAttributes {
7891 where
7992 M : MapAccess < ' a > ,
8093 {
94+ let mut custom_attributes: Option <
95+ std:: collections:: BTreeMap <
96+ String ,
97+ crate :: datadogV2:: model:: CustomAttributeValue ,
98+ > ,
99+ > = None ;
81100 let mut description: Option < String > = None ;
82101 let mut priority: Option < crate :: datadogV2:: model:: CasePriority > = None ;
83102 let mut title: Option < String > = None ;
@@ -90,6 +109,13 @@ impl<'de> Deserialize<'de> for CaseCreateAttributes {
90109
91110 while let Some ( ( k, v) ) = map. next_entry :: < String , serde_json:: Value > ( ) ? {
92111 match k. as_str ( ) {
112+ "custom_attributes" => {
113+ if v. is_null ( ) {
114+ continue ;
115+ }
116+ custom_attributes =
117+ Some ( serde_json:: from_value ( v) . map_err ( M :: Error :: custom) ?) ;
118+ }
93119 "description" => {
94120 if v. is_null ( ) {
95121 continue ;
@@ -130,6 +156,7 @@ impl<'de> Deserialize<'de> for CaseCreateAttributes {
130156 let type_id = type_id. ok_or_else ( || M :: Error :: missing_field ( "type_id" ) ) ?;
131157
132158 let content = CaseCreateAttributes {
159+ custom_attributes,
133160 description,
134161 priority,
135162 title,
0 commit comments