2121from typing import Any , ClassVar , Dict , List , Optional , Union
2222from graphsignal .client .models .histogram import Histogram
2323from graphsignal .client .models .metric_type import MetricType
24- from graphsignal .client .models .rate import Rate
24+ from graphsignal .client .models .summary import Summary
2525from graphsignal .client .models .tag import Tag
2626from typing import Optional , Set
2727from typing_extensions import Self
@@ -37,11 +37,11 @@ class Metric(BaseModel):
3737 is_time : Optional [StrictBool ] = Field (default = False , description = "Indicates if the metric is in nanoseconds." )
3838 is_size : Optional [StrictBool ] = Field (default = False , description = "Indicates if the metric is in bytes." )
3939 gauge : Optional [Union [StrictFloat , StrictInt ]] = Field (default = None , description = "The value for gauge type metrics." )
40- counter : Optional [Union [StrictFloat , StrictInt ]] = Field (default = None , description = "The value for counter type metrics." )
41- rate : Optional [Rate ] = Field (default = None , description = "The value for rate type metrics." )
40+ total : Optional [Union [StrictFloat , StrictInt ]] = Field (default = None , description = "The value for counter type metrics." )
41+ summary : Optional [Summary ] = Field (default = None , description = "The value for summary type metrics." )
4242 histogram : Optional [Histogram ] = Field (default = None , description = "The histogram data for histogram type metrics." )
4343 update_ts : StrictInt = Field (description = "Unix timestamp (seconds) when the metric was last updated." )
44- __properties : ClassVar [List [str ]] = ["name" , "tags" , "type" , "unit" , "is_time" , "is_size" , "gauge" , "counter " , "rate " , "histogram" , "update_ts" ]
44+ __properties : ClassVar [List [str ]] = ["name" , "tags" , "type" , "unit" , "is_time" , "is_size" , "gauge" , "total " , "summary " , "histogram" , "update_ts" ]
4545
4646 model_config = ConfigDict (
4747 populate_by_name = True ,
@@ -89,9 +89,9 @@ def to_dict(self) -> Dict[str, Any]:
8989 if _item_tags :
9090 _items .append (_item_tags .to_dict ())
9191 _dict ['tags' ] = _items
92- # override the default output from pydantic by calling `to_dict()` of rate
93- if self .rate :
94- _dict ['rate ' ] = self .rate .to_dict ()
92+ # override the default output from pydantic by calling `to_dict()` of summary
93+ if self .summary :
94+ _dict ['summary ' ] = self .summary .to_dict ()
9595 # override the default output from pydantic by calling `to_dict()` of histogram
9696 if self .histogram :
9797 _dict ['histogram' ] = self .histogram .to_dict ()
@@ -114,8 +114,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
114114 "is_time" : obj .get ("is_time" ) if obj .get ("is_time" ) is not None else False ,
115115 "is_size" : obj .get ("is_size" ) if obj .get ("is_size" ) is not None else False ,
116116 "gauge" : obj .get ("gauge" ),
117- "counter " : obj .get ("counter " ),
118- "rate " : Rate .from_dict (obj ["rate " ]) if obj .get ("rate " ) is not None else None ,
117+ "total " : obj .get ("total " ),
118+ "summary " : Summary .from_dict (obj ["summary " ]) if obj .get ("summary " ) is not None else None ,
119119 "histogram" : Histogram .from_dict (obj ["histogram" ]) if obj .get ("histogram" ) is not None else None ,
120120 "update_ts" : obj .get ("update_ts" )
121121 })
0 commit comments