Skip to content

Commit c23ab44

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Product Scales support to RUM v2 Applications API (#852)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 40b2be9 commit c23ab44

27 files changed

+1063
-37
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "fde8b90",
3-
"generated": "2025-08-18 20:37:38.148"
2+
"spec_repo_commit": "4413e63",
3+
"generated": "2025-08-19 20:33:59.967"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32160,6 +32160,8 @@ components:
3216032160
format: int32
3216132161
maximum: 2147483647
3216232162
type: integer
32163+
product_scales:
32164+
$ref: '#/components/schemas/RUMProductScales'
3216332165
type:
3216432166
description: Type of the RUM application. Supported values are `browser`,
3216532167
`ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`,
@@ -32204,6 +32206,10 @@ components:
3220432206
description: Name of the RUM application.
3220532207
example: my_new_rum_application
3220632208
type: string
32209+
product_analytics_retention_state:
32210+
$ref: '#/components/schemas/RUMProductAnalyticsRetentionState'
32211+
rum_event_processing_state:
32212+
$ref: '#/components/schemas/RUMEventProcessingState'
3220732213
type:
3220832214
description: Type of the RUM application. Supported values are `browser`,
3220932215
`ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`,
@@ -32278,6 +32284,8 @@ components:
3227832284
format: int32
3227932285
maximum: 2147483647
3228032286
type: integer
32287+
product_scales:
32288+
$ref: '#/components/schemas/RUMProductScales'
3228132289
type:
3228232290
description: Type of the RUM application. Supported values are `browser`,
3228332291
`ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`,
@@ -32349,6 +32357,10 @@ components:
3234932357
description: Name of the RUM application.
3235032358
example: updated_name_for_my_existing_rum_application
3235132359
type: string
32360+
product_analytics_retention_state:
32361+
$ref: '#/components/schemas/RUMProductAnalyticsRetentionState'
32362+
rum_event_processing_state:
32363+
$ref: '#/components/schemas/RUMEventProcessingState'
3235232364
type:
3235332365
description: Type of the RUM application. Supported values are `browser`,
3235432366
`ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`,
@@ -32477,6 +32489,33 @@ components:
3247732489
format: date-time
3247832490
type: string
3247932491
type: object
32492+
RUMEventProcessingScale:
32493+
description: RUM event processing scale configuration.
32494+
properties:
32495+
last_modified_at:
32496+
description: Timestamp in milliseconds when this scale was last modified.
32497+
example: 1721897494108
32498+
format: int64
32499+
type: integer
32500+
state:
32501+
$ref: '#/components/schemas/RUMEventProcessingState'
32502+
type: object
32503+
RUMEventProcessingState:
32504+
description: Configures which RUM events are processed and stored for the application.
32505+
enum:
32506+
- ALL
32507+
- ERROR_FOCUSED_MODE
32508+
- NONE
32509+
example: ALL
32510+
type: string
32511+
x-enum-descriptions:
32512+
- Process and store all RUM events (sessions, views, actions, resources, errors)
32513+
- Process and store only error events and related critical events
32514+
- "Disable RUM event processing\u2014no events are stored"
32515+
x-enum-varnames:
32516+
- ALL
32517+
- ERROR_FOCUSED_MODE
32518+
- NONE
3248032519
RUMEventType:
3248132520
default: rum
3248232521
description: Type of the event.
@@ -32583,6 +32622,39 @@ components:
3258332622
RUMGroupByTotalString:
3258432623
description: A string to use as the key value for the total bucket.
3258532624
type: string
32625+
RUMProductAnalyticsRetentionScale:
32626+
description: Product Analytics retention scale configuration.
32627+
properties:
32628+
last_modified_at:
32629+
description: Timestamp in milliseconds when this scale was last modified.
32630+
example: 1747922145974
32631+
format: int64
32632+
type: integer
32633+
state:
32634+
$ref: '#/components/schemas/RUMProductAnalyticsRetentionState'
32635+
type: object
32636+
RUMProductAnalyticsRetentionState:
32637+
description: Controls the retention policy for Product Analytics data derived
32638+
from RUM events.
32639+
enum:
32640+
- MAX
32641+
- NONE
32642+
example: MAX
32643+
type: string
32644+
x-enum-descriptions:
32645+
- Store Product Analytics data for the maximum available retention period
32646+
- Do not store Product Analytics data
32647+
x-enum-varnames:
32648+
- MAX
32649+
- NONE
32650+
RUMProductScales:
32651+
description: Product Scales configuration for the RUM application.
32652+
properties:
32653+
product_analytics_retention_scale:
32654+
$ref: '#/components/schemas/RUMProductAnalyticsRetentionScale'
32655+
rum_event_processing_scale:
32656+
$ref: '#/components/schemas/RUMEventProcessingScale'
32657+
type: object
3258632658
RUMQueryFilter:
3258732659
description: The search and filter query settings.
3258832660
properties:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Create a new RUM application with Product Scales returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_rum::RUMAPI;
4+
use datadog_api_client::datadogV2::model::RUMApplicationCreate;
5+
use datadog_api_client::datadogV2::model::RUMApplicationCreateAttributes;
6+
use datadog_api_client::datadogV2::model::RUMApplicationCreateRequest;
7+
use datadog_api_client::datadogV2::model::RUMApplicationCreateType;
8+
use datadog_api_client::datadogV2::model::RUMEventProcessingState;
9+
use datadog_api_client::datadogV2::model::RUMProductAnalyticsRetentionState;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
let body = RUMApplicationCreateRequest::new(RUMApplicationCreate::new(
14+
RUMApplicationCreateAttributes::new(
15+
"test-rum-with-product-scales-5c67ebb32077e1d9".to_string(),
16+
)
17+
.product_analytics_retention_state(RUMProductAnalyticsRetentionState::NONE)
18+
.rum_event_processing_state(RUMEventProcessingState::ERROR_FOCUSED_MODE)
19+
.type_("browser".to_string()),
20+
RUMApplicationCreateType::RUM_APPLICATION_CREATE,
21+
));
22+
let configuration = datadog::Configuration::new();
23+
let api = RUMAPI::with_config(configuration);
24+
let resp = api.create_rum_application(body).await;
25+
if let Ok(value) = resp {
26+
println!("{:#?}", value);
27+
} else {
28+
println!("{:#?}", resp.unwrap_err());
29+
}
30+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Update a RUM application with Product Scales returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_rum::RUMAPI;
4+
use datadog_api_client::datadogV2::model::RUMApplicationUpdate;
5+
use datadog_api_client::datadogV2::model::RUMApplicationUpdateAttributes;
6+
use datadog_api_client::datadogV2::model::RUMApplicationUpdateRequest;
7+
use datadog_api_client::datadogV2::model::RUMApplicationUpdateType;
8+
use datadog_api_client::datadogV2::model::RUMEventProcessingState;
9+
use datadog_api_client::datadogV2::model::RUMProductAnalyticsRetentionState;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
// there is a valid "rum_application" in the system
14+
let rum_application_data_id = std::env::var("RUM_APPLICATION_DATA_ID").unwrap();
15+
let body = RUMApplicationUpdateRequest::new(
16+
RUMApplicationUpdate::new(
17+
rum_application_data_id.clone(),
18+
RUMApplicationUpdateType::RUM_APPLICATION_UPDATE,
19+
)
20+
.attributes(
21+
RUMApplicationUpdateAttributes::new()
22+
.name("updated_rum_with_product_scales".to_string())
23+
.product_analytics_retention_state(RUMProductAnalyticsRetentionState::MAX)
24+
.rum_event_processing_state(RUMEventProcessingState::ALL),
25+
),
26+
);
27+
let configuration = datadog::Configuration::new();
28+
let api = RUMAPI::with_config(configuration);
29+
let resp = api
30+
.update_rum_application(rum_application_data_id.clone(), body)
31+
.await;
32+
if let Ok(value) = resp {
33+
println!("{:#?}", value);
34+
} else {
35+
println!("{:#?}", resp.unwrap_err());
36+
}
37+
}

src/datadogV2/model/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4364,6 +4364,16 @@ pub mod model_rum_application_list;
43644364
pub use self::model_rum_application_list::RUMApplicationList;
43654365
pub mod model_rum_application_list_attributes;
43664366
pub use self::model_rum_application_list_attributes::RUMApplicationListAttributes;
4367+
pub mod model_rum_product_scales;
4368+
pub use self::model_rum_product_scales::RUMProductScales;
4369+
pub mod model_rum_product_analytics_retention_scale;
4370+
pub use self::model_rum_product_analytics_retention_scale::RUMProductAnalyticsRetentionScale;
4371+
pub mod model_rum_product_analytics_retention_state;
4372+
pub use self::model_rum_product_analytics_retention_state::RUMProductAnalyticsRetentionState;
4373+
pub mod model_rum_event_processing_scale;
4374+
pub use self::model_rum_event_processing_scale::RUMEventProcessingScale;
4375+
pub mod model_rum_event_processing_state;
4376+
pub use self::model_rum_event_processing_state::RUMEventProcessingState;
43674377
pub mod model_rum_application_list_type;
43684378
pub use self::model_rum_application_list_type::RUMApplicationListType;
43694379
pub mod model_rum_application_create_request;

src/datadogV2/model/model_rum_application_attributes.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ pub struct RUMApplicationAttributes {
3535
/// Org ID of the RUM application.
3636
#[serde(rename = "org_id")]
3737
pub org_id: i32,
38+
/// Product Scales configuration for the RUM application.
39+
#[serde(rename = "product_scales")]
40+
pub product_scales: Option<crate::datadogV2::model::RUMProductScales>,
3841
/// Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`.
3942
#[serde(rename = "type")]
4043
pub type_: String,
@@ -72,6 +75,7 @@ impl RUMApplicationAttributes {
7275
is_active: None,
7376
name,
7477
org_id,
78+
product_scales: None,
7579
type_,
7680
updated_at,
7781
updated_by_handle,
@@ -90,6 +94,11 @@ impl RUMApplicationAttributes {
9094
self
9195
}
9296

97+
pub fn product_scales(mut self, value: crate::datadogV2::model::RUMProductScales) -> Self {
98+
self.product_scales = Some(value);
99+
self
100+
}
101+
93102
pub fn additional_properties(
94103
mut self,
95104
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -124,6 +133,7 @@ impl<'de> Deserialize<'de> for RUMApplicationAttributes {
124133
let mut is_active: Option<bool> = None;
125134
let mut name: Option<String> = None;
126135
let mut org_id: Option<i32> = None;
136+
let mut product_scales: Option<crate::datadogV2::model::RUMProductScales> = None;
127137
let mut type_: Option<String> = None;
128138
let mut updated_at: Option<i64> = None;
129139
let mut updated_by_handle: Option<String> = None;
@@ -168,6 +178,13 @@ impl<'de> Deserialize<'de> for RUMApplicationAttributes {
168178
"org_id" => {
169179
org_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
170180
}
181+
"product_scales" => {
182+
if v.is_null() {
183+
continue;
184+
}
185+
product_scales =
186+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
187+
}
171188
"type" => {
172189
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
173190
}
@@ -208,6 +225,7 @@ impl<'de> Deserialize<'de> for RUMApplicationAttributes {
208225
is_active,
209226
name,
210227
org_id,
228+
product_scales,
211229
type_,
212230
updated_at,
213231
updated_by_handle,

src/datadogV2/model/model_rum_application_create_attributes.rs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ pub struct RUMApplicationCreateAttributes {
1414
/// Name of the RUM application.
1515
#[serde(rename = "name")]
1616
pub name: String,
17+
/// Controls the retention policy for Product Analytics data derived from RUM events.
18+
#[serde(rename = "product_analytics_retention_state")]
19+
pub product_analytics_retention_state:
20+
Option<crate::datadogV2::model::RUMProductAnalyticsRetentionState>,
21+
/// Configures which RUM events are processed and stored for the application.
22+
#[serde(rename = "rum_event_processing_state")]
23+
pub rum_event_processing_state: Option<crate::datadogV2::model::RUMEventProcessingState>,
1724
/// Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`.
1825
#[serde(rename = "type")]
1926
pub type_: Option<String>,
@@ -28,12 +35,30 @@ impl RUMApplicationCreateAttributes {
2835
pub fn new(name: String) -> RUMApplicationCreateAttributes {
2936
RUMApplicationCreateAttributes {
3037
name,
38+
product_analytics_retention_state: None,
39+
rum_event_processing_state: None,
3140
type_: None,
3241
additional_properties: std::collections::BTreeMap::new(),
3342
_unparsed: false,
3443
}
3544
}
3645

46+
pub fn product_analytics_retention_state(
47+
mut self,
48+
value: crate::datadogV2::model::RUMProductAnalyticsRetentionState,
49+
) -> Self {
50+
self.product_analytics_retention_state = Some(value);
51+
self
52+
}
53+
54+
pub fn rum_event_processing_state(
55+
mut self,
56+
value: crate::datadogV2::model::RUMEventProcessingState,
57+
) -> Self {
58+
self.rum_event_processing_state = Some(value);
59+
self
60+
}
61+
3762
pub fn type_(mut self, value: String) -> Self {
3863
self.type_ = Some(value);
3964
self
@@ -66,6 +91,12 @@ impl<'de> Deserialize<'de> for RUMApplicationCreateAttributes {
6691
M: MapAccess<'a>,
6792
{
6893
let mut name: Option<String> = None;
94+
let mut product_analytics_retention_state: Option<
95+
crate::datadogV2::model::RUMProductAnalyticsRetentionState,
96+
> = None;
97+
let mut rum_event_processing_state: Option<
98+
crate::datadogV2::model::RUMEventProcessingState,
99+
> = None;
69100
let mut type_: Option<String> = None;
70101
let mut additional_properties: std::collections::BTreeMap<
71102
String,
@@ -78,6 +109,40 @@ impl<'de> Deserialize<'de> for RUMApplicationCreateAttributes {
78109
"name" => {
79110
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
80111
}
112+
"product_analytics_retention_state" => {
113+
if v.is_null() {
114+
continue;
115+
}
116+
product_analytics_retention_state =
117+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
118+
if let Some(ref _product_analytics_retention_state) =
119+
product_analytics_retention_state
120+
{
121+
match _product_analytics_retention_state {
122+
crate::datadogV2::model::RUMProductAnalyticsRetentionState::UnparsedObject(_product_analytics_retention_state) => {
123+
_unparsed = true;
124+
},
125+
_ => {}
126+
}
127+
}
128+
}
129+
"rum_event_processing_state" => {
130+
if v.is_null() {
131+
continue;
132+
}
133+
rum_event_processing_state =
134+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
135+
if let Some(ref _rum_event_processing_state) =
136+
rum_event_processing_state
137+
{
138+
match _rum_event_processing_state {
139+
crate::datadogV2::model::RUMEventProcessingState::UnparsedObject(_rum_event_processing_state) => {
140+
_unparsed = true;
141+
},
142+
_ => {}
143+
}
144+
}
145+
}
81146
"type" => {
82147
if v.is_null() {
83148
continue;
@@ -95,6 +160,8 @@ impl<'de> Deserialize<'de> for RUMApplicationCreateAttributes {
95160

96161
let content = RUMApplicationCreateAttributes {
97162
name,
163+
product_analytics_retention_state,
164+
rum_event_processing_state,
98165
type_,
99166
additional_properties,
100167
_unparsed,

0 commit comments

Comments
 (0)