@@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize};
6
6
use serde_with:: skip_serializing_none;
7
7
use std:: fmt:: { self , Formatter } ;
8
8
9
- /// Attributes related to the dashboard, including title and popularity .
9
+ /// Attributes related to the dashboard, including title, popularity, and url .
10
10
#[ non_exhaustive]
11
11
#[ skip_serializing_none]
12
12
#[ derive( Clone , Debug , PartialEq , Serialize ) ]
@@ -17,6 +17,9 @@ pub struct MetricDashboardAttributes {
17
17
/// Title of the asset.
18
18
#[ serde( rename = "title" ) ]
19
19
pub title : Option < String > ,
20
+ /// URL path of the asset.
21
+ #[ serde( rename = "url" ) ]
22
+ pub url : Option < String > ,
20
23
#[ serde( flatten) ]
21
24
pub additional_properties : std:: collections:: BTreeMap < String , serde_json:: Value > ,
22
25
#[ serde( skip) ]
@@ -29,6 +32,7 @@ impl MetricDashboardAttributes {
29
32
MetricDashboardAttributes {
30
33
popularity : None ,
31
34
title : None ,
35
+ url : None ,
32
36
additional_properties : std:: collections:: BTreeMap :: new ( ) ,
33
37
_unparsed : false ,
34
38
}
@@ -44,6 +48,11 @@ impl MetricDashboardAttributes {
44
48
self
45
49
}
46
50
51
+ pub fn url ( mut self , value : String ) -> Self {
52
+ self . url = Some ( value) ;
53
+ self
54
+ }
55
+
47
56
pub fn additional_properties (
48
57
mut self ,
49
58
value : std:: collections:: BTreeMap < String , serde_json:: Value > ,
@@ -78,6 +87,7 @@ impl<'de> Deserialize<'de> for MetricDashboardAttributes {
78
87
{
79
88
let mut popularity: Option < f64 > = None ;
80
89
let mut title: Option < String > = None ;
90
+ let mut url: Option < String > = None ;
81
91
let mut additional_properties: std:: collections:: BTreeMap <
82
92
String ,
83
93
serde_json:: Value ,
@@ -98,6 +108,12 @@ impl<'de> Deserialize<'de> for MetricDashboardAttributes {
98
108
}
99
109
title = Some ( serde_json:: from_value ( v) . map_err ( M :: Error :: custom) ?) ;
100
110
}
111
+ "url" => {
112
+ if v. is_null ( ) {
113
+ continue ;
114
+ }
115
+ url = Some ( serde_json:: from_value ( v) . map_err ( M :: Error :: custom) ?) ;
116
+ }
101
117
& _ => {
102
118
if let Ok ( value) = serde_json:: from_value ( v. clone ( ) ) {
103
119
additional_properties. insert ( k, value) ;
@@ -109,6 +125,7 @@ impl<'de> Deserialize<'de> for MetricDashboardAttributes {
109
125
let content = MetricDashboardAttributes {
110
126
popularity,
111
127
title,
128
+ url,
112
129
additional_properties,
113
130
_unparsed,
114
131
} ;
0 commit comments