Skip to content

Commit 0815bf1

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add editable field to critical assets attributes (#1829)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent db86089 commit 0815bf1

10 files changed

Lines changed: 51 additions & 30 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87672,6 +87672,10 @@ components:
8767287672
description: A description of the critical asset.
8767387673
example: Production database servers handling PII
8767487674
type: string
87675+
editable:
87676+
description: Whether the critical asset is editable.
87677+
example: true
87678+
type: boolean
8767587679
enabled:
8767687680
description: Whether the critical asset is enabled.
8767787681
example: true

src/datadogV2/model/model_security_monitoring_critical_asset_attributes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ pub struct SecurityMonitoringCriticalAssetAttributes {
2323
/// A description of the critical asset.
2424
#[serde(rename = "description")]
2525
pub description: Option<String>,
26+
/// Whether the critical asset is editable.
27+
#[serde(rename = "editable")]
28+
pub editable: Option<bool>,
2629
/// Whether the critical asset is enabled.
2730
#[serde(rename = "enabled")]
2831
pub enabled: Option<bool>,
@@ -64,6 +67,7 @@ impl SecurityMonitoringCriticalAssetAttributes {
6467
creation_date: None,
6568
creator: None,
6669
description: None,
70+
editable: None,
6771
enabled: None,
6872
query: None,
6973
rule_query: None,
@@ -98,6 +102,11 @@ impl SecurityMonitoringCriticalAssetAttributes {
98102
self
99103
}
100104

105+
pub fn editable(mut self, value: bool) -> Self {
106+
self.editable = Some(value);
107+
self
108+
}
109+
101110
pub fn enabled(mut self, value: bool) -> Self {
102111
self.enabled = Some(value);
103112
self
@@ -182,6 +191,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringCriticalAssetAttributes {
182191
let mut creation_date: Option<i64> = None;
183192
let mut creator: Option<crate::datadogV2::model::SecurityMonitoringUser> = None;
184193
let mut description: Option<String> = None;
194+
let mut editable: Option<bool> = None;
185195
let mut enabled: Option<bool> = None;
186196
let mut query: Option<String> = None;
187197
let mut rule_query: Option<String> = None;
@@ -228,6 +238,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringCriticalAssetAttributes {
228238
description =
229239
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
230240
}
241+
"editable" => {
242+
if v.is_null() {
243+
continue;
244+
}
245+
editable = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
246+
}
231247
"enabled" => {
232248
if v.is_null() {
233249
continue;
@@ -305,6 +321,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringCriticalAssetAttributes {
305321
creation_date,
306322
creator,
307323
description,
324+
editable,
308325
enabled,
309326
query,
310327
rule_query,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2026-01-02T19:09:02.221Z
1+
2026-07-10T15:48:20.043Z

tests/scenarios/cassettes/v2/security_monitoring/Create-a-critical-asset-returns-OK-response.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"data\":{\"attributes\":{\"query\":\"host:testcreateacriticalassetreturnsokresponse1767380942\",\"rule_query\":\"type:(log_detection OR signal_correlation OR workload_security OR application_security) source:cloudtrail\",\"severity\":\"decrease\",\"tags\":[\"team:security\",\"env:test\"]},\"type\":\"critical_assets\"}}",
6+
"string": "{\"data\":{\"attributes\":{\"query\":\"host:testcreateacriticalassetreturnsokresponse1783698500\",\"rule_query\":\"type:(log_detection OR signal_correlation OR workload_security OR application_security) source:cloudtrail\",\"severity\":\"decrease\",\"tags\":[\"team:security\",\"env:test\"]},\"type\":\"critical_assets\"}}",
77
"encoding": null
88
},
99
"headers": {
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"93d5a224-589d-4d6d-adbf-f6657f484ecc\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":1445416,\"creation_date\":1767380942322,\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"},\"enabled\":true,\"query\":\"host:testcreateacriticalassetreturnsokresponse1767380942\",\"rule_query\":\"type:(log_detection OR signal_correlation OR workload_security OR application_security) source:cloudtrail\",\"severity\":\"decrease\",\"tags\":[\"team:security\",\"env:test\"],\"update_author_id\":1445416,\"update_date\":1767380942322,\"updater\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"},\"version\":1}}}",
22+
"string": "{\"data\":{\"id\":\"46d617c7-fba8-49f5-9274-dca43a6a97a5\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1783698500440,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"editable\":true,\"enabled\":true,\"query\":\"host:testcreateacriticalassetreturnsokresponse1783698500\",\"rule_query\":\"type:(log_detection OR signal_correlation OR workload_security OR application_security) source:cloudtrail\",\"severity\":\"decrease\",\"tags\":[\"team:security\",\"env:test\"],\"update_author_id\":2320499,\"update_date\":1783698500440,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,7 +32,7 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Fri, 02 Jan 2026 19:09:02 GMT"
35+
"recorded_at": "Fri, 10 Jul 2026 15:48:20 GMT"
3636
},
3737
{
3838
"request": {
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
"method": "delete",
46-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/93d5a224-589d-4d6d-adbf-f6657f484ecc"
46+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/46d617c7-fba8-49f5-9274-dca43a6a97a5"
4747
},
4848
"response": {
4949
"body": {
@@ -56,7 +56,7 @@
5656
"message": "No Content"
5757
}
5858
},
59-
"recorded_at": "Fri, 02 Jan 2026 19:09:02 GMT"
59+
"recorded_at": "Fri, 10 Jul 2026 15:48:20 GMT"
6060
}
6161
],
6262
"recorded_with": "VCR 6.0.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2026-01-12T19:41:34.038Z
1+
2026-07-10T15:48:20.956Z

tests/scenarios/cassettes/v2/security_monitoring/Delete-a-critical-asset-returns-OK-response.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"f340fbe7-ed28-466e-924e-7e23475dd405\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1768246895425,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"query\":\"security:monitoring\",\"rule_query\":\"source:k9\",\"severity\":\"medium\",\"tags\":[\"team:security\"],\"update_author_id\":2320499,\"update_date\":1768246895425,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}",
22+
"string": "{\"data\":{\"id\":\"5bda0fad-ce07-4921-9227-d0131107724a\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1783698501011,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"editable\":true,\"enabled\":true,\"query\":\"security:monitoring\",\"rule_query\":\"source:k9\",\"severity\":\"medium\",\"tags\":[\"team:security\"],\"update_author_id\":2320499,\"update_date\":1783698501011,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,7 +32,7 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Mon, 12 Jan 2026 19:41:34 GMT"
35+
"recorded_at": "Fri, 10 Jul 2026 15:48:20 GMT"
3636
},
3737
{
3838
"request": {
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
"method": "delete",
46-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/f340fbe7-ed28-466e-924e-7e23475dd405"
46+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/5bda0fad-ce07-4921-9227-d0131107724a"
4747
},
4848
"response": {
4949
"body": {
@@ -56,7 +56,7 @@
5656
"message": "No Content"
5757
}
5858
},
59-
"recorded_at": "Mon, 12 Jan 2026 19:41:34 GMT"
59+
"recorded_at": "Fri, 10 Jul 2026 15:48:20 GMT"
6060
},
6161
{
6262
"request": {
@@ -67,11 +67,11 @@
6767
]
6868
},
6969
"method": "delete",
70-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/f340fbe7-ed28-466e-924e-7e23475dd405"
70+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/5bda0fad-ce07-4921-9227-d0131107724a"
7171
},
7272
"response": {
7373
"body": {
74-
"string": "{\"errors\":[\"not_found(Critical asset with ID f340fbe7-ed28-466e-924e-7e23475dd405 not found)\"]}",
74+
"string": "{\"errors\":[\"not_found(Critical asset with ID 5bda0fad-ce07-4921-9227-d0131107724a not found)\"]}",
7575
"encoding": null
7676
},
7777
"headers": {
@@ -84,7 +84,7 @@
8484
"message": "Not Found"
8585
}
8686
},
87-
"recorded_at": "Mon, 12 Jan 2026 19:41:34 GMT"
87+
"recorded_at": "Fri, 10 Jul 2026 15:48:20 GMT"
8888
}
8989
],
9090
"recorded_with": "VCR 6.0.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2026-01-12T19:41:36.187Z
1+
2026-07-10T15:48:22.074Z

tests/scenarios/cassettes/v2/security_monitoring/Get-a-critical-asset-returns-OK-response.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"a9dfa43c-734a-4984-bed6-68934254cb59\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1768246896448,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"query\":\"security:monitoring\",\"rule_query\":\"source:k9\",\"severity\":\"medium\",\"tags\":[\"team:security\"],\"update_author_id\":2320499,\"update_date\":1768246896448,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}",
22+
"string": "{\"data\":{\"id\":\"c0d99d2c-a9c7-431a-9521-e0f4a40f1efd\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1783698502447,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"editable\":true,\"enabled\":true,\"query\":\"security:monitoring\",\"rule_query\":\"source:k9\",\"severity\":\"medium\",\"tags\":[\"team:security\"],\"update_author_id\":2320499,\"update_date\":1783698502447,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,7 +32,7 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Mon, 12 Jan 2026 19:41:36 GMT"
35+
"recorded_at": "Fri, 10 Jul 2026 15:48:22 GMT"
3636
},
3737
{
3838
"request": {
@@ -43,11 +43,11 @@
4343
]
4444
},
4545
"method": "get",
46-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/a9dfa43c-734a-4984-bed6-68934254cb59"
46+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/c0d99d2c-a9c7-431a-9521-e0f4a40f1efd"
4747
},
4848
"response": {
4949
"body": {
50-
"string": "{\"data\":{\"id\":\"a9dfa43c-734a-4984-bed6-68934254cb59\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1768246896448,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"query\":\"security:monitoring\",\"rule_query\":\"source:k9\",\"severity\":\"medium\",\"tags\":[\"team:security\"],\"update_author_id\":2320499,\"update_date\":1768246896448,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}",
50+
"string": "{\"data\":{\"id\":\"c0d99d2c-a9c7-431a-9521-e0f4a40f1efd\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1783698502447,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"editable\":true,\"enabled\":true,\"query\":\"security:monitoring\",\"rule_query\":\"source:k9\",\"severity\":\"medium\",\"tags\":[\"team:security\"],\"update_author_id\":2320499,\"update_date\":1783698502447,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}",
5151
"encoding": null
5252
},
5353
"headers": {
@@ -60,7 +60,7 @@
6060
"message": "OK"
6161
}
6262
},
63-
"recorded_at": "Mon, 12 Jan 2026 19:41:36 GMT"
63+
"recorded_at": "Fri, 10 Jul 2026 15:48:22 GMT"
6464
},
6565
{
6666
"request": {
@@ -71,7 +71,7 @@
7171
]
7272
},
7373
"method": "delete",
74-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/a9dfa43c-734a-4984-bed6-68934254cb59"
74+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/c0d99d2c-a9c7-431a-9521-e0f4a40f1efd"
7575
},
7676
"response": {
7777
"body": {
@@ -84,7 +84,7 @@
8484
"message": "No Content"
8585
}
8686
},
87-
"recorded_at": "Mon, 12 Jan 2026 19:41:36 GMT"
87+
"recorded_at": "Fri, 10 Jul 2026 15:48:22 GMT"
8888
}
8989
],
9090
"recorded_with": "VCR 6.0.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2026-01-12T19:41:37.223Z
1+
2026-07-10T15:48:23.863Z

tests/scenarios/cassettes/v2/security_monitoring/Update-a-critical-asset-returns-OK-response.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"8fb467ae-b5c8-4bb1-822d-7648fe10a912\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1768246897503,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"query\":\"security:monitoring\",\"rule_query\":\"source:k9\",\"severity\":\"medium\",\"tags\":[\"team:security\"],\"update_author_id\":2320499,\"update_date\":1768246897503,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}",
22+
"string": "{\"data\":{\"id\":\"6ce994c9-312c-476a-b102-50f2fabec567\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1783698504272,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"editable\":true,\"enabled\":true,\"query\":\"security:monitoring\",\"rule_query\":\"source:k9\",\"severity\":\"medium\",\"tags\":[\"team:security\"],\"update_author_id\":2320499,\"update_date\":1783698504272,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,7 +32,7 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Mon, 12 Jan 2026 19:41:37 GMT"
35+
"recorded_at": "Fri, 10 Jul 2026 15:48:23 GMT"
3636
},
3737
{
3838
"request": {
@@ -49,11 +49,11 @@
4949
]
5050
},
5151
"method": "patch",
52-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/8fb467ae-b5c8-4bb1-822d-7648fe10a912"
52+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/6ce994c9-312c-476a-b102-50f2fabec567"
5353
},
5454
"response": {
5555
"body": {
56-
"string": "{\"data\":{\"id\":\"8fb467ae-b5c8-4bb1-822d-7648fe10a912\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1768246897503,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":false,\"query\":\"no:alert\",\"rule_query\":\"type:(log_detection OR signal_correlation OR workload_security OR application_security) ruleId:djg-ktx-ipq\",\"severity\":\"decrease\",\"tags\":[\"env:production\"],\"update_author_id\":2320499,\"update_date\":1768246897863,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":2}}}",
56+
"string": "{\"data\":{\"id\":\"6ce994c9-312c-476a-b102-50f2fabec567\",\"type\":\"critical_assets\",\"attributes\":{\"creation_author_id\":2320499,\"creation_date\":1783698504272,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"editable\":true,\"enabled\":false,\"query\":\"no:alert\",\"rule_query\":\"type:(log_detection OR signal_correlation OR workload_security OR application_security) ruleId:djg-ktx-ipq\",\"severity\":\"decrease\",\"tags\":[\"env:production\"],\"update_author_id\":2320499,\"update_date\":1783698504730,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":2}}}",
5757
"encoding": null
5858
},
5959
"headers": {
@@ -66,7 +66,7 @@
6666
"message": "OK"
6767
}
6868
},
69-
"recorded_at": "Mon, 12 Jan 2026 19:41:37 GMT"
69+
"recorded_at": "Fri, 10 Jul 2026 15:48:23 GMT"
7070
},
7171
{
7272
"request": {
@@ -77,7 +77,7 @@
7777
]
7878
},
7979
"method": "delete",
80-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/8fb467ae-b5c8-4bb1-822d-7648fe10a912"
80+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/critical_assets/6ce994c9-312c-476a-b102-50f2fabec567"
8181
},
8282
"response": {
8383
"body": {
@@ -90,7 +90,7 @@
9090
"message": "No Content"
9191
}
9292
},
93-
"recorded_at": "Mon, 12 Jan 2026 19:41:37 GMT"
93+
"recorded_at": "Fri, 10 Jul 2026 15:48:23 GMT"
9494
}
9595
],
9696
"recorded_with": "VCR 6.0.0"

0 commit comments

Comments
 (0)