Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-16 13:56:31.640964",
"spec_repo_commit": "dac51bc6"
"regenerated": "2025-05-19 15:26:07.929930",
"spec_repo_commit": "f89617c7"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-16 13:56:31.658086",
"spec_repo_commit": "dac51bc6"
"regenerated": "2025-05-19 15:26:07.945723",
"spec_repo_commit": "f89617c7"
}
}
}
5 changes: 5 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6729,6 +6729,11 @@ components:
Monitor:
description: Object describing a monitor.
properties:
classification:
description: The classification of the monitor.
example: log
readOnly: true
type: string
created:
description: Timestamp of the monitor creation.
format: date-time
Expand Down
18 changes: 18 additions & 0 deletions src/datadogV1/model/model_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct Monitor {
/// The classification of the monitor.
#[serde(rename = "classification")]
pub classification: Option<String>,
/// Timestamp of the monitor creation.
#[serde(rename = "created")]
pub created: Option<chrono::DateTime<chrono::Utc>>,
Expand Down Expand Up @@ -84,6 +87,7 @@ pub struct Monitor {
impl Monitor {
pub fn new(query: String, type_: crate::datadogV1::model::MonitorType) -> Monitor {
Monitor {
classification: None,
created: None,
creator: None,
deleted: None,
Expand All @@ -106,6 +110,11 @@ impl Monitor {
}
}

pub fn classification(mut self, value: String) -> Self {
self.classification = Some(value);
self
}

pub fn created(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
self.created = Some(value);
self
Expand Down Expand Up @@ -210,6 +219,7 @@ impl<'de> Deserialize<'de> for Monitor {
where
M: MapAccess<'a>,
{
let mut classification: Option<String> = None;
let mut created: Option<chrono::DateTime<chrono::Utc>> = None;
let mut creator: Option<crate::datadogV1::model::Creator> = None;
let mut deleted: Option<Option<chrono::DateTime<chrono::Utc>>> = None;
Expand All @@ -236,6 +246,13 @@ impl<'de> Deserialize<'de> for Monitor {

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"classification" => {
if v.is_null() {
continue;
}
classification =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"created" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -355,6 +372,7 @@ impl<'de> Deserialize<'de> for Monitor {
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;

let content = Monitor {
classification,
created,
creator,
deleted,
Expand Down
Loading