Skip to content

Commit e2014d7

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add API Key ID to rum application response (#939)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 910b080 commit e2014d7

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35837,6 +35837,12 @@ components:
3583735837
RUMApplicationAttributes:
3583835838
description: RUM application attributes.
3583935839
properties:
35840+
api_key_id:
35841+
description: ID of the API key associated with the application.
35842+
example: 123456789
35843+
format: int32
35844+
maximum: 2147483647
35845+
type: integer
3584035846
application_id:
3584135847
description: ID of the RUM application.
3584235848
example: abcd1234-0000-0000-abcd-1234abcd5678

src/datadogV2/model/model_rum_application_attributes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct RUMApplicationAttributes {
14+
/// ID of the API key associated with the application.
15+
#[serde(rename = "api_key_id")]
16+
pub api_key_id: Option<i32>,
1417
/// ID of the RUM application.
1518
#[serde(rename = "application_id")]
1619
pub application_id: String,
@@ -67,6 +70,7 @@ impl RUMApplicationAttributes {
6770
updated_by_handle: String,
6871
) -> RUMApplicationAttributes {
6972
RUMApplicationAttributes {
73+
api_key_id: None,
7074
application_id,
7175
client_token,
7276
created_at,
@@ -84,6 +88,11 @@ impl RUMApplicationAttributes {
8488
}
8589
}
8690

91+
pub fn api_key_id(mut self, value: i32) -> Self {
92+
self.api_key_id = Some(value);
93+
self
94+
}
95+
8796
pub fn hash(mut self, value: String) -> Self {
8897
self.hash = Some(value);
8998
self
@@ -125,6 +134,7 @@ impl<'de> Deserialize<'de> for RUMApplicationAttributes {
125134
where
126135
M: MapAccess<'a>,
127136
{
137+
let mut api_key_id: Option<i32> = None;
128138
let mut application_id: Option<String> = None;
129139
let mut client_token: Option<String> = None;
130140
let mut created_at: Option<i64> = None;
@@ -145,6 +155,12 @@ impl<'de> Deserialize<'de> for RUMApplicationAttributes {
145155

146156
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
147157
match k.as_str() {
158+
"api_key_id" => {
159+
if v.is_null() {
160+
continue;
161+
}
162+
api_key_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
163+
}
148164
"application_id" => {
149165
application_id =
150166
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
@@ -217,6 +233,7 @@ impl<'de> Deserialize<'de> for RUMApplicationAttributes {
217233
.ok_or_else(|| M::Error::missing_field("updated_by_handle"))?;
218234

219235
let content = RUMApplicationAttributes {
236+
api_key_id,
220237
application_id,
221238
client_token,
222239
created_at,

0 commit comments

Comments
 (0)